Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
You have a valid point in that node i was kind of comparing apples to oranges (Of course that node was about uppercasing input which is a bit different). I must have been having brain dead kind of day. As for your number I changed my benchmark code to this for this specific case to this:
Which results in the following FYI- I got these numbers using Perl 5.6.0 on Win32 You are right that this is not as big of difference as 17:1 (Which when I first ran seemed odd to me...) But is still a decent gap. I got the suggestion about not using S when TR will do from Effective Perl Programming (co-authored by our own merlyn). It is a great book with lots of info tweaking your code. off to update that other node now... PS- your benchmark doesnt do anything in either case the line:my $data='for bar baz'; Should be changed to have the char being looked for. Like So: my $data='for-bar-baz'; In reply to Re: Re: Re: Re: string manipulation
by Desdinova
|
|