Syntactic Confectionery Delight | |
PerlMonks |
Re (2): Array for system() callby dmmiller2k (Chaplain) |
on Oct 23, 2001 at 22:09 UTC ( [id://120855]=note: print w/replies, xml ) | Need Help?? |
To elaborate further, use this (note double quotes): system("@Call"); instead of this: system(@Call); to achieve the same effect as your first fragment. And, BTW, you probably meant to do this:
or (slightly more efficiently) this:
rather than your original code, which is assigning values to 1-element array slices, which are sublists -- NOT arrays! -- of references to the elements of the @Call array; needless to say, although it works, it is somewhat less efficient than either of the above approaches, and bad practice besides. dmm Give a man a fish and you feed him for a day ... Teach the man to fish and you feed him for a lifetime
In Section
Seekers of Perl Wisdom
|
|