in reply to Re^4: Particle movement question
in thread Particle movement question

Start with use strict; use warnings; and clean up the mess that shows ya.

I suspect $F[$n] should be $Fn, ditto for $G[$n] to $Gn

its

if ($flag eq 'C_N' || $flag eq 'C_S' || $flag eq 'C_E' || $flag eq 'C_ +W'){
not
if ($flag eq 'C_N', 'C_S', 'C_E', 'C_W'){

you say

for my $i (0..$N) { for my $j (0..$N) {
but your init statements only do
for $i (1..$imax) { for $j (1..$jmax) {

a numeric equals test is == not =, the single equals sign is an assignment

after that i got it to compile, dunno if it does anything