in reply to Adding 2 + 2
perl -MFcntl=:flock -e 'print 2+LOCK_EX'
Or (cheap way)
perl -wle 'print $^W*2**$^W*2'
Or (Only works if you follow the directions ;-)
#!/usr/bin/perl -w use strict; print "Pick an integer between 1 and 3\n"; my $num = <STDIN>; print "Pick another integer between 1 and 3\n"; $num += <STDIN>; print "The sum is " . $num;
Or
perl -wle '%h = map {(qq{sum}) => $h{'sum'}+=$_ } qw/2 2/; print $h{s +um}'
Or (a long version of the above one liner)
#!/usr/bin/perl -w use strict; my %foo; %foo = map {('sum') => $foo{'sum'}+=$_ } qw/2 2/; print $foo{sum};
More later if I have time.
Cheers,
KM
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE (tilly) 2: Adding 2 + 2
by tilly (Archbishop) on Sep 11, 2000 at 19:18 UTC | |
by KM (Priest) on Sep 11, 2000 at 19:23 UTC | |
by BlaisePascal (Monk) on Sep 11, 2000 at 20:56 UTC | |
by KM (Priest) on Sep 11, 2000 at 20:59 UTC | |
by BlaisePascal (Monk) on Sep 11, 2000 at 21:17 UTC | |
| |
|
RE: RE: Adding 2 + 2
by Adam (Vicar) on Sep 11, 2000 at 20:29 UTC | |
by Ozymandias (Hermit) on Sep 11, 2000 at 20:34 UTC | |
by a (Friar) on Feb 11, 2001 at 10:04 UTC | |
by Tiefling (Monk) on Jun 05, 2001 at 15:24 UTC | |
|
RE: RE: Adding 2 + 2
by BastardOperator (Monk) on Sep 11, 2000 at 19:09 UTC |