Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Pass by ref vs alias : why does scalar size matter?

by clinton (Priest)
on May 01, 2008 at 21:26 UTC ( [id://684005]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    
       sub reduce_whitespace { $_[0] =~ s/\s+/ /g }
    ...
    
       > black cat
    
  2. or download this
    use Benchmark qw(cmpthese);
    use strict;
    ...
       ${ $_[0] } =~ s/\s+//;
    }
    
  3. or download this
    
    Length of string: 1000
    ...
    alias    151515/s    --     -34%
    ref      228833/s   51%       --
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://684005]
Approved by Corion
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-26 05:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found