in reply to Re: %hash print output formatting question
in thread %hash print output formatting question

The OP can avoid evaluating the hash in scalar context by changing the dots to commas in the print statement:
sub print_formatted { print "print \%hash with other text:\n"; print "\%hash: " , %hash , "\n\n"; }

For quick dumping of hashes (and arrays, and references, etc.), see also Data::Dumper.

Replies are listed 'Best First'.
Re^3: %hash print output formatting question
by duggles (Acolyte) on Oct 27, 2010 at 22:33 UTC

    makes perfect sense... Thanks for the tip on using commas instead!!

    fyi - I'm a big fan of Data::Dumper, but in this case I was being a bit lazy...

    Thanks again!
    Life is short, but it's wide -- Chuck Pyle