Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Parse a line

by phenom (Chaplain)
on Dec 10, 2004 at 15:02 UTC ( #413867=note: print w/replies, xml ) Need Help??


in reply to Parse a line

I don't think that script applies to your problem. There are likely a thousand ways of doing what you want, but this works:
#!/usr/bin/perl use strict; use warnings; my $line = 'sample/fresh/fresh/0/pineapple'; my @words = split/\//, $line; print $words[-1],$/;
Look at perldoc -f split

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://413867]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2016-12-10 09:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (160 votes). Check out past polls.