1. spek
  2. devel-examine-subs

Commits

spek  committed a2c342a

- fixes bug 4
- _subs now returns a hash, not a href

  • Participants
  • Parent commits 9efb694
  • Branches default

Comments (0)

Files changed (1)

File lib/Devel/Examine/Subs.pm

View file
 use strict;
 use warnings;
 
-our $VERSION = '0.09';
+our $VERSION = '0.10';
 
 sub new {
 
     my $search      = $p->{ search }; 
     my $want_what   = $p->{ want_what }; # 0=missing 1=has >1=all
     
-    my $subs = _subs({
+    my %subs = _subs({
                         file => $file,
                         want => $search,
                     });
 
     # return early if we want all sub names
     
-    return [ sort keys %$subs ] if $want_what > 1;
+    return [ sort keys %subs ] if $want_what > 1;
     
     my ( @has, @hasnt );
 
-    while ( my ($k,$v) = each %$subs ){
+    while ( my ($k,$v) = each %subs ){
         push @has,   $k if $v;
         push @hasnt, $k if ! $v;
     }
         next if ! $name or ! $want;
         $subs{ $name } = 1 if $line =~ /$want/;
     }
-    return \%subs;
+    return %subs;
 }
 
 1;