# works in plain perl
# fails with this compilation line:
# pp -P -r -v 99 -o packed.pl somefile.pl
BEGIN {
use File::Spec;
for (@INC) {
if ( !ref $_ && -d $_ && !File::Spec->file_name_is_absolute($_) ) {
$_ = File::Spec->rel2abs($_);
}
}
}
sub hello {
my $file = __FILE__;
warn "My file name is $file. Here is my contents:";
open(my $fh, "<", $file);
my @data = <$fh>;
warn "@data";
}
hello();
1;
####
my $T = File::Spec->catdir(File::Basename::dirname(__FILE__), 'templates');
##
##
my $T = File::Spec->catdir(File::Basename::dirname($INC{'Mojolicious/Lite.pm'} || __FILE__), 'templates');