http://www.perlmonks.org?node_id=814037


in reply to Assigning output of unix command to a variable

Is the only problem that you forgot to escape the $ in $2? $2 is getting interpolated just like $_.

( Oops, I must have had this node open a while since almut already said this a while ago, and she caught a problem I missed. )