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

Re: "Correct" program style questions

by Aristotle (Chancellor)
on Oct 26, 2002 at 00:00 UTC ( #208179=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my ($foo, $bar, $baz, $quux);
    defined && /^([[:alpha:]]+)$/ ? $foo = $1 : taint_fail('foo') for scal
    +ar param('foo');
    defined && /^([[:alpha:]]+)$/ ? $bar = $1 : taint_fail('bar') for scal
    +ar param('bar');
    defined && /^([[:alpha:]]+)$/ ? $baz = $1 : taint_fail('baz') for scal
    +ar param('baz');
    defined && /^([[:alpha:]]+)$/ ? $quux = $1 : taint_fail('quux') for sc
    +alar param('quux');
    
  2. or download this
    my %check = (
        foo => qr/^([[:alpha:]]+)$/,
        bar => qr/^([[:alpha:]]+)$/,
    ...
        defined && /$check{$pname}/ ? $f{$pname} = $1 : untaint_fail($pnam
    +e)
            for scalar param($pname);
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (13)
As of 2015-07-31 20:35 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 (281 votes), past polls