Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Re: Find Comma in a string

by jsprat (Curate)
on Jun 25, 2003 at 18:02 UTC ( #268935=note: print w/replies, xml ) Need Help??

in reply to Re: Find Comma in a string
in thread Find Comma in a string

++tomte for a good answer.

I'd change the example a little. The quoting style used makes this one-liner hard to read - it forces backlashes where they aren't expected. With a *nix shell, single quotes won't force you to escape the dollar signs, ie:

$> perl -e '$pos = 0;print ($pos . " ") while(($pos = index("joe,is,at,home", ",", $pos+1)) != -1);' 3 6 9

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://268935]
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: (4)
As of 2016-10-24 01:02 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (302 votes). Check out past polls.