> From: Aristotle Pagaltzis > * Konovalov, Vadim [2016-02-22 10:55]: > > + if ( __FILE__ !~ /strict\.pmc?$/ and -e __FILE__ ) { > > > This patch should not be applied. > > Looking for the file on the filesystem using -e causes the > exact same bug as you were complaining about, if the file > was packed in FatPacker style. > > FatPacker makes __FILE__ point to the fatpacked script. So > -e __FILE__ will be true. > > And __FILE__ !~ /strict\.pmc?$/ will also be true, because > __FILE__ is the name of some script. > > Therefore the error will be thrown, even though the user > did not mistype the `use strict` line. Then - how this works *now* for fatpacker - the curerct check? unless ( __FILE__ =~ /(^|[\/\\])\Q${\__PACKAGE__}\E\.pmc?$/ ) { # Can't use Carp, since Carp uses us! my (undef, $f, $l) = caller; die("Incorrect use of pragma '${\__PACKAGE__}' at $f line $l.\n"); } You must admit that __FILE__ends with "strict.pm" for __FILE__ in fatpacker > > FatPacker has a very good reason to point __FILE__ to the > fatpacked > script: this way, die() and warn() messages will contain > the actual file and line of the code that caused the > message. > > Therefore it is the check that is wrong, and not FatPacker. > > > Regards, > -- > Aristotle Pagaltzis // <http://plasmasturm.org/>Thread Previous | Thread Next