petdance/ack2 — Issue #23: squash doesn't let variables initialize themselves properly
Author: hoelzro
Created: 2011-12-14 05:48:33+00:00
State: open
Labels: bug, task

If you write the following in Ack.pm:

```perl

{
my $first_time = 1;

sub call_func {
if($first_time) {
$first_time = 0;
} else {
print "again\n";
}
}

}
```

and call `call_func`, you would probably expect no output from ack, but you'd be wrong. Squash puts .pm files after the call to main(), so variables initialized inline never get initialized. We either need to warn the developer if they make this mistake (and recommend they initialize their variable in a BEGIN block), or fix squash.