Who's programming right now?

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Phil21

Golden Member
Dec 4, 2000
1,015
0
0
yeah, didn't know why you had the return returning a string if the value was (in effect) null, so I just guessed. ;) Notfred beat me in the "shortest way" contest. Doh!

Perl is fun, being obfuse is sometimes something to be proud of. My little thing I made up tonight for a channel on IRC (which does NOT provide help) is this.. anyone have any ideas to make it less readable/shorter? (shorter usually being better..)

perl -e 'foreach(78,79,20,72,69,76,80,33,10){print chr}'

-Phil

 

crackersjacks

Member
Aug 29, 2001
156
0
0


<< my $name = $_[0];
my $pass = $_[1];
>>


Since we all like one line declarations so much :)
possibly?
my ($name, $pass) = @_;
If not, I'd also like to know why so that I can alter my code because I use those anonymous lovelies quite a bit.
 

notfred

Lifer
Feb 12, 2001
38,241
4
0


<< yeah, didn't know why you had the return returning a string if the value was (in effect) null, so I just guessed. ;) Notfred beat me in the "shortest way" contest. Doh!

Perl is fun, being obfuse is sometimes something to be proud of. My little thing I made up tonight for a channel on IRC (which does NOT provide help) is this.. anyone have any ideas to make it less readable/shorter? (shorter usually being better..)

perl -e 'foreach(78,79,20,72,69,76,80,33,10){print chr}'

-Phil
>>



I dont feel like looking up ascii codes... what's it say?
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
find nifty ascii codes, er whatever:

while ($i < 256){
print $i, ": ", chr($i), "\n";
$i++;
}