in reply to Use of BEGIN block
Perl has command line arguments that tell it to loop over lines of input (see -n and -p in perlrun). When you use these options your entire program gets executed for each line of input. If you need to perform some initialization before processing any input then the only place it can happen is in a BEGIN block. The END block comes in handy here as a place to print results.
| 90% of every Perl application is already written. ⇒ |
| dragonchild |
|
|---|