perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ch...@evermeet.org
Subject %fdat handling of same name feilds.
Date Thu, 27 May 2004 04:18:30 GMT
I looked through the mailing list but couldn't really find 
anything concerning to this. So im sorry if im rehashing 
an older discussion.

The current functionality of fdat when you have multiple 
field names is to create a tab delimited string. ie.

?name=foo&name=bar&name=baz

$fdat{name} = "foo\tbar\tbaz" 

but, in the case of

?name=&name=bar&name=baz

$fdat{name} = "bar\tbaz" 

In essence taking 3 original fields and returning 2 
which is confusing my auto-generated forms. I always
have the option to change how my script operates I 
suppose. But I think that it would be more prudent
to have.

$fdat{name} = "\tbar\tbaz" 

or even.

$fdat{name}[0] = ""
$fdat{name}[1] = "bar"
$fdat{name}[2] = "baz"

Is there any way I can change the functionality of %fdat
Or any other suggestions how I could pass my form data over.

My condensed real code follows, with @presult being a 
postgres db-query (an array of hashes), not using magic 
$row on purpose. As above, the end result is a list of
%fdat keys, but if there are any null-fields then my values
become different sizes which skew my db-updates post-submit.

[$ foreach $x (0 .. (@presult - 1)) $]
  <tr>
    <td>[+ $x +]</td>
    <td align=center><input type=text name=fname value="[+ $presult[$x]{fname} +]"></td>
    (+ more)
  </tr>
[$ endforeach $]

and then later on to extract

[-
  @fname = split("\t", $fdat{fname}) ;
  (+ more)
-]

Im sure ill hack together a quick kludge fix tomorrow, just
curious what suggestions people on the list might have. As
well as comments on the way %fdat handles same-name-keys, 
or how it could handle this better.

Oh, perl 5.6.1 apache 1.3.28 mod_perl 1.29 embperl 1.3.6 on
freebsd 5.x-current.

And same results with perl 5.8.3 apache 1.3.29 mod_perl 1.29 embperl
1.3.6 on debian-unstable.

Thanks in advanced.

Chris Andrews
chris-embperl@evermeet.org

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message