Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: symbolic ref error

by Lhamo_rin (Friar)
on Aug 10, 2005 at 17:11 UTC ( [id://482657]=note: print w/replies, xml ) Need Help??


in reply to Re: symbolic ref error
in thread symbolic ref error

I know it looks messy but what I am trying to do is put a value into an array that is named after the conditions in which the value was taken. Here is more:
$seq = 'KLLS3'; $point = 'weight'; $index = 4; $mean = 1.443; sorting($seq, $index, $point, $mean); sub sorting { if ($_[0] eq "KLLS3_LT.V4_0") { if ($_[1] == "1") {push @{{$_[2]}{$_[0]}{$_[1]}}, $_[3];} }

Replies are listed 'Best First'.
Re^3: symbolic ref error
by runrig (Abbot) on Aug 10, 2005 at 17:25 UTC
    ...put a value into an array that is named after the conditions...

    Is there any reason why you can't use a hash array instead of a symbolic reference to a regular array (and use strict)? E.g.:

    my $seq = 'KLLS3'; my $point = 'weight'; my $index = 4; my $mean = 1.443; my %hash; sorting($seq, $index, $point, $mean); sub sorting { if ($_[0] eq "KLLS3_LT.V4_0") { if ($_[1] == "1") {push @{$hash{$_[2]}{$_[0]}{$_[1]}}, $_[3];} } }
      I'm not familiar with using a "hash array". Where can I learn more? I have all the O'Reilly books on Perl. In your example, how would you retreive the values from the numerous arrays?
        Start with perldoc perldata, perldsc, and perllol. And look up "hash" in the index and table of contents in your books. Are you familiar with "associative array"? It's the same sort of thing.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-18 01:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found