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


in reply to How's your Perl? (II)

  1. $foo = *_;
  2. *foo = \ substr "", 0, 1;
  3. BEGIN { $^H = 0x30000; $^H{"qr"} = sub{""}; }
  4. sub { *foo = \@_ }->( $foo, $foo )
  5. *foo = \ "constant"
  6. I didn't know this one until I saw ccp's answer and I don't know of a second way.
  7. *foo = *`; $* = 1; "true\n0"=~/\z/;
  8. *| = \$foo;
  9. 2 =~ /(2)/; *| = *^N;
  10. xmath gave this one to me because it contradicted the documentation and it isn't supposed to be possible. There is a loophole but it requires reading an obscure bit from Changes5.8.