LassiLantar has asked for the wisdom of the Perl Monks concerning the following question:
Where $row is a reference to a row of data. When the user clicks the "Delete" button, the reloading script notices this and tries to look up param("hidden") to figure out where to find the data it wants to delete, like this:print Tr( start_form(-action => url()), hidden(-name => "hidden", -value => $row), td($row->[0]), td($row->[1]), td($usage), td($cumu_usage), td(submit(-name => "choice", -value => "Delete")), end_form(), );
But instead of outputing a memory address, this outputs the 0th element of the array $row was referring to, and so naturally, if I try... elsif (param("choice") eq "Delete") { print (param("hidden")); ...
Perl complains that I can't use that string as an array reference. Why isn't the reference getting passed through as a reference? Thanks kindly, LassiLantar.$dataref = param("hidden"); $date = $dataref->[0];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Passing a reference as the value of a hidden html field
by chromatic (Archbishop) on Jul 20, 2004 at 21:02 UTC | |
by LassiLantar (Monk) on Jul 20, 2004 at 21:26 UTC | |
by chromatic (Archbishop) on Jul 20, 2004 at 22:07 UTC | |
by ccn (Vicar) on Jul 20, 2004 at 21:37 UTC | |
by LassiLantar (Monk) on Jul 20, 2004 at 21:56 UTC | |
|
Re: Passing a reference as the value of a hidden html field
by ccn (Vicar) on Jul 20, 2004 at 20:56 UTC |