in reply to i cant see whats wrong with this:

The syntax of else specifies that it must be followed by a block.

So

foreach (@ARGV) { if ($_ eq "complete") { $change="cmplt"; } else { if ($_ eq "srces") { $change="src"; } else { push ($printof{$change}, $_); } } }
would be legal, if horrible. Otherwise you need to use elsif. A more scalable solution would be to use a hash instead.

Of course, if the argument is neither "complete" nor "srces" then $change is not being initialised (in the code shown), so that default push may not be doing the right thing anyway...

--
Tommy
Too stupid to live.
Too stubborn to die.