in reply to Re:^2 Generic Data Collection
in thread Generic Data Collection
I think your problem is that you're not actually creating an array. Consider:
use strict; use warnings; my @parsed; # <- Here's the array in question while ( <DATA> ) { my @wanted = ( split )[ 0, 5, 9 ]; $wanted[1] =~ s/\D//g; push @parsed, join ',', @wanted; } print "$_\n" for @parsed; __DATA__ user1 192.168.1.1 machine1 (v1.1) (flexlmserver/27000 1009), start Sat + 3/30 12:53 user2 192.168.1.2 machine2 (v1.1) (flexlmserver/27000 123), start Sat +3/30 2:45
This gives an output that seems to correspond to what you request (but whether such a datastructure is ideal depends on how you intend to subsequently use it...).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Generic Data Collection
by Deep_Plaid (Acolyte) on Mar 31, 2013 at 16:03 UTC | |
by Anonymous Monk on Mar 31, 2013 at 17:03 UTC | |
by Deep_Plaid (Acolyte) on Mar 31, 2013 at 17:37 UTC | |
by poj (Abbot) on Mar 31, 2013 at 19:23 UTC | |
by Deep_Plaid (Acolyte) on Apr 01, 2013 at 11:49 UTC | |
| |
by Deep_Plaid (Acolyte) on Apr 01, 2013 at 17:53 UTC | |
|