http://www.perlmonks.org?node_id=686293


in reply to Re^2: Generate a truth table from input string
in thread Generate a truth table from input string

s/(\w+)'/!\1/g

Rule One: Do not act incautiously when confronting a little bald wrinkly smiling man.
  • Comment on Re^3: Generate a truth table from input string

Replies are listed 'Best First'.
Re^4: Generate a truth table from input string
by toolic (Bishop) on May 13, 2008 at 15:54 UTC
    or as use warnings; would say...
    \1 better written as $1

    and use diagnostics; would elaborate...

    (W syntax) Outside of patterns, backreferences live on as variable +s. The use of backslashes is grandfathered on the right-hand side of +a substitution, but stylistically it's better to use the variable fo +rm because other Perl programmers will expect it, and it works better + if there are more than 9 backreferences.
Re^4: Generate a truth table from input string
by ikegami (Pope) on May 13, 2008 at 15:32 UTC
    Is (a+b)' disallowed?