Hi Michael

Michael Goodman wrote:
>
> Pardon my ignorance but,

This is a beginners list :)

> How do you parse a variable to find every occurrence of a string and
> replace the string with another.  I tried using ~s/ but it doesn't work.

  use strict;
  use warnings;

  my $variable = "A and B and C and D and E";

  $variable =~ s/and/or/g;

  print "$variable\n";

OUTPUT

  A or B or C or D or E


HTH,

Rob



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to