I'd rather use the equivalent

```perl
foreach my $k (sort(keys(%$env_entries))) {
    print $cronfh "$k=$env_entries->{$h}\n";
}
```

Because `$_` gives lots of surprises and is evil.