Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Manipulating data structure

by Cristoforo (Deacon)
on Aug 16, 2012 at 22:03 UTC ( #987883=note: print w/ replies, xml ) Need Help??


in reply to Manipulating data structure

Are these correct as shown below or did you missprint them? If they are missprints, should they be 'DOL' or 'DOLD'?

Do the 'numbered' keys always occur at the bottom of the list?

Chris

UID= UID=FRLARS UID=ANJA08 FNA= FNA=Fredrik FNA=Anja ENA=Exp-pri ENA=Larsson ENA=Daun PRE=(0117) PRE=(0117) PRE=(0117) NYTT=23400 NYTT=23403 NYTT=23404 PRI1=Nej FOR1=Nej DOLD1=Nej should this be DOL? CMG1=Ja MEX1=Nej PRI2=Nej FOR2=Nej DOLD2=Nej should this be DOL? CMG2=Ja MEX2=Nej PRI3=Nej FOR3=Nej DOL3=Nej not like the 2 entries above CMG3=Ja MEX3=Nej


Comment on Re: Manipulating data structure
Download Code
Re^2: Manipulating data structure
by SerZKO (Beadle) on Aug 17, 2012 at 05:47 UTC
    Hej Cristoforo and thanks for your reply,

    You are right, it was a missprint, it is DOL1, DOL2, DOL3, etc.

    And yes, numbered keys always goes on the bottom of the list (I think it's a consequence of using radio buttons which are seen as one "part")

    One strange thing I've noticed when I moved this part out of CGI to a separate script and done a dump using Data::Dumper is that all of those numbered keys goes to a first hash ?!?

    $VAR1 = { 'FOR3' => 'Nej', 'UID' => '', 'DOL3' => 'Nej', 'DOL1' => 'Nej', 'FNA' => '', 'MEX2' => 'Nej', 'CMG1' => 'Ja', 'CMG2' => 'Ja', 'MEX1' => 'Nej', 'DOL2' => 'Nej', 'PRI3' => 'Nej', 'spara' => 'Spara', 'PRI1' => 'Nej', 'ENA' => 'Exp-pri', 'FOR1' => 'Nej', 'MEX3' => 'Nej', 'NYTT' => 23400, 'FOR2' => 'Nej', 'PRI2' => 'Nej', 'PRE' => '(117)', 'CMG3' => 'Ja' }; $VAR2 = { 'UID' => 'FRLARS', 'PRE' => '(0117)', 'ENA' => 'Larsson', 'NYTT' => 23403, 'FNA' => 'Lars', }; $VAR3 = { 'UID' => 'ANJA08', 'PRE' => '(0117)', 'ENA' => 'Daun', 'NYTT' => 23404, 'FNA' => 'Anja', };
    Anyone knows why ?

      You have to tell Dumper that the element is an array-reference.   Otherwise, it will “flatten” the list for printout and dummy up those $VARn pseudo-names within Dumper’s own output.   But it’s only for its own printing purposes:   those names do not actually exist anywhere.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://987883]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2014-08-29 04:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (275 votes), past polls