Home > Uncategorized > Once a Week a happy zef

Once a Week a happy zef

Since zef installs modules to a temporary directory and may or may not set the $*CWD to what we would like, we need to open files in tests carefully. Given that files of interest to a test file are in the same or a child directory of the test, we can operate relative to $*PROGRAM.

my $gitconfig-path = $*PROGRAM.parent.child('data').child('gitconfig');

That would translate to t/data/gitconfig seen from the modules base directory.

Advertisements
Categories: Uncategorized
  1. January 22, 2017 at 21:32

    Why not use `$?FILE` inside the test?

    • January 23, 2017 at 02:15

      Because I didn’t think of `$?FILE`, maybe because it feels debugish. For a single file program it should do the same as `$*PROGRAM`.

  1. January 23, 2017 at 23:50

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: