Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: print if warn

by mkmcconn (Chaplain)
on Jan 15, 2002 at 00:02 UTC ( [id://138674]=note: print w/replies, xml ) Need Help??


in reply to print if warn

I think that you are asking how to test for definedness

#!/usr/bin/perl -w use strict; my @a = qw(1 2 3); for (@a){ if ( not defined ($a[$_])){ print "\$a[$_] can't match because it's not initialized\n" unless $a[$_] =~ m/3/; print "\$a[$_] can't be tested for equivalence because it's not initialized\n" unless $a[$_] == 3; } }

mkmcconn

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2024-04-23 10:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found