NAME
Evo::Lib
VERSION
version 0.0227
code2names
{
package My::Foo;
sub foo { }
}
my $code = \&My::Foo::foo;
($pkg, $name) = code2names($code);
Return a package and a name of a code where the subroutine was declared
strict_opts($level, $hash, @keys)
sub myfunc(%opts) { my ($foo, $bar) = strict_opts(1, \%opts, 'foo', 'bar'); }
Get a $hash
and return values in order defined by @keys
. If there are superfluous keys in hash, throw an error. This will help you to protect your functions from bugs "passing wrong keys"
$level
determines how many frames to skip. In most cases it's 1
AUTHOR
alexbyk.com
COPYRIGHT AND LICENSE
This software is copyright (c) 2016 by alexbyk.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.