aplonis has asked for the wisdom of the Perl Monks concerning the following question:
my $os_says = ''; my $pl_says = ''; if ( open FH, '/home/foo/bar.csh' ) { while (<FH>) { # no warnings; eval { $os_says .= `$_` }; # <- Fixed. Thanks Roger! if ($@) { $pl_says .= $@ } } print "OS says: $os_says \n"; print "Perl says: $pl_says \n"; }
Roger fixed this. I had been using parens, not braces, with my eval.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: $@ with backticks inside eval
by fizbin (Chaplain) on Aug 21, 2005 at 01:33 UTC | |
by aplonis (Pilgrim) on Aug 21, 2005 at 03:20 UTC | |
|
Re: $@ with backticks inside eval
by Roger (Parson) on Aug 20, 2005 at 23:42 UTC | |
by aplonis (Pilgrim) on Aug 21, 2005 at 03:05 UTC | |
|
Re: $@ with backticks inside eval
by Roy Johnson (Monsignor) on Aug 21, 2005 at 00:46 UTC | |
by aplonis (Pilgrim) on Aug 21, 2005 at 03:12 UTC |