Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Beginner in perl : Use of uninitialized value

by jwkrahn (Abbot)
on Dec 28, 2018 at 05:49 UTC ( [id://1227774]=note: print w/replies, xml ) Need Help??


in reply to Beginner in perl : Use of uninitialized value

foreach my $line (@input){ if ( /fred/ ){

Is the same as:

foreach my $line (@input){ if ( $_ =~ /fred/ ){

You need to change it to:

foreach my $line (@input){ if ( $line =~ /fred/ ){

Replies are listed 'Best First'.
Re^2: Beginner in perl : Use of uninitialized value
by Perl_Programmer1992 (Sexton) on Dec 28, 2018 at 06:26 UTC

    Thanks @jwkrahn for clearing this.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1227774]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-25 19:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found