Re: Remove and substitute character in a string with a regex

2010-05-11 Thread C.DeRykus
On May 10, 5:29 am, t.baetz...@bringe.com (Thomas Bätzler) wrote: > Hi Shlomi, > > > use warnings is preferable to the -w flag. > > Not in my book. The command line switch turns on warnings globally, whereas > the "use warnings;" pragma only enables them in the current lexical scope. So > by usin

Re: Remove and substitute character in a string with a regex

2010-05-11 Thread C.DeRykus
On May 9, 10:03 am, blog.h...@gmail.com (Finalfire) wrote: > Hello guys! I'm skilling regex using Perl and i've some trouble about > a simple try: > i've a string like: > > $string = "HELLAAABB"; > > and i want to manipulate in that way: HELL4O3ABB4C;You can simply > notice that when i have

Re: AW: AW: Remove and substitute character in a string with a regex

2010-05-11 Thread Dr.Ruud
Thomas Bätzler wrote: > (attribution fixed) Shlomi Fish: use warnings is preferable to the -w flag. Not in my book. The command line switch turns on warnings globally, whereas the "use warnings;" pragma only enables them in the current lexical scope. So by using the command line switch, I ge

Re: Remove and substitute character in a string with a regex

2010-05-11 Thread C.DeRykus
On May 10, 3:53 am, shlo...@iglu.org.il (Shlomi Fish) wrote: > Hi Thomas, > > a few comments on your code. > > On Monday 10 May 2010 13:45:53 Thomas Bätzler wrote: > > > > > Finalfire asked: > > > Hello guys! I'm skilling regex using Perl and i've some trouble about > > > a simple try: > > > i've

AW: AW: Remove and substitute character in a string with a regex

2010-05-10 Thread Thomas Bätzler
Hi Shlomi, > use warnings is preferable to the -w flag. Not in my book. The command line switch turns on warnings globally, whereas the "use warnings;" pragma only enables them in the current lexical scope. So by using the command line switch, I get warnings about crappy third-party code, too.

Re: AW: Remove and substitute character in a string with a regex

2010-05-10 Thread Shlomi Fish
Hi Thomas, a few comments on your code. On Monday 10 May 2010 13:45:53 Thomas Bätzler wrote: > Finalfire asked: > > Hello guys! I'm skilling regex using Perl and i've some trouble about > > a simple try: > > i've a string like: > > > > $string = "HELLAAABB"; > > > > and i want to manip

AW: Remove and substitute character in a string with a regex

2010-05-10 Thread Thomas Bätzler
Finalfire asked: > Hello guys! I'm skilling regex using Perl and i've some trouble about > a simple try: > i've a string like: > > $string = "HELLAAABB"; > > and i want to manipulate in that way: HELL4O3ABB4C;You can simply > notice that when i have 3 or more occurrences of a character,

Re: Remove and substitute character in a string with a regex

2010-05-10 Thread Shawn H Corey
Finalfire wrote: Hello guys! I'm skilling regex using Perl and i've some trouble about a simple try: i've a string like: $string = "HELLAAABB"; and i want to manipulate in that way: HELL4O3ABB4C;You can simply notice that when i have 3 or more occurrences of a character, i want to subst

Re: Remove and substitute character in a string with a regex

2010-05-10 Thread Shlomi Fish
Hi Finalfire, On Sunday 09 May 2010 20:03:44 Finalfire wrote: > Hello guys! I'm skilling regex using Perl and i've some trouble about > a simple try: > i've a string like: > > $string = "HELLAAABB"; > > and i want to manipulate in that way: HELL4O3ABB4C;You can simply > notice that when

Remove and substitute character in a string with a regex

2010-05-10 Thread Finalfire
Hello guys! I'm skilling regex using Perl and i've some trouble about a simple try: i've a string like: $string = "HELLAAABB"; and i want to manipulate in that way: HELL4O3ABB4C;You can simply notice that when i have 3 or more occurrences of a character, i want to substitute all the occur