in reply to compressing files

I think you want to use backticks:

system("tar -cvf logfiles.tar `cat $filename`");

But I'm not sure why you aren't using:

system("tar -cvf logfiles.tar @srcfiles");

That removes the need for the file.

--
<http://dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

Replies are listed 'Best First'.
Re^2: compressing files
by ikegami (Patriarch) on Nov 16, 2006 at 16:39 UTC

    Both of those are buggy and unsafe. The first even looses tar's error code (and the second can loose tar's error code). Use the list form of system to avoid those problems.

    system('tar', '-cvf', 'logfiles.tar', @srcfiles);

    Archive::Tar is still better. ( Using a module is usually the way to go, but it might not be the case here. See replies. )