Hello...
There are a few ways to do this, but if what you want is ALWAYS the digits in the middle of the file name, then this is probably easiest...
First, at the top of your program, put "use File::Basename;" This is a standard module included with
Perl... Basename gives you the filename at the end of a path... Suppose the whole path name is in $myfullpath
use File::Basename
$myFile = Basename($myfullpath); # $myFile now RDI00244.rpt
$myFile =~ /(\d)/; #The () around \d (digits) captures the match so...
$mydigits = $1 # $1 because it's the first parentheses set in the patern
or you could do....
$myFile =~ s/(\d)/$1/; # now a direct substitution of the digits into $myFile
Hope that helps
matthew rapaport (quine@sonic.net)