Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: parsing

by bjelli (Pilgrim)
on Jul 11, 2002 at 14:45 UTC ( #181033=note: print w/ replies, xml ) Need Help??


in reply to parsing

After your loop the last line read is still in $_, so you can use

@path = split(/\//, $_); $importantdir = $path[-3];

the negative index in the array counts from the end of the array rather than the beginning.

--
Brigitte    'I never met a chocolate I didnt like'    Jellinek
http://www.horus.com/~bjelli/         http://perlwelt.horus.at


Comment on Re: parsing
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2014-07-30 20:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (240 votes), past polls