First note
> my $wordtodelete = "[Deletethis];
should have a trailing quote mark, like this
> my $wordtodelete = "[Deletethis]";
Perhaps you need something like
my $wordtodelete = "\[Deletethis\]";
- Roger -
----- Original Message -----
From: "Verhare" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 01, 2001 2:52 PM
Subject: Find and delete
> Hi,
>
> I'm fairly new to perl and having a little problem.
>
> I want to delete a word from a phrase. My problem is that the word is
> contained in square brackets. The phrase looks something like this :
>
> [Deletethis] And some other words
>
>
> I tried to use something like this to delete the word between (and
> including) the brackets, but it doesn't work :
>
> my $phrase = "[Deletethis] And some other words";
> my $wordtodelete = "[Deletethis];
> $phrase =~ s/$wordtodelete//;
>
>
> NOTE THIS ! : $phrase and $wordtodelete actually are defined somewhere
else
> in the script.
>
>
> Who can help ?
>
>
> Rene
> [EMAIL PROTECTED]
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]