SPUG: a split question . . .

Matthew Lasar matthew at lasarletter.com
Mon Feb 21 21:02:55 CST 2000

Dear Spuggers:

I have a question about a line of split script.

I am a beginning Perl person. I work at the University of California Press
in the IS department and I'm teaching myself Perl because it seems like it
will be useful for all sorts of things. I'm working my way through a book
called *SAMs Teach Yourself Perl in 24 Hours*. 

Let me assure you, 24 hours came and went quite a while ago.

Anyway, so here's this sample database program which starts with the
following lines of code:

#!/usr/bin/perl -w
open(PH, "database.txt") or die "Cannot open database.txt: $!\n";
while(<PH>) {
	($number, $email)=(split(/\s+/, $_)) [1,2];

The book doesn't adequately explain the last piece of this script, the
"[1,2];" part. What is this for? Also, if I've got windows 95, what should
I really put after "#!"? That stuff looks like a unix path to me.

I am grateful for the existence of this list, and for any help you care to


Matthew Lasar

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    POST TO: spug-list at pm.org        PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe
        Email to majordomo at pm.org: ACTION spug-list your_address

More information about the spug-list mailing list