I'd do it this way:
#! perl -sw use strict; my $string = "<1,2>:<5,7>:<3,0>"; my @x = $string =~ m[<(\d+),(\d+)>]g; print "Extraction = @x\n"; print "1st element = $x[0]"; __END__ c:\test>junk Extraction = 1 2 5 7 3 0 1st element = 1
In reply to Re^3: Etxraction of numbers in an array
by BrowserUk
in thread Extraction of numbers in an string
by t-rex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |