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

Re^2: Replace the nth occurence

by Ratazong (Monsignor)
on Nov 21, 2012 at 05:54 UTC ( #1004844=note: print w/replies, xml ) Need Help??


in reply to Re: Replace the nth occurence
in thread Replace the nth occurence

Have you tried to replace the 2nd comma in the following string using your code? Seems there is room for improvement...
my $str = "aa,bb,cc,dd";

Replies are listed 'Best First'.
Re^3: Replace the nth occurence
by ColonelPanic (Friar) on Nov 21, 2012 at 08:58 UTC
    It doesn't even work on the example string for any count other than three--it was just a coincidence that it happened to be in the right position in that case.


    When's the last time you used duct tape on a duct? --Larry Wall

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1004844]
help
Chatterbox?
[Discipulus]: the very same topic was discussed in CB yesterday at lunch time
[Discipulus]: or can I ask for a module to do the back conversion from flame to txt?

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (11)
As of 2017-06-23 08:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (538 votes). Check out past polls.