A block contains 0 or more Perl statements. A block evaluates the the last value evaluated within the block.
If that's the case, then why doesn't the following work?
#!/usr/bin/env perl use strict; use warnings; my $foo = { print "hi!\n"; my $bar = 7; my $baz = 8; }; print "So, \$foo = $foo\n";
In reply to Re^4: blocks and using braces around filehandles with print
by bramble
in thread blocks and using braces around filehandles with print
by bramble
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |