I am now on Twitter! Meet me on Twitter here (my nick is pkrumins.)
Or on Google Buzz and Facebook.

In my previous post - downloading youtube videos with a Perl one-liner - I used Perl’s special variable $_. This is just one of many Perl’s special variables.
One day last year I decided to go through all the Perl’s special variables carefully so I could become a better Perl programmer and make a cheat sheet which I could always keep on my desk and look things up when needed.
As I explained in the previous cheat-sheet post (awk’s cheat sheet), the cheat sheets are for learning things better and not doing things blindly and looking the stuff each time up. Here is another example why cheat sheets are helpful - suppose you programmed for 5 hours and then sat back in your chair to relax for 10 minutes. You could relax by taking cheat sheet in your hands and just scan through it and remember a thing or two.
This cheat sheet contains all the perl’s special variables, their description and examples where possible.
It can be nicely printed on one sheet of paper by having two pages per side. Two on one side and two on other. That’s how I have printed it.
Available as usual in .doc and .pdf formats.
PDF:
Download link: perl's special variable cheat sheet (.pdf)
Downloaded: 25091 times
Microsoft Word 2000 format (.doc):
Download link: perl's special variable cheat sheet (.doc)
Downloaded: 2832 times
Are you interested in Perl programming language? Here are three excellent books on Perl from Amazon (recommended by me):
Did you like this post? Subscribe here:
If you really enjoyed the post, I'd appreciate a gift from my geeky Amazon book wishlist. Books would make me more educated and I could write even better posts. Thanks! :)

(3 votes, average: 4.67 out of 5)
|
|
|


September 3rd, 2007 at 2:36 pm
[…] pack/unpack. See also Peteris’ excellent articles on Downloading YouTube Videos and Perls’ Special Variables. […]
December 29th, 2007 at 2:58 am
[…] Perl special variable cheat sheet Filed under: Reference, Technology — 0ddn1x @ 2007-12-29 00:14:46 +0000 http://www.catonmat.net/blog/perls-special-variable-cheat-sheet/ […]
October 22nd, 2008 at 2:20 pm
[…] http://www.catonmat.net/blog/perls-special-variable-cheat-sheet/ […]
February 26th, 2009 at 9:52 am
[…] Luckily, a few years ago I compiled all the Perl special vars in a single file and called it Perl special variable cheat-sheet. Even tho it’s mostly copied out of perldoc perlvar, it’s still handy to have in front […]
March 29th, 2009 at 7:19 am
Cheat sheets are great for software developers of all skill level. I use them often myself, mostly for syntax checking.
There is a link above to Perl Best Practices. I have no affiliation to this site or that book, but the information in Best Practice is second only to the Perl Cookbook.
My 2cents
August 4th, 2009 at 10:05 am
[…] bei Einzeilern sind: Famous Perl One-Liners Explained (Part I und Part II). Mit einem Bonus-Kapitel Perl Special Variable Cheat Sheet. Mehr soll folgen … (ich weiß, es ist nicht gerade Python, aber Perlen sind es doch, […]
November 16th, 2009 at 3:00 am
[…] variables. A few years ago I compiled all the Perl special variables in a single file and called it Perl special variable cheat-sheet. Even tho it’s mostly copied out of perldoc perlvar, it’s still handy to have in front […]
November 23rd, 2009 at 12:54 pm
Thanks pkrumins it helps a lot.
November 30th, 2009 at 1:05 pm
[…] just prints the special variable $. which is the number of input lines […]
December 8th, 2009 at 1:26 pm
[…] An article about Perl predefined variable cheat sheet on catonmat. […]