Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Compressing files on an entire disk

by justin423 (Beadle)
on Feb 07, 2023 at 20:27 UTC ( #11150220=note: print w/replies, xml ) Need Help??


in reply to Re: Compressing files on an entire disk
in thread Compressing files on an entire disk

ok, I got the search to print a list of files, but I am getting a syntax error when I try to zip them individually.
my @files = find( file => 'name' => [ ], size => '', in => $directory ); # @output="@files.zip"; my @status = zip @files => @output or die "zip failed: $ZipError\n";

Replies are listed 'Best First'.
Re^3: Compressing files on an entire disk
by hippo (Bishop) on Feb 07, 2023 at 22:35 UTC
    for my $src (@files) { my $status = zip $src => "${src}.zip" or die "zip failed: $ZipError\n"; } # And, if you're confident unlink @files;

    You cannot just arbitrarily throw arrays into subroutines which explicitly require scalar arguments and expect it to work.


    🦛

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11150220]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2023-04-02 09:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?