in reply to Hash reference question
From perldoc perlsub (in the section on Prototypes):
Any backslashed prototype character represents an actual argument that absolutely must start with that character. The value passed to the subroutine (as part of @_) will be a reference to the actual argument given in the subroutine call, obtained by applying \ to that argument.
I interepret that to mean that the behaviour that you're seeing in correct. Perl expects you to pass a hash to the subroutine. Perl will then take a reference to the hash and pass that into the subroutine as the argument. You should therefore pass a hash into the subroutine, but expect a reference to a hash within the subroutine.
--
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: Hash reference question
by splinky (Hermit) on Jul 13, 2000 at 20:57 UTC | |
|
Thanks!
by Anonymous Monk on Jul 13, 2000 at 17:47 UTC |