Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: extracting data

by pboin (Deacon)
on Nov 10, 2005 at 12:45 UTC ( #507359=note: print w/replies, xml ) Need Help??


in reply to extracting data

This would be a neat excuse to use negative array indexes subscripts. The split is probably not the utmost in efficiency, but it's pretty easy to write, and easier for others to understand...

#!/usr/bin/perl use strict; while (<DATA>) { my @nodes = split ('/'); print $nodes[-1]; } __DATA__ /home/users/me/proteins/1hc9.txt /home/users/me/proteins/193l.txt /home/users/me/proteins/1trz.txt /home/users/me/proteins/2psg.txt

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2021-07-23 22:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?