Do you know where your variables are? | |
PerlMonks |
sending a scalar to the interpreter as a commandby silentq (Novice) |
on Oct 08, 2012 at 20:41 UTC ( [id://997874]=perlquestion: print w/replies, xml ) | Need Help?? |
silentq has asked for the wisdom of the Perl Monks concerning the following question: I am attempting to build a Perl statement which I want to run as a command, storing it in a variable as I go. The reason I want to do this is that I am dealing with arrays of varying sizes, and I can't think of a way to structure the command such that it will work with any size of array. So I am building a customized version of this command in the script each time it runs so that it will fit the size of any array it encounters, storing the command in my variable, and then attempting to route it to the interpreter. But with no luck. I seem to remember when I first learned Perl years ago that there are ways to send variables to the interpreter as commands just as you can to the system using backtick-style quotes. Can anyone help? Thanks, PS here is a sample output of the command for anyone who is curious: PS I am escaping items as necessary, so that's not the problem. PPS This is based on code I found elsewhere on the forum: http://perlmonks.org/index.pl?node_id=662212
Back to
Seekers of Perl Wisdom
|
|