Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: What are multiple $_[0] =~ operations doing?

by jhourcle (Prior)
on Apr 01, 2005 at 13:02 UTC ( #444169=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub sum {
        my $list = shift;
        my $sum = 0;
    ...
    }
    my @values = qw(1 2 3 4 5 6 7);
    print sum(\@values), " ; '@values'\n";
    
  2. or download this
    sub add_two {
        my $arrayref = shift;
        $_ += 2 foreach @$arrayref;
    ...
    }
    my @values = qw( 1 2 3 4 5 6 7 );
    print add_two(\@values), " ; '@values'\n";
    
  3. or download this
    sub sanitize_strings {
       my $arrayref = shift;
       s/[^a-zA-Z0-9_\-]/_/g foreach @$arrayref;
    ...
    }
    my @strings = qw( abc 123 a&21 j**!k );
    print sanitize_strings(\@strings), " ; '@strings'\n";
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2021-01-27 11:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?