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

Intelligently shortcutting $_-or-params, non-destructive-or-in-place function maker

by Aristotle (Chancellor)
on Jul 09, 2006 at 10:13 UTC ( [id://559986]=CUFP: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    BEGIN { *basename = shortcutted { s!.*/!! for @_ }; }
    
    ...
        # note how $_ still contains the full pathname
        # ...
    }
    
  2. or download this
    sub shortcutted(&) {
        my $sub = shift;
    ...
            return $nondestructive ? @byval[ 0 .. $#byval ] : ();
        };
    }
    
  3. or download this
    use Test::More;
    
    ...
        is_deeply( \@res,  \@modified, '...returned correctly' );
        BEGIN { $num_tests += 2 }
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-03-28 15:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found