well, let me take a crack at it:
which does:use strict; my $string = 'Fri Oct 13 2000 20:11:54 + Page 1'; my @array = ($string, $string, $string); for (@array) { $_ =~ s/\:(\d+)\b(\s)+(\w)+(\s)+(\d)+/:$1/; } print "$array[0]\n$array[1]\n$array[2]\n\n";
This probably isn't as robust as you want but it's a start. see perlre for some more info on what's being done. Basically, it's just a regx being applied to each member of your array and using replace to get rid of what you don't want. I can go through the regex step by step if you like, but that woudl take all the fun out of pulling it apart : )/home/jptxs > perl -w impala Fri Oct 13 2000 20:11:54 Fri Oct 13 2000 20:11:54 Fri Oct 13 2000 20:11:54 /home/jptxs >
"sometimes when you make a request for the head you don't
want the big, fat body...don't you go snickering."
-- Nathan Torkington UoP2K a.k.a gnat
In reply to Re: Cropping Elements in an Array
by jptxs
in thread Cropping Elements in an Array
by ImpalaSS
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |