Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi dear monks. i wrote following subroutine
sub versatility{ my(%site1)=@_; my(%site2)=@_; for (keys(%site1)) { if ($site2{$_}) { my $m=(@{$site1{$_}}[1]-@{$site2{$_}}[1]); my $n=(@{$site1{$_}}[0]-@{$site2{$_}}[0]); my $slope=$m/$n; print "velocity= $slope\n"; } } }
but i have problem that says :cant use string [0,1] as an ARRAY refrence.i gave refrence as you see,but i dont know the reason for this error.please help me.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hash references
by moritz (Cardinal) on Aug 01, 2011 at 11:33 UTC | |
by Anonymous Monk on Aug 01, 2011 at 11:44 UTC | |
by jethro (Monsignor) on Aug 01, 2011 at 12:04 UTC | |
by Anonymous Monk on Aug 01, 2011 at 12:19 UTC | |
by jethro (Monsignor) on Aug 01, 2011 at 14:36 UTC | |
by moritz (Cardinal) on Aug 01, 2011 at 11:49 UTC | |
by Anonymous Monk on Aug 01, 2011 at 11:57 UTC | |
by moritz (Cardinal) on Aug 01, 2011 at 12:01 UTC | |
|
Re: hash references
by JavaFan (Canon) on Aug 01, 2011 at 11:58 UTC | |
by ricDeez (Scribe) on Aug 01, 2011 at 14:22 UTC | |
by JavaFan (Canon) on Aug 01, 2011 at 14:33 UTC |