2024 π Daylatest newsbuy art
This love's a nameless dream.Cocteau Twinstry to figure it outmore quotes
very clickable
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
#14
Summer 1999
vol 4
num 2
Perl News
What's new in the Perl community.
What Is Truth?
Truth and falsehood aren't black and white.
Downloading Web Pages Through A Proxy Server
How LWP can cope with firewalls.
Seven Useful Uses of local
Some rare occasions when my won't do.
On-the-Fly Web Plots Made Easy
Using Gnuplot to graph web logs
E-mail with Attachments
Using MIME to send images, audio, and more.
Review of Perl: The Programmer's Companion
A Perl book for experienced programmers.
Perl/Tk Menus: Past, Present, and Future
Creating menubars in Perl/Tk 4 and Perl/Tk 8.
Manipulating Images with Perl and the Gimp
Creating plug-ins for a free alternative to Adobe's Photoshop.
Review of Learning Perl/Tk
An introductory text for graphics programming with Perl/Tk.
Building A Better Hash
How a problem was solved with a homebrew data structure.
Using Databases with DBI: What Not To Do
Speeding up your database connections.
Sending mail without sendmail
Sending mail from Perl in a portable way.
International Sorting with sort
Grappling with "funny" letters? Bi-level sorting can help.
The Solitaire 500 Results
The fastest card players from last issue's contest.
The Fourth Annual Obfuscated Perl Contest
Confuse us and win a prize.
The Perl Journal One Liners
(1999) The Perl Journal One Liners. The Perl Journal, vol 4(2), issue #14, Summer 1999.

The Perl Journal One Liners


TPJ One-Liner #35

If Dr. Seuss were a Perl programmer

Courtesy of Kevin Meltzer


#!/usr/bin/perl
# 
# Will give errors if run with -w, so don't use -w :)
# Tested on NT with AS (5.005), GS (5.004_02), 
# and Solaris 2.6 (5.004_04)

if ("a packet hits a pocket") {
    On: a;
    socket(ON, A ,PORT,"")
           && the bus is interrupted as a very-last-resort
           && the address of the memory makes your 
              floppy disk, abort;
		
} else {

    "The socket packet pocket has an";
    error: to-report;
} 

if ("your cursor finds a menu item") { 
    "followed by a dash"
            && "the double clicking icon";
    puts: your-items-in-the-trash
            && your data is corrupted cause the 
               index("doesn't", "hash");

} else {
   "Your situation is hopeless"
            && Your system's gonna crash;
} 

if ("the label on the cable") {
    On-the-table, at-your-house;
    Says_the; 
    sub network {"is connected to the button on your mouse"};
    BUT: Your-packets, want-to; 
    {/tunnel to another protocol/};
    that's: repeatedly-rejected; 
    {/by the printer/}; "down the hall"
            && "YOUR SCREEN is all distorted";
    {/by the side effects of Gauss/};
    so: "your icons", in-the-window;
    "are as wavy as a souse";

} else {
    YOU: "may as well reboot" && "go out with a !";
    CAUSE: /Sure as Im a poet/;
    THIS: suckers-gonna-hang;
}

print "Seuss as a tech writer - Kevin Meltzer\n"; 
	

TPJ One-liner #36

Neal Stephenson's latest novel, Cryptonomicon, includes a Perl cryptosystem code-named Pontifex. You can read about it at https://www.well.com/user/neal/cypherFAQ.html#12.

TPJ One-liner #37

Stripping the eighth bits from a string $s &= "\177" x length($s);
Given a string in $s, this one-liner turns all of the "funny" characters
(like à or Œ) into regular seven-bit ASCII characters.
It works by ANDing the bit representation of each character with 127,
which removes the eighth bit. That turns à into L and Œ into N, for instance.

Courtesy of Tom Christiansen

TPJ One-liner #38

Replacing tabs with spaces

perl -0011 -pi -e '/\011/&&($_="$'")' filename

Courtesy of Abigail

TPJ One-Liner #39

Printing all capitalized words

perl -ne 'push@w,/(\b[A-Z]\S*?\b)/g;END{print"@w"}' file

Martin Krzywinski | contact | Canada's Michael Smith Genome Sciences CentreBC Cancer Research CenterBC CancerPHSA
Google whack “vicissitudinal corporealization”
{ 10.9.234.152 }