in reply to Re^3: blocks and using braces around filehandles with print
in thread blocks and using braces around filehandles with print
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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: blocks and using braces around filehandles with print
by ikegami (Patriarch) on Mar 17, 2008 at 01:29 UTC | |
by bramble (Beadle) on Mar 17, 2008 at 03:30 UTC |