It looks like line 165 is meant to recognize a valid filename and breaks up $basename into components, and in line 177 those components are named and stored in 7 variables. You could come up with a second regular expression to recognize and decompose the new filename format into those same 7 variables.

But if these are truly fixed length and format file names, you might find it easier to use unpack or substr instead of regular expressions for this purpose. It is said that the man who tries to solve his problem with a regular expression now has two problems, and that applies especially for the new programmer. When they work, they can do amazing things. But if you don't really need them, you can save yourself some grief.

Dum Spiro Spero

In reply to Re: To print the file in spool with the new format of input file also by GotToBTru
in thread To print the file in spool with the new format of input file also by skr302

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.