on Wed, 10 Jul 2002 22:05:58 GMT, Connie Chan wrote:
> Say, I have an input $x = "ABCDEF";
> and I will try to remove $x from a string,
> what can I do ?
>
> Is there something like :
>
> $x =~ s/$x//g;
That's just a complicated way to say
$x = '';
But this works:
#! perl -w
use strict;
my $string = "abcde-to remove-fghij";
my $x = "-to remove-";
$string =~ s/$x//;
print $string; # prints sbcdefghij
--
felix
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]