Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: prototypes: so many \@'s?

by agianni (Hermit)
on Apr 03, 2007 at 13:33 UTC ( #608059=note: print w/replies, xml ) Need Help??


in reply to prototypes: so many \@'s?

( PS. Yes, I surely can sub ttt(@); ttt(\@a,\@b,\@c) but it is not at all as interesting as ttt(@a,@b,@c) )

Nor is it the same thing. The main reason that you should be considering the second option would be if you needed to pass the value of the arrays such that they would not potentially be modified by the subroutine you are calling. If you are not so worried about that possibility and more worried about potentially copying large data structures, the former is your best option.

Unfortunately, I can't offer any useful advice on the question at hand :)

perl -e 'split//,q{john hurl, pest caretaker}and(map{print @_[$_]}(joi +n(q{},map{sprintf(qq{%010u},$_)}(2**2*307*4993,5*101*641*5261,7*59*79 +*36997,13*17*71*45131,3**2*67*89*167*181))=~/\d{2}/g));'

Replies are listed 'Best First'.
Re^2: prototypes: so many \@'s?
by cdarke (Prior) on Apr 03, 2007 at 14:24 UTC
    A prototype of (@) is meaningless. It does not force anything because the smallest list is empty: it asks for an argument in list context, not an array.
    I don't think there is a prototype for what you ask, you will probably have to do without (ttt(\@a,\@b,\@c)) and use ref to check that each argument is of the correct type. Trouble is that this is a run-time check not a compile-time check as you get with a prototype.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2019-12-08 15:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?