Slash Boxes
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.
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/ [].

      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
          # ...