Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: subroutine passing array as named parameter

by zigdon (Deacon)
on Sep 05, 2006 at 18:58 UTC ( #571307=note: print w/replies, xml ) Need Help??


in reply to subroutine passing array as named parameter

You're evaluating @_ in scalar context - which returns the number of items (1 in this case). Try forcing list context instead:
sub validate_record_length { my ($args) = @_; ...

-- zigdon

Replies are listed 'Best First'.
Re^2: subroutine passing array as named parameter
by sxmwb (Pilgrim) on Sep 05, 2006 at 20:00 UTC
    Thank you. I feel dumb now. I copied the code and for some reason dropped the parans. This solved the problem.

    Thanks for the help and I keep learning a lot from everyone.

    Seeker of knowledge

    sxmwb

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2019-05-25 13:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (152 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!