sathishselvam has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks, Is there any way to speed up the substitution.
The above replace line is in loop which executes 50,000 times and replace the '!' symbol everytime. So it takes around 10 mins and also the input string is so large. Thanks in advance.while ( index($group, "!") > -1 and $index<50000 ) { $group =~ s/!/\n/; index++; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Fast Replacement
by muba (Priest) on Jun 14, 2013 at 05:21 UTC | |
Re: Fast Replacement
by hdb (Monsignor) on Jun 14, 2013 at 06:32 UTC | |
Re: Fast Replacement
by choroba (Cardinal) on Jun 14, 2013 at 07:26 UTC | |
Re: Fast Replacement
by davido (Cardinal) on Jun 14, 2013 at 04:22 UTC | |
Re: Fast Replacement (0.000025s)
by BrowserUk (Patriarch) on Jun 14, 2013 at 10:20 UTC | |
by muba (Priest) on Jun 14, 2013 at 11:01 UTC | |
by BrowserUk (Patriarch) on Jun 14, 2013 at 11:50 UTC | |
by davido (Cardinal) on Jun 14, 2013 at 15:49 UTC | |
by BrowserUk (Patriarch) on Jun 14, 2013 at 19:42 UTC | |
| |
by muba (Priest) on Jun 14, 2013 at 12:19 UTC | |
Re: Fast Replacement
by gurpreetsingh13 (Scribe) on Jun 14, 2013 at 04:44 UTC |