[linux-help] Re: Perl confusion
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
There isn't anything wrong with this code. It must either be with your
data file or some other part of your code.
On Mon, Jul 17, 2000 at 11:58:16PM -0500, 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....
>
> -- This is the linux-help@xxxxxxxxx list. To unsubscribe,
> visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi
-- This is the linux-help@xxxxxxxxx list. To unsubscribe,
visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi
|
|