Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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


Comment on Re: Parse a line
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2014-09-17 10:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (72 votes), past polls