Perl Bits

I love perl. This is just a place for me to collect tidbits that I use all the time. It's not a tutorial, it's not a complete reference guide by any means. For more perl links, go to my links page.

 

Bits

Warning: all links open code files in new browser windows.

time/date - using Time::Local

is_number - simple test to see if a string is a number or not

stat() - get file size, permissions, etc.

%ENV - print out %ENV values

reverse() - reverse lists, hashes, or scalars

delete() - remove a key and it's value from a hash table

defined() and undef() - test if a variable is defined, and undefine a variable

case - quick ways to change the case of a string... uc(), lc(), \U, \u, \L, \l, and \E

my() - demonstrate how my works

version - use special variable $] to find out what version of perl you're running

substr() - chop a long line into lines of length 10

hex - dec2hex() and hex2dec()

sort - using a custom sort routine to create an html dropdown box sorted by displayed value

 

Created: 4/4/2001, Modified: 5/17/2002