in reply to How can I create an anonymous scalar?

my $anonref = do { \(my $x = 12345) };

-- Randal L. Schwartz, Perl hacker