Chris, Thanks and Happy New Year. Dave (kora musician / audiophile / webmaster @ www.coraconnection.com / Ft. Worth, TX, USA)
> > How does one just get the number part out of a string? > > > > The script below just prints 1. > > Right. All it's doing is reporting a successful, true, match. > > You need to fix where the parentheses are being used: > > > foreach $str (@str) { > > $num = ($str =~ /\d+/); > > print "$str : $num\n"; > > } > > foreach (@str) { > ( $num = $_ ) =~ /\d+/; > print "$_ : $num\n"; > } > > That should work better, and also avoids the confusing and unnecessary > $str temporary scalar that looks too much like the $str[] array. Also, > it's usefully indented, because Readability Matters. > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>