in reply to question of substitution

Try it:
my $foo = 'abc this cba'; my $bar = 'ijk this kji'; ($foo = $bar) =~ s/this/that/; print "foo = $foo, bar = $bar\n";

Replies are listed 'Best First'.
Re^2: question of substitution
by wannabeboy (Novice) on Feb 27, 2005 at 12:32 UTC
    Got it! Another question: to use /x or not to sue /x Check this code
    $program =~ s { /\* .*? \*/ } []gsx;
    this will remove any comment in a c program. What's the role of /x (I believe it is for extended regulars expressions)??
      /x modifier - 'Ignore (most) whitespace and permit comments in pattern'

      perldoc perlre