Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Cant coerce

by hdb (Prior)
on Jun 24, 2014 at 18:52 UTC ( #1091091=note: print w/replies, xml ) Need Help??

in reply to Cant coerce

The line

foreach my $rt ( @{$first{$fr}{$tg}{$ab}}){

tells that $first{$fr}{$tg}{$ab} is a reference to an array.

In the line

my $val = $first{$fr}{$tg}{$ab}{$rt} ;

you use it as if it were a reference to a hash. That's what the problem is.

If you remove that line and change the one after to

print " print $fr, $tg, $ab, $rt;"

you will probably get what you want. (I cannot test as you have not provided runnable code nor data.)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1091091]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2017-01-21 15:33 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (185 votes). Check out past polls.