in reply to Re: Command line to array
in thread Command line to array

eval is the easiest way to do this, since you don't end up with your own mini-language to parse; just let perl do it. Here's a very primitive command-line example:
% perl -MData::Dumper -nwe 'chomp; ($sub, $rest) = split / +/, $_, 2; eval "$sub($rest)"; print $@ if $@; print "\n) " } BEGIN { sub spew { print Dumper(@_) } print ") "'
Presumably you'll have more functions defined than that; consider using Term::Readline or similar if this is something that'll be used a lot.

hdp.