I have a text file that looks like so:
# 2003/03/18 22:00:00
# Host In (bytes) Out (bytes) Total (bytes)
x.x.x.x 3011555 182187034 212302289
y.y.y.y 67372232 10843221 176015453
Using perl, how can I read this file into 4 variables $host, $inbytes, $outbytes, and $totbytes.
Also I need to ignore the first 2 lines of the file.
I tried doing the usual:
($host, $inbytes, $outbytes, $totbyes) = split(/ /, $line);
But since there's multiple spaces in between each field (usually different amount of spaces), it does not work as I had hoped. How can I get this to work?
I've been searching and have come up clueless. I'm fairly sure this has a simple solution i'm going to kick myself for when I see it.