Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

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?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2015-11-29 06:17 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (747 votes), past polls