Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Re: Re: path is broken

by kilinrax (Deacon)
on Dec 07, 2000 at 16:53 UTC ( [id://45491]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: path is broken
in thread path is broken

I assume that what you're looking for here is the string '/org/trans/program files/dir1/subdir1/subdir2/file1.cpp'.
Crafting a regex to extract the file name without having a format you can rely on is going to be tricky.
However, if you are always going to be looking for a '.cpp' file, then the following will work:
#!/usr/bin/perl -w use strict; my $data = join '', <DATA>; my ($filename) = ($data =~ m|^Module: (.*\.cpp)$|ms); $filename =~ s|\n||; print $filename; __DATA__ Module: /org/trans/program files/dir1/subdir1/subdir2/file1.cpp some flags some history

Log In?
Username:
Password:

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

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

    No recent polls found