Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://268935]
help
Chatterbox?
[choroba]: LanX ciao! BTW, yesterday evening I arrived home in my new car ;-)
[Discipulus]: it seems some signal is issued but only by services
[Discipulus]: which one choroba?
[choroba]: Perlingo

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2017-01-17 09:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (154 votes). Check out past polls.