Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: R.Exp. Matching from the Right

by mk. (Friar)
on Feb 24, 2006 at 17:14 UTC ( [id://532602]=note: print w/replies, xml ) Need Help??


in reply to R.Exp. Matching from the Right

i assume you want the file name, without the path - is it right?! if so, try this:
(my $file = "c:/progra~1/apache~1/apache2/cgi-bin/test/new/Feb23-2006_ +0_test_error.txt")=~ s/.*\///g; print $file;

if you want to print the path as well, just use print $&;

update
the code above will replace the path with nothing, so the result will be just the filename. you might recover the path later, as i said, using $&.
still, if you really only want to match, i guess Praveen's reply will be more suitable.
=)


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-19 17:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found