I am converting text files into an HTML format to be posted on a web site. The names of the files are similar to this mlb_boxscore$283491230.txt. I am running triggers off my server that actually run the perl scripts that convert the files from text to html. The problem I have is that I have to open the file with it's exact name. This is a problem due to the fact I would have to change my code each day because I receive a new file every moring with a different name. The naming convention follows the format mlb_boxscore"some numbers". The following is what I am currently using to open the file:
open (INPUT, "c:/mlb_boxscore$283491230.txt") or die "Can't open file" +; open (boxscore, ">c:/boxscore" . $today . ".html") or die "Can't open +file"; open (HEADER, "c:/header.html") or die "Can't open file"; open (FOOTER, "c:/footer.html") or die "Can't open file";
I was wondering if there was anyway possible to open a file without specifying the exact name? Possibly something similar to open (INPUT, "c:/mlb_boxscore$_.txt") or die "Can't open file";. I know this doesn't work, I was just wondering if there was a way of doing something similar to this.

In reply to Opening Text Files by Perl Newby

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.