Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Code won't proceed after input.

by toolic (Bishop)
on Jan 23, 2013 at 15:51 UTC ( #1014936=note: print w/replies, xml ) Need Help??


in reply to Code won't proceed after input.

Your while loop is an infinite loop because you never increment the $counter variable inside the loop.

See also Basic debugging checklist

UPDATE:

I would appreciate ALL the help you have.
You can use qw to cut down on some typing:
my @AAMatrix = qw( A C D E F G H I K L M N P Q R S T V W Y );

You can use map and Range Operators to cut down on some more typing:

my @AAOcc = map { 0 } 1 .. 20;

Replies are listed 'Best First'.
Re^2: Code won't proceed after input.
by Athanasius (Chancellor) on Jan 23, 2013 at 16:06 UTC

      Or better yet IMHO:

      >perl -wMstrict -le "my @AAMatrix = qw( A C D E F G H I K L M N P Q R S T V W Y ); ;; my @AAOcc = (0) x @AAMatrix; print qq{@AAOcc}; " 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
        I ran out of votes before getting to your comment, but I definitely approve as it solves a common mistake where manual sizing of multiple arrays is involved
        A Monk aims to give answers to those who have none, and to learn from those who know more.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1014936]
help
Chatterbox?
[GotToBTru]: You can't tunafish, but some seafood companies can tunafish. More fun with English.
[virtualsue]: a veterinarian told me to cut down on my cat's food. i said, when i do that she just catches more mice
[thezip]: My dogs are also excellent mousers, at least that's what they tell me.
[GotToBTru]: our beagle has dispatched 3 rabbits to the Great Hutch in the Sky since March.
[thezip]: I can always tell when the dogs have been mousing, as there is a concentric ring of mud around the end of their snouts when they do.
[thezip]: As for more physical evidence, that always seems to be missing somehow
[Rabbi Bob]: We have a Jack Russell: off the leash she is a torpedo against mice, rats, chipmunks and squirrels
[Rabbi Bob]: Doesn't eat them, just snaps, kills, drops and moves on.
[thezip]: Efficient, that one.

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (15)
As of 2017-11-17 19:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (272 votes). Check out past polls.

    Notices?