in reply to tar a files from loop

It may be the trailing new line character? Or maybe you need even more clean up than that to extract the information you need to put on the tar command line? chomp @tarfiles; may help.

Note: always use strictures (use strict; use warnings;). The missing my in front of @tarfiles=`ls dirname`; implies either you don't, or your scope for @tarfiles is too large.


True laziness is hard work

Replies are listed 'Best First'.
Re^2: tar a files from loop
by sandy1028 (Sexton) on Mar 05, 2009 at 04:06 UTC
    I have used my in front of the @tarfiles=`ls dirname`; and I removed the newline from the array @tarfiles. But still I am not able to extract values to different folder