sulfericacid has asked for the wisdom of the Perl Monks concerning the following question:
In the next example I have a question on efficiency. I know sometimes joining is the only option to add things betweens characters. But if the solution is as simple as this couldn't you just write my $x = "4:6:8:10:12"; ? That would remove the useless need of join and a lot of messy commas.$_ = "I saw Barney with Fred"; s/(fred|barney)/\U$1/gi;
Thanks for your help everyone.my $x = join ":", 4, 6, 8, 10, 12;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Learning Perl 3 questions (misc)
by zengargoyle (Deacon) on Mar 22, 2003 at 03:31 UTC | |
|
Re: Learning Perl 3 questions (misc)
by data64 (Chaplain) on Mar 22, 2003 at 02:59 UTC | |
|
Re: Learning Perl 3 questions (misc)
by MrYoya (Monk) on Mar 22, 2003 at 03:47 UTC | |
|
Re: Learning Perl 3 questions (misc)
by The Mad Hatter (Priest) on Mar 22, 2003 at 03:36 UTC | |
|
Re: Learning Perl 3 questions (misc)
by benn (Vicar) on Mar 22, 2003 at 15:19 UTC | |
|
Re: Learning Perl 3 questions (misc)
by sulfericacid (Deacon) on Mar 23, 2003 at 13:05 UTC |