I'm trying to passing in a regular express and keep getting

Use of uninitialized value $_ in pattern match (m//) at ./INVALID_FILE +.pl
Here's the option I use to pass in the expression
--pattern '[G|M][0-1][0-9]_(GSP_|VIB_)[0-9]{12}\.log'

$args{dir} = $DEFAULT_DIRECTORY unless defined( $args{dir} ); $args{log} = $DEFAULT_LOG_FILE unless defined( $args{log} ); $args{pattern} = $DEFAULT_PATTERN unless defined( $args{pattern} ); $args{sendto} = $DEFAULT_SEND_TO unless defined( $args{sendto} ); $args{help} = 0 unless defined( $args{help} ); die "$usage\n" if $args{help}; #create new Log::LogLite object my $log = new Log::LogLite( $args{log}, $ERROR_LOG_LEVEL ); print "Pattern Submitted: $args{pattern}\n"; my $pattern_re = m/(?:$args{pattern})/o; #my $pattern_re = $args{pattern}; print "Pattern: $pattern_re\n"; # Make sure this directory exists if ( -d $STARTING_DIRECTORY . $args{dir} ) { my @files = File::Find::Rule ->not_name($pattern_re) ->in($STARTING_DIRECTORY . $args{dir});

In reply to Uninitialized Value $regex by ra93013

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.