Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: needing to zip files in a series that begin with the same IP address

by diamondsandperls (Beadle)
on Jul 27, 2012 at 20:41 UTC ( #984096=note: print w/ replies, xml ) Need Help??


in reply to needing to zip files in a series that begin with the same IP address

i feel im getting closer i failed to mention i need the output files to be the ip address e.g. 192.168.1.1.zip.

#!perl #use strict; use warnings; use IO::Compress::Zip qw(zip $ZipError) ; my @textfiles = <*.txt *.docx>; foreach my $textfile (@textfiles) { if ($textfile =~ /(\d+.\d+.\d+.\d+.*)/) { my $ip = $textfile =~ /(\d+.\d+.\d+.\d+).*/; my $files; push @{$files{$ip}}, $textfile; zip $textfile => $output or die "zip failed\n"; } }


Comment on Re: needing to zip files in a series that begin with the same IP address
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (21)
As of 2014-09-22 20:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (200 votes), past polls