Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Regex for ignoring paths

by dbuckhal (Chaplain)
on Oct 31, 2018 at 18:05 UTC ( [id://1225010]=note: print w/replies, xml ) Need Help??

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
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1225010]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-20 06:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found