ra93013 has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to passing in a regular express and keep getting
Here's the option I use to pass in the expressionUse of uninitialized value $_ in pattern match (m//) at ./INVALID_FILE +.pl
--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});
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Uninitialized Value $regex
by toolic (Bishop) on Jun 04, 2015 at 20:23 UTC | |
|
Re: Uninitialized Value $regex
by kcott (Archbishop) on Jun 04, 2015 at 20:34 UTC | |
|
Re: Uninitialized Value $regex
by Athanasius (Archbishop) on Jun 05, 2015 at 01:56 UTC | |
by afoken (Chancellor) on Jun 05, 2015 at 10:15 UTC | |
by AnomalousMonk (Archbishop) on Jun 05, 2015 at 15:54 UTC | |
by choroba (Cardinal) on Jun 07, 2015 at 21:05 UTC |