Help for this page

Select Code to Download


  1. or download this
    sub short {
        my $path = shift;
        $path = ˜ s{.*/}{};
        $path;
    }
    
  2. or download this
    my $short = sub {
        my $path = shift;
        $path =~ s{.*/}{};
        $path;
    };
    
  3. or download this
    perl -Mstrict -we '                                                   
    +                                                          
      my $dir = shift or die "missing dir name...\n";
    ...
    
    full: temp01/subtemp01/subsubtemp04/file04
    shortened: file04