in reply to Extracting a number from a string
my ($num) = $string =~ /(\d+)/; # Added $num += 0;
$num is in parens to put the right side into list context, which makes match return the value matched.
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Extracting a number from a string
by queue (Beadle) on Jan 12, 2003 at 17:13 UTC | |
by diotalevi (Canon) on Jan 12, 2003 at 17:21 UTC |