Complete.Org: Mailing Lists: Archives: linux-help: July 2000:
[linux-help] Re: Perl confusion
Home

[linux-help] Re: Perl confusion

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: linux-help@xxxxxxxxx
Subject: [linux-help] Re: Perl confusion
From: Jeff Schaller <schaller@xxxxxxxxxxxxx>
Date: Tue, 18 Jul 2000 07:49:54 -0500 (CDT)
Reply-to: linux-help@xxxxxxxxx

On Mon, 17 Jul 2000, Lrs v.d.Ast wrote:

> Please take a look at this Perl code:
> 
> --------------------
> ....
> open(JDATA, "junk.data") || die "can't open junk.data : $!";
> while ($first = <JDATA>) {
>     chomp($first);
>     $word = <JDATA>;
>     chomp($word);
>     $cheap = <JDATA>;
>     chomp($cheap);
>     test_word($first, $word, $cheap);
> }
> close (JDATA) || die "can't close junk.data: $!";
> 
> sub test_word {
>     my($firstname, $lastname, $cheapgift);
>     ($firstname, $lastname, $cheapgift) = @_;
>     open(JUNKMAIL, "junkmail") || die "can't open junkmail : $!";
> ...
> --------------------
> 
> For some reason the variables are not getting passed to the
> subroutine; they're claiming to not be initialized. I haven't touched
> Perl in over a year and am a bit rusty....

Is the number of lines in junk.data a multiple of 3?

-jeff
-- 
Microsoft recently released its new Windows 2000. What are some of the
features of the new operating system?
- Conveniently forwards all email to Redmond, WA.
http://www.theonion.com


-- This is the linux-help@xxxxxxxxx list.  To unsubscribe,
visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi


[Prev in Thread] Current Thread [Next in Thread]