Without more code, I can't totally understand what might be wrong.
When you increment $num are you sure that $line also get's updated?
I'm wondering if you are expecting $array[$num] to get reevaluated with
the new value of $num every time you dereference $line. If so, that's a bad
assumption.
$l
dford Ritchie [mailto:[EMAIL PROTECTED]]
Sent: 05 March 2002 19:27
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: accessing an array with a variable
Without more code, I can't totally understand what might be wrong.
When you increment $num are you sure that $line also get's updated?
I
From: [EMAIL PROTECTED]
> I am trying to do this with Perl/Tk, but it fails to work, only
> displaying the initial line of the text file:
>
> This is the definition of the variable
>
> $line=$array[$num];
>
> $num is incremented elsewhere with the click of the button.
>
> Th
ne to the new line.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 05, 2002 10:06 AM
To: [EMAIL PROTECTED]
Subject: accessing an array with a variable
Hi,
I believe it is possible to access an array through a variable, but I'm
ghaving tro
Hi,
I believe it is possible to access an array through a variable, but I'm
ghaving trouble doing it.
I want to read in a text file and display it, on line at a time, depending
on an
increment counter triggered by a 'next' or 'previous' button.
I am trying to do this with Perl/Tk, but it fails