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.
In reply to hash references by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |