in reply to Re: System command using array and pipe
in thread System command using array and pipe

Bravo! Thank you very much. Your first solution worked like a charm.

I did have some trouble getting the second solution to work. Perl is complaining about "Use of uninitialized value $_ in pattern match (m//)" when the $backup_dir is passed to the sub text_to_shell_lit. I studied the text_to_shell_lit sub for a while and could not figure out what was wrong. (BTW, what is the underscore in the argument of the sub? ... Newbie question, I know.)

  • Comment on Re^2: System command using array and pipe

Replies are listed 'Best First'.
Re^3: System command using array and pipe
by ikegami (Patriarch) on Jun 04, 2011 at 07:15 UTC

    Fixed.

    The underscore prototype makes $_ the default argument. Specifically, it makes map text_to_shell_lit, equivalent to map text_to_shell_lit($_),. I always forget I have to use $_[0] and not $_ when I use the "_" prototype.