Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Print only if pattern matches

by LanX (Canon)
on Jan 24, 2013 at 07:04 UTC ( #1015090=note: print w/ replies, xml ) Need Help??


in reply to Print only if pattern matches

>  Use of uninitialized value $2 in concatenation (.) or string at split_test.pl li

> I am looking to get rid off the error. ... ANd I want to write the exceptions to new file.

so avoid uninitialized '$2'!

if (defined $2) { print "$1$2|$3\n"; } else { print $exception_fh "$_\n"; }


Comment on Re: Print only if pattern matches
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2015-07-04 19:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls