in reply to Execute commands in a string
Change the print to be whatever you want to do if there are errors (syntax or runtime) in the string of $code.my $sourcepackage = caller; eval "package $sourcepackage; $code"; print "Error in eval: $@" if $@ ne '';
------------ :Wq Not an editor command: Wq
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Execute commands in a string
by aplonis (Pilgrim) on Aug 15, 2004 at 20:13 UTC |