On Mon, Apr 30, 2001 at 12:06:55PM +0100, Gary Stainburn wrote:
> Hi all,
>
> can anyone tell me why the following code does not come out with
> '-123.45'. It actually comes out with '123.45-'.
>
> I think that it is because it's treating it as a number at some point,
> but I can't see when/w
The problem is the \ before the . in your regex.
On Mon, 30 Apr 2001 12:06:55 +0100, Gary Stainburn said:
> Hi all,
>
> can anyone tell me why the following code does not come out with
> '-123.45'. It actually comes out with '123.45-'.
>
> I think that it is because it's treating it as
Hi all,
can anyone tell me why the following code does not come out with
'-123.45'. It actually comes out with '123.45-'.
I think that it is because it's treating it as a number at some point,
but I can't see when/why.
#!/usr/bin/perl -w
my $vat='123.45CR';
$vat=~s/(\.*)CR/-$1/i;
print