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

Re (tilly) 2: passing subroutine arguments directly into a hash

by tilly (Archbishop)
on Oct 20, 2001 at 19:31 UTC ( #120259=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # Takes a hashref, a key name, and an optional default.
    # Removes that key from the hash, and returns the value or
    ...
        confess("Missing required argument '$arg_name'");
      }
    }
    
  2. or download this
    # Takes a hashref.  Verifies that it is empty
    sub assert_args_done {
    ...
        confess("Unexpected arguments '@left' left over");
      }
    }
    
  3. or download this
    sub some_func {
      my $args = { @_ };
    ...
      assert_args_done($args);
      # Rest of the code here.
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2021-05-08 11:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (96 votes). Check out past polls.

    Notices?