Perl Idioms and Gotchas

While() {…} – read CLI input
#!/usr/local/bin/perl – perl interpreter path
perl myfile.pl – execute a perl script
(-w: show strict warnings; -T: check tainted input; -d: debug; -e:
execute interactively;)

Check file handles for failure when using the open function
Lock files before editing them
Close files before unlocking them

References

Good Perl Code
Good Perl and Bad Perl
Writing Better Perl
Loops, clean code, and the Perl idioms
Debugging Perl with Ease
Perl Idioms
More Perl Idioms
Perl Idioms Explained
The Deep Perl Gotcha
Perl Scoping Gotcha
Interesting Perl Gotcha
One Perl Tip and a Gotcha
Outdated Techniques
Idiotic Perl
The Seven Deadly Sins of Perl
The Basics of map and grep
mod_rewrite in Perl
Localtime in Perl
Schwartzian Transform
Using Hashes as Sets
How to get Hashes out of Perl Arrays
Hidden Features of Perl
Developing a Perl routine
Invoking Subroutines
Perl Style Guide
Pragmatic Modules
Perl Tutorial
Optimizing Your Perl
Using Perl for Mass in-place Editing

Study Notes

File Info
CLI Options
Printing
Labels(Goto/Continue for Loops)
Why I Wrote Perl Console
True or False? A Quick Reference Guide

Perl Equivalents
in PHP, Python, Ruby
chomp in PHP, Python, Ruby
scalar in PHP, Python, Ruby
CGI SERVER_SOFTWARE, SERVER_ADMIN, DOCUMENT_ROOT, CONTENT_LENGTH in
PHP, Python, Ruby
split in PHP, Python, Ruby
tr/[A-Z]/[a-z]/; in PHP, Python, Ruby
pack function in PHP, Python, Ruby
hex function in PHP, Python, Ruby
srand function in PHP, Python, Ruby
crypt function in PHP, Python, Ruby
qq function in PHP, Python, Ruby
online browser-based Perl interpreter
flock, mknod, link, unlink, fopen, open, close, read, write, seek, get,
stat, dup, fifo Unix calls
$# string length – 1
$! error
$$
$| – current filehandle or stdout buffer
non-parsed headers nph in Apache
suExec in Apache
angle brackets in PHP, Python, Ruby
..range operator in PHP, Python, Ruby
^ operator in PHP, Python, Ruby
binding operator in PHP, Python, Ruby
sendmail -t
DBI prepare function
qw quote words function
Refresh header
\bMike\b regexp word matching
/My (.*)/Your $1/ backreference vars

TrackBack URI

Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.