data
+ munging
The Perl Journal
Volumes 1–6 (1996–2002)
Code tarballs available for issues 1–21.
I reformatted the CD-ROM contents. Some things may still be a little wonky — oh, why hello there <FONT>
tag. Syntax highlighting is iffy. Please report any glaring issues.
The Perl Journal
#8
Winter 1997
vol 2
num 4
Why 21.09 doesn't always equal 21.09.
Tom Phoenix
Throw random input at your servers and scripts.
Lincoln Stein
A glue interface linking Perl and Java.
Brian Jepson
Before Unicode, before ASCII, there was EBCDIC.
Peter Prymmer
Using AppleEvents from Perl.
Chris Nandor
What's new in the Perl Community.
Jon Orwant
Generate Perl wrappers around C/C++ code - automatically.
Scott Bolte
How Net::Telnet lets your programs talk to other computers.
Jay Rogers
An extremely efficient tree data structure.
Mark-Jason Dominus
Common sysadmin tasks, automated with Perl.
Dave Roth
A highly distributed computing effort to find new primes.
David Nicol
Not for the timid.
Tom Christiansen
(1997) The Perl Journal One-Liners. The Perl Journal, vol 2(4), issue #8, Winter 1997.
The Perl Journal One-Liners
TPJ One-Liner Primality Adding a long list of numbers on the command line: perl -le 'print "PRIME" if (1 x shift) !~ /^(11+)\1+$/' 19 Type this from your command line to test whether 19 (or any other integer of your choosing) is prime. Courtesy of Abigail, abigail@fnx.com |
Exploiting the F00F Pentium bug
require DynaLoader;
DynaLoader::dl_install_xsub("main::hangme",
unpack("I", pack("P4", "\xF0\x0F\xC7\xC8")));
hangme();
Do NOT execute this. It will crash your computer. Courtesy of Gisle Aas
Preserving case in a substitution
To replace substring $x with an equal length substring $y, but preserving the case of $x:Z
$string =~ s/($x)/"\L$y"^"\L$1"^$1/ie;
Courtesy of Dean Inada
Using Perl from Emacs
To apply a Perl expression EXPR to a region:
C-u M-| perl -pe 'EXPR'
To apply EXPR to the entire buffer:
C-x h C-u M-| perl -pe 'EXPR'
Courtesy of Mark-Jason Dominus.