Condensing Perl Script
I'm trying to extract various bits of data off a given line in a log file, and present them on multiple lines with labels. For instance, I want the following line to end up as presented below:
Code:
7226 12 64.142.0.156/30 dungis thaxton-19.sa fast0/47 to michael2-1.sa What I have so far: Code:
$line =~ /[a-z][a-z0-9\-]+/; #Our usernames can contain numbers and hyphens Thanks in advance, -- Poetics |
Code:
@fields = split /\s+/, $line, 5; |
I knew there existed a much easier way of doing that :) Looks like I need to work on my list operators more.
Thanks a lot, spooon! |
yeah, I'm a beginner too....this post excites me....
and looking to this thread(spooon's and Poetics' script),I realize that we can make things easier with Perl :D |
All times are GMT -5. The time now is 05:54 PM. |