Perl Programming humour for the geeks..

For all your general chit chat, caching or not.
Post Reply
User avatar
Two Goth Geeks
50 or more caches found
50 or more caches found
Posts: 281
Joined: 05 April 03 7:02 pm
Twitter: TwoGothGeeks
Location: Sydney, Australia
Contact:

Perl Programming humour for the geeks..

Post by Two Goth Geeks » 30 July 03 2:16 pm

http://perl.plover.com/IAQ/IAQlist.html

Some of my favourites:

How do I clear the screen?
Use this function:

sub clear_the_screen {
print $ x 1_000_000;
}


What's a regular expression to replace 09:23:53 08-OCT-98 with Thu Oct 8 09:23:53 1998?
s{.*}{Thu Oct 8 09:23:53 1998}

How do I get tomorrow's date?
Use this function:

sub tomorrow_date {
sleep 86400;
return localtime();
}


How do I block warnings?
The simplest way is to do

close STDERR;

How do I get my perl program to run faster?
In Perl, there's always more than one way to do it. Try one of these techniques.

use more 'cpu';
use less 'time';
use more 'speed';
## or, the ever popular Military Marching Band accompaniment:
use March::Sousa qw(:DoubleTime);
The March::* hierarchy is not found on CPAN. Please contact the author for more information.

Alternatively, programs have been known to complete more quickly when they contain a declaration like this one:

BEGIN {exit}
If your application is truly urgent, you might try the experimental

no more 'time';
feature, but this has been reported to cause some systems to panic.


Perldoc isn't running properly. Where can I find the documentation?
perldoc perldoc

I have a lot of Bourne shell scripts I'd like to convert to Perl... What's the easiest way to do it?
Make sure that the first line of your script is #!/bin/sh. That magic comment tells the Perl interpreter to understand Bourne shell syntax.


I've got a C program I want to translate to Perl... How do I do that?
If you're using gcc, version 2.7 or better, you can use the translate-to-perl mode.

gcc -P -E foo.c > foo.pl
(gcc is smart enough to figure out that you want to convert to 'perl' by specifying the 'p' and 'e' alone.)

For versions of gcc prior to 2.7, use

gcc -larry -Wall foo.c > foo.pl

Mix
450 or more roots tripped over
450 or more roots tripped over
Posts: 1399
Joined: 30 October 03 9:20 pm

Post by Mix » 10 May 04 8:23 pm

I dont know pearl but as geocachers arenÂ’t we all geeks. <br>
new slogan "Geocaching: its a geek thing."

User avatar
dcr
100 or more tracks walked
100 or more tracks walked
Posts: 319
Joined: 06 July 03 2:37 pm
Location: Eltham, Victoria
Contact:

Post by dcr » 10 May 04 11:01 pm

My fav. is still camel code, I think that makes me a bit too Geek? :oops:

<br />
cheers Darren :)

Dingbats
100 or more tracks walked
100 or more tracks walked
Posts: 118
Joined: 30 March 04 3:41 pm
Location: Wollongong
Contact:

Post by Dingbats » 11 May 04 1:06 am

Mix76 wrote:I dont know pearl but ...
Unfortunately I do, this reminded me why I switched to Python a few years back :P
<p>
On the topic of computers and programming languages, there is a lot of scope for an ultra geek computer nerd multi-puzzle cache. I'd be suprised if this hasn't been done. Can anyone point me to such examples?

Post Reply