If you have to do these checks again and again, you can think of creating a dedicated sub routine for that.
sub all_defined { for my $i ( @_ ) { #return 0 if !defined $i; return if !defined $i; } return 1; } if ( all_defined( $WCkey, $SCkey, $Pkey, $Wkey, $Ukey ) ) { print "bla bla"; }
Update: modified code; thanks davorg
In reply to Re: check undef
by linuxer
in thread check undef
by Sun751
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |