#!/usr/bin/perl -w use strict; use diagnostics; use warnings FATAL => 'all'; use Data::Dumper; $Data::Dumper::Useperl = 1; $Data::Dumper::Indent = 1; $Data::Dumper::Sortkeys = 1; $Data::Dumper::Useqq = 1; $Data::Dumper::Deparse = 1; use Params::Validate qw(:all); sub foo { validate( @_, { 'bar' => 1, # mandatory 'baz' => 0, # optional } ); print "Hello Nurse!\n"; } foo('bar' => "arg1"); sub qux { validate( @_, {} ); print "Empty Hash\n"; } qux('test');