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

Two simple code style advice questions

by eyepopslikeamosquito (Canon)
on Jan 16, 2013 at 10:02 UTC ( #1013548=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @tests = ( "tfred", "tjock", "tfortytwo" );
    
  2. or download this
    my %ntests = map { $_ => 0 } @tests;
    
  3. or download this
    my %ntests;
    @ntests{@tests} = (0) x @tests;
    
  4. or download this
    my $mol = "forty two" x ($n == 42);
    
  5. or download this
    my $mol = ($n == 42) ? "forty two" : ""
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1013548]
Approved by Ratazong
Front-paged by vinoth.ree
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2015-07-06 23:53 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 (85 votes), past polls