Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Simply adding a backslash in front of the embedded "}" character makes it work:
    sub Foo::show { print 'Foo::show' };
    my %class = ( 'name}' => 'Foo' );
    print qq{ $class{'name\}'}->show; #};
    Foo->show; #
    • I forgot to add: escaping works for the single quoting q{} too.
      print q{ $class{'name\}'}->show; #};
      $class{'name}'}->show; #
      In this case, backslashes work as an escape character only for the closing delimiter, its pairing delimiter, and other backslashes.
      print q{\'\$\@\{\}\[\]\(\)\"\\};