Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Search a string from beginning or end

by NodeReaper (Curate)
on Dec 28, 2001 at 02:59 UTC ( #134760=perlquestion: print w/replies, xml ) Need Help??
NodeReaper has asked for the wisdom of the Perl Monks concerning the following question:

Reason: (grinder) Extract string from rear of string restated, as initial node was not approved (my bad).

For more information on this node visit: this

Replies are listed 'Best First'.
Re: Search a string from beginning or end
by dmmiller2k (Chaplain) on Dec 28, 2001 at 03:22 UTC
Re: Search a string from beginning or end
by chipmunk (Parson) on Dec 28, 2001 at 07:08 UTC
    Instead of basename, you could use fileparse, which is also part of the File::Basename module. For example: ($base,$path,$suffix) = fileparse($file, '\.[^.]*');

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://134760]
Approved by root
Discipulus a missing semicolon after use LWP::UserAgent caused very strange behaviour and not the normal warning...
[choroba]: Yes, sometimes missing ; after the use clause just interprets the next line somehow and passes the result to the used module which could happily ignore it. Been there, seen that.

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2017-02-28 08:47 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (398 votes). Check out past polls.