in reply to Re^3: Array of Arrays with Variable Names
in thread Array of Arrays with Variable Names

AHA! Thanks, mreece (and others). That's what I'm looking for - and it's working now. From that suggestion, I've constructed the following snippet which is just a small portion of a much larger work:
#!/usr/local/bin/perl5 -w use Getopt::Std; require "/path/datafile"; getopts('f:'); chomp $opt_f ; if ( $opt_f ) { @combined = eval "$opt_f" ; } foreach $entry ( @combined ) { print "$entry \n"; }
Thanks for your patience with a beginner. I read through the warnings about variables in array names before I posted the original post, so I was expecting a lot of people to jump onto that detail... thanks for taking the time to fully understand the problem.

Replies are listed 'Best First'.
Re^5: Array of Arrays with Variable Names
by mreece (Friar) on Aug 25, 2006 at 18:35 UTC
    one last thing, which i should have mentioned in my previous post. you should check the $@ variable for errors following the eval. consider something like:
    @combined = eval "$opt_f" ; if ($@) { die "could not construct a combined array from '$opt_f': $@"; }