Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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 surveying the Monastery: (6)
As of 2014-12-29 01:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (184 votes), past polls