Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Using split

by Enlil (Parson)
on Mar 07, 2003 at 09:04 UTC ( [id://241092]=note: print w/replies, xml ) Need Help??


in reply to Using split

try this:
my $fname = (split/\//, '/home/bin/scripts/test.pl')[-1];

update:After reading robartes answer, and rereading the question, I am guessing his answer is more along the lines of what you were looking for rather than how to get the last element of a list returned by a split statement.

-enlil

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (7)
As of 2024-04-24 09:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found