Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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|;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1053534]
help
Chatterbox?
beech .oO( talking 'bout my ...)

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2017-02-28 08:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (398 votes). Check out past polls.