Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

RE: Adding 2 + 2

by KM (Priest)
on Sep 11, 2000 at 19:01 UTC ( #31891=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    perl -MFcntl=:flock -e 'print 2+LOCK_EX'
    
  2. or download this
    perl -wle 'print $^W*2**$^W*2'
    
  3. or download this
    #!/usr/bin/perl -w
    
    ...
    print "Pick another integer between 1 and 3\n";
    $num += <STDIN>;
    print "The sum is " . $num;
    
  4. or download this
    perl -wle '%h =  map {(qq{sum}) => $h{'sum'}+=$_ } qw/2 2/; print $h{s
    +um}'
    
  5. or download this
    #!/usr/bin/perl -w
    
    ...
    my %foo;
    %foo =  map {('sum') => $foo{'sum'}+=$_ } qw/2 2/;
    print $foo{sum};
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (10)
As of 2014-07-24 11:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (160 votes), past polls