licking9Volts has asked for the
wisdom of the Perl Monks concerning the following question:

Hi all,
I'm fairly new to Perl, and lately I've been converting my old awk scripts to Perl by using a2p. I'm running version 5.004_04 on Irix. (I know there's a newer version but our admins are tied down by corporate red tape when it comes to installing software). Anyway, I noticed that it always inserts these three lines in the generated Perl code:

I'm puzzled by the $[ variable. I read in Programming Perl that it's set to 1:

"...to make Perl behave more like awk...when evaluating the index and substr functions".

I don't mind using 0 as the array base so I started tinkering around with this variable just to see what would happen. Well, nothing happened when I changed it. Shouldn't it have some effect on arrays like this?:

"perldoc perlvar" command will say about such funny variables in detail, but in short why you did not noticed any distinctions when changing array bound base -- you did not relied on that in your script!

Namely, you filled entire array with values, and after that you may be output that array out entirely, without specifying any bound at all.

You'll see a diffenrence when you'll do some implicit indexing, such as $in_data[0] or somesuch.

Beleive me or not, I got different results when set $[ to 1, 7 and 0 running your piece of code. (slightly modified, but you did not provided exact code to execute. and I'll show you my logs if needed.)

About usage of "$_" variable -- beware, your "while(<FILE>)" - this loop corrupts "$_", and "local $_;" statement somewhere before that loop will be a good idea, just to preserve its value.

Sins of Perl Revisited will get you an idea what I mean. Here's
an excelent explanation about power plant... well, read on, this certainly worth it!