Before. I took the approach of identifying difference with what I would do. I immediately saw two things: code before functions, and use of exit. I looked if there was more code below exit, and voila!
The fix is to add one word:
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; _test(); exit; ######## subroutines BEGIN { <----- my @values = qw( 1 2 3 ); sub _test { print "Values:\n", Dumper( \@values ); } }
In reply to Re^3: Check your wits
by ikegami
in thread Check your wits
by Krambambuli
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |