<?xml version="1.0" encoding="windows-1252"?>
<node id="998750" title="Re^2: Another Pattern Matching Question" created="2012-10-12 13:25:41" updated="2012-10-12 13:25:41">
<type id="11">
note</type>
<author id="998694">
surib</author>
<data>
<field name="doctext">
Sorry about not using the &lt;code&gt;.

Here's my code when I actually hard code the '7R', yet it still fails.  I must be missing something else? &lt;br&gt;


&lt;code&gt; my ($product, $year, $month, $day, $hour, $suffix, $ver ) = split /\./, $fileName;

# test file name--naming convention is '&lt;product&gt;.&lt;year&gt;.&lt;month&gt;.&lt;day&gt;.&lt;hour&gt;.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;
}

&lt;/code&gt;</field>
<field name="root_node">
998720</field>
<field name="parent_node">
998745</field>
</data>
</node>
