Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Dreaded Symbolic References

by dada (Chaplain)
on Mar 08, 2004 at 17:24 UTC ( [id://334879]=note: print w/replies, xml ) Need Help??


in reply to Dreaded Symbolic References

@RecordNames[94] = qw/$Destination $DestinationType/; @RecordLengths[94] = qw/$A8 A4/;
this is wrong: you can't assign a list (as given by qw/.../) to an array element. what you're writing is:
$RecordNames[94] = "$Destination"; $RecordLengths[94] = "$A8";
and this will not work, of course. furthermore, you should abandon the habit of populating a single variable for each field you have (eg. $Destination, $DestinationType). use a hash instead:
$fields[94] = [ qw/Destination DestinationType/ ]; $lengths[94] = qq/A8 A4 / ; my @data{ @{$fields[94]} } = unpack($lengths[94], $Record); # then you have: # # $data{Destination} # $data{DestinationType}
hope this helps...

cheers,
Aldo

King of Laziness, Wizard of Impatience, Lord of Hubris

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-03-29 12:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found