.
Here's my code when I actually hard code the '7R', yet it still fails. I must be missing something else?
my ($product, $year, $month, $day, $hour, $suffix, $ver ) = split /\./, $fileName;
# test file name--naming convention is '.....bin'
if ($fileName =~ /3B4[0|1|2]RT\.\d{10}\.\7R\.bin/) {
($product, $year, $month, $day, $hour, $ver) =
($fileName =~ /(3B4.RT)\.(\d{4})(\d\d)(\d\d)(\d\d)\.(7R\)\.bin/);
$version = sprintf "%03d", $ver; # a little confusing, $version is global
# $ver is local
}
elsif ($fileName =~ /3B4\dRT\.\d\d\d\d\.\d\d\.\d\d.\d\dz\.bin/) {
($product, $year, $month, $day, $hour, $suffix) = split /\./, $fileName;
}
else {
print STDERR "($0,$$) ERROR: invalid file name--'$fileName'\n" if $opt_v;
exit 2;
}