As long as the format of what you want (file.txt) remains the same you
could do the following:

($stuffattheend) = $string =~ /\/(\w+\.\w+)$/;

Danny

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 01, 2003 11:41 AM
To: Perl Beginners
Subject: cutting a string

What is the function of cutting a string from a point until the last
character?

For example
$string="C:/progra~1/directory1/directory2/file.txt";

i want to find the last backslash (/) of the string and keep the
sequence 
following it (file.txt)

Is it simple? 

I tried with the split function but it returns a list.

I just want a scalar!



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to