-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
autodie doesn't seem to work if perl5i invoked on the command line #248
Comments
Looks like it was working in the past, but not now. Did a git bisect on it and discovered the problem was introduced in 1c6f3e8. I'll have a look at the bug later if someone doesn't beat me to it. Would you write up a test please? It would go into t/command_line.t. |
This should work on a *nix system. I don't know how to handle the redirection on a Windows box. #!/usr/bin/env perl use Test::Simple tests => 2; my $result = qx{perl5i -e 'open my $in, "<", "nosuchfile"'}; $result = qx{perl -Mperl5i -e 'open my $in, "<", "nosuchfile"' 2>&1}; |
Sorry, correct version: #!/usr/bin/env perl use Test::Simple tests => 2; my $result = qx{perl5i -e 'open my $in, "<", "nosuchfile"' 2>&1}; $result = qx{perl -Mperl5i -e 'open my $in, "<", "nosuchfile"' 2>&1}; |
OK, I'm confused. #!/usr/bin/env perl use IPC::Run 'run'; sub myrun my $err = myrun "perl5i", q{-e open my $in, "<", "nosuchfile"}; $err = myrun "perl", q{-Mperl5i::2}, q{-e open my $in, "<", "nosuchfile"}; |
At least on my computer:
cpanm perl5i
perl5i is up to date. (v2.11.2)
$ perl5i -e 'open my $in, "<", "nosuchfile"'
$ perl -Mperl5i::2 -e 'open my $in, "<", "nosuchfile"'
Can't open 'nosuchfile' for reading: 'No such file or directory' at -e line 1
$ cat test.pl
!/usr/bin/env perl5i
open my $in, "<", "nosuchfile";
$ ./test.pl
Can't open 'nosuchfile' for reading: 'No such file or directory' at ./test.pl line 3
The text was updated successfully, but these errors were encountered: