http://www.perlmonks.org?node_id=319771


in reply to Passing a hash into a subroutine

sub new { my $package = shift; # implicitly passed by the new package syntax my %opts = @_; print $opt{foo}; }