Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • That's really useful. But having to use coderefs is a bit ugly. So I've added support for a :Shortcut attribute. The code is in my svn repository: Attribute-Shortcut/ [happygiraffe.net].

      sub basename :Shortcut { s!.*/!! for @_ }

      for ( '/path/to/foo', '/some/path/to/bar' ) {
          print "Munging " . basename . "\n";
          open my $fh, '<', $_ or die $!;
          # note how $_ still contains the full pathname
          # ...
      }

    -Dom