getting a number out of a string....



Greetings,

How does one just get the number part out of a string?

The script below just prints 1.

#!/usr/bin/perl

@str = ('Gambia001.tiff','Gambia0021.tiff','Gambia031.tiff','Gambia035.tiff') ;

foreach $str (@str) {
$num = ($str =~ /\d+/);
print "$str : $num\n";
}


Thanks!
Dave Gilden
(kora musician / audiophile / webmaster @ www.coraconnection.com / Ft. Worth, TX, USA)

Endorsing Artist for the Moog Music:
<http://www.moogmusic.com/artists.html?cat_id=25>

==============================================
Cora Connection: Your West African Music Source
Resources, Recordings, Instruments & More!
<http://www.coraconnection.com/>
==============================================
.