2024 π Daylatest newsbuy art
Embrace me, surround me as the rush comes.Motorcycledrift deeper into the soundmore 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
#13
Spring 1999
vol 4
num 1
Perl News
What's new in the Perl community.
Five Quick Hacks: Downloading Web Pages
Grabbing web page contents without a browser.
The Perl Scripts Archive
The CPAN now stores scripts as well as modules.
Web Databases the Genome Project Way
A free database system tailored for the web.
XML
The successor to HTML.
Bricolage: Memoization
Speeding up Perl functions.
Review: The O'Reilly Perl Resource Kit
Localizing Your Perl Programs
Adapting programs for languages other than English.
Building Your Own Perl for Win32
How to compile and install your own Perl from the source code.
The rezrov Infocom Game Interpreter
A maximally portable game engine, with a few back doors.
Perl and MIDI: Simple Languages, Easy Music
How a little language for generating music was created.
Perl Heresies: Building Objects Out Of Arrays
Most people build objects out of hashes. Here's why you shouldn't.
Controlling Modems with Win32::SerialPort
Let your programs talk to any serial device.
Contest: The Solitaire 500
Speed matters. How fast can your program play a simple card game?
TPJ One Liners
(1999) TPJ One Liners. The Perl Journal, vol 4(1), issue #13, Spring 1999.

TPJ One Liners


TPJ One-Liner #28

perl -0nal012e '@a{@F}++; print for sort keys %a'

Extracts, sorts, and prints the words from a file.

--Peter J. Kernan

TPJ One-Liner #29

This subroutine accepts a string and returns a true value if all of the parentheses, brackets, and braces in the string are balanced.

sub is_balanced {
   my $it = $_[0];
   $it =~ tr/()[]{}//cd;
   while ($it =~ s/\(\)|\[\]|\{\}//g) { 1 }
   return !length($it);
}

­Sean M. Burke

TPJ One-Liner #30

"Regular expressions are to strings what math is to numbers."

--Andrew Clinick, discussing what Microsoft thinks of Perl

in https://www.microsoft.com/sitebuilder/magazine/clinick_perl.asp.

Short answer: They like it.

TPJ One Liner #31

perl -e 'print "Internet Time @",
int (((time + 3600) % 86400)/86.4), "\n";'

Swatch's Internet Time, heralded as a revolutionary way of measuring time independent of geography. See https://www.swatch.com for details.

--Anonymous

TPJ One Liner #32

A trick for indenting here strings:

($definition = <<'FINIS') =~ s/^\s+//gm;

The five varieties of camelids are the familiar camel, his friends the llama and the alpaca, and the rather less well-known guanaco and vicuña.

FINIS

--The Perl Cookbook

TPJ One Liner #33

Efficiently finding the position of the first and last occurrences of a substring in a string:

$first = index($string, $substring);
$last = rindex($string, $substring);

TPJ One Liner #34

Some scalars that Perl defines for you:

$^O contains the name of your operating system.

$^T contains the time at which your program began.

$0 contains the name of your program.

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