Rydor has asked for the wisdom of the Perl Monks concerning the following question:
(BTW, that takes the date, uses it as a key, and index 0 is everything else, index 1 is CRI hits on that date, and index 2 is CRII hits on that date.)@parsed=split/\s/,$line; $CR{substr($parsed[3],1,11)}[$line=~/(NNNNN)/+2*$line=~/(XXXXX)/]++;
that example doesnt work, obviously, and i've been mangling split every which way to get that quick reference to any of it's indices. I've treated it as a real array, as an arrayref but no way i do it will get me the desired results. I've tried simple testing by just trying to print out an index like that, without it nested in substr, but regardless it doesn't work. Anyone know how to help me save a precious few bytes from my code?$CR{substr(split(/\s/,$line)[3],1,11)}[$line=~/(NNNNN)/+2*$line=~/(XXX +XX)/]++;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: split as immediate array?
by runrig (Abbot) on Aug 11, 2001 at 19:29 UTC | |
by Rydor (Scribe) on Aug 11, 2001 at 19:43 UTC | |
by bbfu (Curate) on Aug 11, 2001 at 19:49 UTC | |
by Rydor (Scribe) on Aug 11, 2001 at 20:18 UTC |