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
In reply to Re: extracting data
by pboin
in thread extracting data
by Angharad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |