in reply to Re: 'do' command is dead? Surely not?
in thread 'do' command is dead? Surely not?
Thanks haukex - swift reply!
What, me, not using strict and warnings? ;-) Have changed 'test.pl' to the following:
use strict; use warnings; print "Hello world!\n"; my $file='test-response.pl'; unless (my $return = do $file) { warn "couldn't parse $file: $@" if $@; warn "couldn't do $file: $!" unless defined $return; warn "couldn't run $file" unless $return; } print "Did that work?\n";
Output is now
Hello world! couldn't do test-response.pl: No such file or directory at test.pl lin +e 10. couldn't run test-response.pl at test.pl line 11. Did that work?
The file 'test-response.pl' is certainly there.... (the files are on my desktop and I'm calling them from a command prompt having changed directory to the desktop, by the way).
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: 'do' command is dead? Surely not?
by Eily (Monsignor) on May 19, 2017 at 14:24 UTC | |
Re^3: 'do' command is dead? Surely not?
by KurtZ (Friar) on May 19, 2017 at 14:28 UTC | |
by davido (Cardinal) on May 19, 2017 at 14:38 UTC | |
by haukex (Archbishop) on May 19, 2017 at 16:27 UTC | |
by ACI (Acolyte) on May 19, 2017 at 17:13 UTC | |
by syphilis (Archbishop) on May 20, 2017 at 09:49 UTC | |
by ACI (Acolyte) on May 19, 2017 at 14:57 UTC | |
by KurtZ (Friar) on May 19, 2017 at 14:53 UTC | |
by tobyink (Canon) on May 19, 2017 at 15:09 UTC | |
by KurtZ (Friar) on May 19, 2017 at 15:53 UTC | |
by Anonymous Monk on May 19, 2017 at 17:58 UTC | |
| |
by dasgar (Priest) on May 19, 2017 at 18:24 UTC | |
by KurtZ (Friar) on May 19, 2017 at 21:44 UTC | |
Re^3: 'do' command is dead? Surely not?
by haukex (Archbishop) on May 19, 2017 at 14:25 UTC | |
by ACI (Acolyte) on May 19, 2017 at 14:45 UTC | |
by Corion (Patriarch) on May 19, 2017 at 14:53 UTC | |
by ACI (Acolyte) on May 19, 2017 at 15:08 UTC | |
by Corion (Patriarch) on May 19, 2017 at 17:13 UTC | |
by ACI (Acolyte) on May 19, 2017 at 15:03 UTC |
In Section
Seekers of Perl Wisdom