]> git.vpit.fr Git - perl/modules/Sub-Prototype-Util.git/blobdiff - lib/Sub/Prototype/Util.pm
Better be on irc.perl.org
[perl/modules/Sub-Prototype-Util.git] / lib / Sub / Prototype / Util.pm
index 531cdae7bd989c0693a84cc8ef7c6b3ee4b404fc..68ac767034d309c575945a2fb85a893e8a91d53a 100644 (file)
@@ -12,13 +12,13 @@ Sub::Prototype::Util - Prototype-related utility routines.
 
 =head1 VERSION
 
-Version 0.07
+Version 0.08
 
 =cut
 
 use vars qw/$VERSION/;
 
-$VERSION = '0.07';
+$VERSION = '0.08';
 
 =head1 SYNOPSIS
 
@@ -116,15 +116,16 @@ sub _check_name {
  croak 'No subroutine specified' unless $name;
  my $proto;
  my $r = ref $name;
- if ($r eq 'HASH') {
+ if (!$r) {
+  $proto = prototype $name;
+ } elsif ($r eq 'HASH') {
   croak 'Forced prototype hash reference must contain exactly one key/value pair' unless keys %$name == 1;
   ($name, $proto) = %$name;
- } elsif (length $r) {
+ } else {
   croak 'Unhandled ' . $r . ' reference as first argument';
  }
  $name =~ s/^\s+//;
  $name =~ s/[\s\$\@\%\*\&;].*//;
- $proto = prototype $name unless $proto;
  return $name, $proto;
 }
 
@@ -293,7 +294,7 @@ L<Carp>, L<Exporter> (core modules since perl 5), L<Scalar::Util> (since 5.7.3).
 
 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
 
-You can contact me by mail or on #perl @ FreeNode (vincent or Prof_Vince).
+You can contact me by mail or on C<irc.perl.org> (vincent).
 
 =head1 BUGS