elam has asked for the wisdom of the Perl Monks concerning the following question:
it works. The problem is I need to have the given number before I enter a foreach loop. So I figured this would work.foreach my $row (@$list) { print "$#{$row} <br>"; ..... }
But it doesn't. This is for a cgi script, and adding those lines causes this to be printed in my error log:my $dref = $@list; my $num = "$#{list}"
I'm so confused after reading the perlref and perllol man pages. Can anyone please explain to me what's going on? Thanks, ElamCan't use string ("8") as an ARRAY ref while "strict refs" in use at / +usr/lib/perl5/5.6.1/whiteware.pm line 109.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Last element index with array refs
by sauoq (Abbot) on Feb 10, 2003 at 01:45 UTC | |
|
Re: Last element index with array refs
by elam (Acolyte) on Feb 09, 2003 at 22:27 UTC | |
by ihb (Deacon) on Feb 10, 2003 at 01:20 UTC | |
|
Re: Last element index with array refs
by elam (Acolyte) on Feb 09, 2003 at 22:09 UTC | |
by Hofmator (Curate) on Feb 09, 2003 at 22:30 UTC |