Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: File Manipulation

by hdb (Monsignor)
on Aug 23, 2013 at 11:04 UTC ( [id://1050635]=note: print w/replies, xml ) Need Help??


in reply to File Manipulation

I would use a simple array of arrays where the first element of each sub-array is the server, like this:

use strict; use warnings; my @logs; while(<DATA>){ push @logs, [ $1 ] if /\[(.*)\]/; push @{$logs[-1]}, $1 if /^(\/.*)/; } print shift @$_, ":", join( ",", @$_ ), "\n" for @logs; __DATA__ [server1] /tmp/location1/file.log /tmp/location2/file.log [server2] /usr/loc1/file.log /usr/loc2/file.log [server3] /citrix/dir3/file.log

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-03-29 09:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found