Sorry about not using the .
Here's my code when I actually hard code the '7R', yet it still fails.
+ I must be missing something else? <br>
<code> my ($product, $year, $month, $day, $hour, $suffix, $ver ) = spl
+it /\./, $fileName;
# test file name--naming convention is '<product>.<year>.<month>.<day>
+.<hour>.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 /\./, $fil
+eName;
}
else {
print STDERR "($0,$$) ERROR: invalid file name--'$fileName'\n" if
+ $opt_v;
exit 2;
}
|