Re: regx substitution question

2012-09-05 Thread John W. Krahn
Shlomi Fish wrote: thanks for your answer. See below for my response. On Wed, 5 Sep 2012 09:54:11 -0400 Shawn H Corey wrote: On Wed, 5 Sep 2012 14:33:13 +0100 jet speed wrote: i have an regx question. i have the array contents, now i want to remove the first 2 characters (fc) of each elem

Re: regx substitution question

2012-09-05 Thread John W. Krahn
Shlomi Fish wrote: Replying to myself, I have a correction which Shawn inspired. On Wed, 5 Sep 2012 16:49:42 +0300 Shlomi Fish wrote: On Wed, 5 Sep 2012 14:33:13 +0100 jet speed wrote: i have an regx question. i have the array contents, now i want to remove the first 2 characters (fc) of e

Re: regx substitution question

2012-09-05 Thread John W. Krahn
Shlomi Fish wrote: On Wed, 5 Sep 2012 14:33:13 +0100 jet speed wrote: i have an regx question. i have the array contents, now i want to remove the first 2 characters (fc) of each element in the array and store it in a second array ex: @array2 @array ="fc20/1, fc30/22, fc40/3, fc20/1"; outpu

Re: regx substitution question

2012-09-05 Thread Jim Gibson
On Sep 5, 2012, at 7:02 AM, Shlomi Fish wrote: >># remove the first 2 characters from every element of the array >>my @array2 = map { s/^..//msx } @array1; >> > > This code is wrong in two respects: > > 1. the map clause will return the return value of the s/// subtitution and > will

Re: regx substitution question

2012-09-05 Thread Shlomi Fish
Replying to myself, I have a correction which Shawn inspired. On Wed, 5 Sep 2012 16:49:42 +0300 Shlomi Fish wrote: > Hi Sj, > > On Wed, 5 Sep 2012 14:33:13 +0100 > jet speed wrote: > > > Hi All, > > > > i have an regx question. i have the array contents, now i want to > > remove the first 2

Re: regx substitution question

2012-09-05 Thread Shlomi Fish
Hi Shawn, thanks for your answer. See below for my response. On Wed, 5 Sep 2012 09:54:11 -0400 Shawn H Corey wrote: > On Wed, 5 Sep 2012 14:33:13 +0100 > jet speed wrote: > > > Hi All, > > > > i have an regx question. i have the array contents, now i want to > > remove the first 2 characters

Re: regx substitution question

2012-09-05 Thread Shawn H Corey
On Wed, 5 Sep 2012 14:33:13 +0100 jet speed wrote: > Hi All, > > i have an regx question. i have the array contents, now i want to > remove the first 2 characters (fc) of each element in the array and > store it in a second array ex: @array2 > > @array ="fc20/1, fc30/22, fc40/3, fc20/1"; > > o

Re: regx substitution question

2012-09-05 Thread Shlomi Fish
Hi Sj, On Wed, 5 Sep 2012 14:33:13 +0100 jet speed wrote: > Hi All, > > i have an regx question. i have the array contents, now i want to > remove the first 2 characters (fc) of each element in the array and > store it in a second array ex: @array2 > > @array ="fc20/1, fc30/22, fc40/3, fc20/1"

regx substitution question

2012-09-05 Thread jet speed
Hi All, i have an regx question. i have the array contents, now i want to remove the first 2 characters (fc) of each element in the array and store it in a second array ex: @array2 @array ="fc20/1, fc30/22, fc40/3, fc20/1"; output @array2 ="20/1, 30/22, 40/3, 20/1"; please advice. Thanks Sj