Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: new keyword "size" to avoid scalar trap ? ( scalar @array != scalar(LIST) )

by Laurent_R (Abbot)
on Dec 08, 2012 at 15:46 UTC ( #1007899=note: print w/replies, xml ) Need Help??


in reply to Re^2: new keyword "size" to avoid scalar trap ? ( scalar @array != scalar(LIST) )
in thread new keyword "size" to avoid scalar trap ? ( scalar @array != scalar(LIST) )

It is most probably the copying of the argument list (the full array) in the function call that takes this time difference.

Passing a reference to the array would probably solve the issue, but the syntax would become less obvious to use.

  • Comment on Re^3: new keyword "size" to avoid scalar trap ? ( scalar @array != scalar(LIST) )

Replies are listed 'Best First'.
Re^4: new keyword "size" to avoid scalar trap ? ( scalar @array != scalar(LIST) )
by Anonymous Monk on Dec 08, 2012 at 16:02 UTC
    No copying takes place :) however the same amount of scalars is aliased ;)
Re^4: new keyword "size" to avoid scalar trap ? ( scalar @array != scalar(LIST) )
by LanX (Chancellor) on Dec 08, 2012 at 17:34 UTC
    Thats why we need prototypes or a special C-implementaton.

    according to the perlsub sub size (+;@) { } could be used, to call

     size @array

    or

     size 1,2,3

    but since I'm using 5.10, I can't test it...

    Cheers Rolf

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007899]
help
Chatterbox?
[Corion]: Oof - "Anyway, if it is not obvious, please keep this discussion entirely confidential for now.", as seen on a public mailing list ;)
[Discipulus]: uh no choroba.. i do not practice much with online putyour image sites:can you suggest one (that possibly remove the pic after few days)?
[choroba]: Corion a bug report?
[choroba]: I have no idea :-( I used to post to photobucket.com, but they don't seem to feature "private" pictures in the free version now
[Discipulus]: dazz i'm not an experts but i think it would be possible
[Corion]: dazz: I think Image::Magick can "read" from an in-memory filehandle
[Corion]: choroba: No, some general admin discussion of how to handle (company) user accounts
[Discipulus]: might be it is necessary to pass the pic data like MIME::Base64:: encode( data..

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2017-03-27 07:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (317 votes). Check out past polls.