A block contains 0 or more Perl statements. A block evaluates the the last value evaluated within the block.
Examples:
{ STDOUT } -> STDOUT { $hash{$k}[$i] } -> $hash{$k}[$i] { my $x = func(); uc($x) } -> uc($x) { if ($cond) { 'FOO' } } -> If $cond is false, $cond. -> If $cond is true, 'FOO'.
In reply to Re^3: blocks and using braces around filehandles with print
by ikegami
in thread blocks and using braces around filehandles with print
by bramble
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |