G'day kingpin007,
Welcome to the monastery.
I see NetWallah++ has provided the answer to your posted question. Here's a couple of additional points.
Your shebang line needs to start with #!, not !#. I suspect this is simply a typo but if you run this code you'll get the (possibly rather cryptic) message: "Can't modify not in scalar assignment".
When you have sequences of numbers, you can use the range operator (..). Instead of qw(1 2 3 4 5 10 11 12 13 14), you can just type (1 .. 5, 10 .. 14). This is described in perlop - Range Operators.
-- Ken
In reply to Re: new to perl, need some help
by kcott
in thread new to perl, need some help
by kingpin007
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |