package main; shift @INC; #line 1 "script/__FILE__.925167.pl" # works in plain perl # fails with this compilation line: # pp -P -r -v 99 -o packed.pl __FILE__.925167.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;