Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: trim() magic

by dragonchild (Archbishop)
on Mar 30, 2005 at 14:21 UTC ( #443464=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub trim {
      if (defined my $w = wantarray) {
    ...
        for (@_ ? @_ : $_) { s/^\s+//, s/\s+$// if $_ }
      }
    }
    
  2. or download this
    cmpthese( -1, {
            japhy => sub { $_ = '  asdf  '; trim1(); },
    ...
              Rate dchild  japhy
    dchild 39628/s     --    -3%
    japhy  40959/s     3%     --
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2015-07-08 01:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls