in reply to Re: Param and Scalars
in thread Param and Scalars

Sorry about that. Here are the two snippets of code with the appropriate tags around them?

The param stuff:

if (! param ) { show_form(); } elsif (defined param ('file_chosen)) { parse_text(); } elsif (defined param('$temp_name')) {print print_results(); }
The radio button group:
while ($counter<=$#doc_offset_array) { @temp_array = @{$array_of_arrays[$counter]}; $temp_name =$doc_offset_array[$counter]; foreach $i (@temp_array) { print radio_group(-name=>'$temp_name', -values=>[@temp_array], -linebreak=>'true'); } } }

Actually, using no quotes in both the radio group and the param function still prevents the elsif statement from being executed, though the radio buttons print OK. Using double quotes in both sets of code also prints radio buttons OK, but prevents the elsif statement from being executed. L

Replies are listed 'Best First'.
Re: Param and Scalars
by kal (Hermit) on Mar 28, 2001 at 15:52 UTC

    It looks like you haven't cut-and-pasted - for example, you should have

    .. elsif (defined param ('file_chosen'))

    .. but obviously, you don't, otherwise it probably wouldn't even parse. The other one ought to be something like

     elsif (defined param ("$temp_name"))

    (personally, I prefer double quotes, most don't.)

    I think you ought to try and post the actual code, rather than a pseudocode example, as there are lots of other things wrong with this which look more like someone trying to express what they want to do rather than the code they already have.