Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: extract file name from path

by hdb (Prior)
on Sep 11, 2013 at 17:15 UTC ( #1053534=note: print w/ replies, xml ) Need Help??


in reply to extract file name from path

Simple, just rule out dashes from the filename:

use strict; use warnings; my $line = "root 30145 1 0 Jan30 ? 00:09:01 /root/java/app/java_app_1R +ule_java_app_2Rule.java --javaproc"; print "$1\n" if $line =~ m|/([^/]+)\.java\s|;


Comment on Re: extract file name from path
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (14)
As of 2015-07-02 08:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (31 votes), past polls