Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by tilly (Archbishop)
on Oct 20, 2001 at 19:31 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://120259]
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-04-16 15:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found