Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Validating the contents of scalars using an array based list

by JPaul (Hermit)
on Apr 03, 2003 at 17:03 UTC ( [id://247809]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    if ($var eq "" || $var2 eq "" || $var3 eq ""} { &complain(); }
    
  2. or download this
    my $var1 = $cgi->param('var1');
    my $var2 = $cgi->param('var2');
    ...
    my @list = qw(var1 var3);
    
    foreach (@list) { if (!exists $$h{$_}) { &complain; } }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://247809]
Approved by broquaint
Front-paged by Tomte
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-04-19 08:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found