Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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


Comment on Re: Re: Find Comma in a string
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2014-12-21 18:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (106 votes), past polls