Adriano Allora wrote:
> Hi all,
> 
> I need to obtain some values (passed with a form) without knowing their
> names (but I know these variable names correspond to names of some files.
> 
> So, I tried to write  something like this:
> 
> opendir(QUERY,
> "/Users/adrianoallora/Sites/corpora/VALICO/indici_testa/") or $errtex = $!;

The above "or" condition doesn't die, or at least break the execution
loop in some way. It should.

> @interrogabili = readdir(QUERY);
> foreach $elem (@interrogabili)
>     {
>     next if $elem =~ /^\..*/;
>     $elem = $home->param($elem);
>     }
>

You haven't shown us the declaration of $elem, I suspect that is the
issue. And since you haven't shown us the declaration I would have to
guess you aren't using,

use strict;
use warnings;

And you should be.

$elem is getting clobbered each time through the loop with a new value,
from the file list, then a new value from CGI (assuming it is defined).

You need to adjust where you are storing the values to keep all of them.
Or you could just get the full list, see Vars() in the perldoc for CGI.

http://danconia.org


> Why the  $home->param($elem) line doesn't work? All the rest of the code
> works very well (It open effectively the directory, store all the
> entries in the array, read each array item...)
> 
> Any help is soo much appreciated.
> 
> alladr
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to