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

[linux-help] Perl confusion

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: linux-help@xxxxxxxxx
Subject: [linux-help] Perl confusion
From: "Lrs v.d.Ast" <mrprenzl@xxxxxxxxxx>
Date: Mon, 17 Jul 2000 23:58:16 -0500
Reply-to: linux-help@xxxxxxxxx

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....

-- 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]