Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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: (4)
As of 2015-03-01 17:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When putting a smiley right before a closing parenthesis, do you:









    Results (13 votes), past polls