in reply to Returning data from an eval
The second example has two errors. Firstly the number of declarations do not match the number of assignments and secondly the argument to return, while syntactically acceptable, doesn't DWIM, because the list will be coerced twice, first into an array and from that to a single scalar. Moreover it will force the return during the first iteration of the loop. The 'map' function provides a rather quick alternative.# process analysis rules foreach( @$analysis_rules ) { print eval( $_ ) . "\n"; }
# process analysis rules my @results = map( eval, @analysis_rules );
One world, one people
|
|---|