Thank you. This is great. Thanks a lot for breaking down that cryptic regex as well. I did try and test this, but had some issues with:
# do extra check that $school is acceptable $school //= 'null'; # regex gives undef if not found
Error msg:

Search pattern not terminated

I commented that out and it run, although it had these errors:

match: /home/test/abc/.date_run_dir type: abc Use of uninitialized value in concatenation (.) or string at ./test7.p +l line 31, <$_[...]> line 1. school: match: /home/test/def/.date_run_dir type: def Use of uninitialized value in concatenation (.) or string at ./test7.p +l line 31, <$_[...]> line 2. school:

Also would you pls show me to extract values from the files I match? Can I do this in the same pass that I peform the regex? Example values from file (.date_run_dir, etc)

$ cat .date_run_dir .date_file_sent.* /project/school/data/feed_abc_2010120816.ext3 mail_abc.dat.2010120816.ext3 mail_abc.dat.2010120816.ext3

In reply to Re^2: Help constructing proper regex to extract values from filenames and concurrently opening those same files to access records by JaeDre619
in thread Help constructing proper regex to extract values from filenames and concurrently opening those same files to access records by JaeDre619

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.