Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
hello friends,
I have a question in perl programming.
I am trying on a logic where i have to ignore "'" (apostrophe) in a array.
Here is my code:
*************
sub func { my ($value) = @_ ; if($value =~ s/\'//) { $value = "'".$value."'"; } }
************
This works fine if the data in a column is :
&&&&&&&&&&&&&&
hello Ron, welcome to Itn'l ariport
&&&&&&&&&&&&&&
but giving ORA-01756: quoted string not properly terminated
error if the data is
&&&&&&&&&&&&&&
he'llo Ron, welco'me to Itn'l ariport
&&&&&&&&&&&&&&
so i tried something like this
*************
sub func { my ($value) = @_ ; if($value =~ /\'/) { if($value[$i] = 0; $value[$i] <= length($value); $value[$i]++) { if($value =~ s/\'//); } $value = "'".$value."'"; } }
************
actually i am trying to ignore "'" (apostrophe) in a array. since i am not getting the logic atleast i am trying to replace it with nothing.
i am getting syntax errors here.
I am learing perl. Any help would be greatly appreciated.
regards,
Code tags and formatting to match OP's intent added by davido
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to ignore ' in an array
by Joost (Canon) on Aug 03, 2005 at 15:34 UTC | |
|
Re: how to ignore ' in an array
by davorg (Chancellor) on Aug 03, 2005 at 15:49 UTC | |
|
Re: how to ignore ' in an array
by davidrw (Prior) on Aug 03, 2005 at 15:45 UTC | |
by inman (Curate) on Aug 03, 2005 at 16:07 UTC | |
| |
|
Re: how to ignore ' in an array
by NateTut (Deacon) on Aug 03, 2005 at 15:55 UTC | |
by davorg (Chancellor) on Aug 03, 2005 at 16:00 UTC | |
by Fletch (Bishop) on Aug 03, 2005 at 19:22 UTC | |
by Anonymous Monk on Aug 03, 2005 at 19:28 UTC | |
by davorg (Chancellor) on Aug 03, 2005 at 22:20 UTC | |
by NateTut (Deacon) on Aug 03, 2005 at 19:31 UTC |