in reply to using a subroutine

sub directs { ... &remove; }
When calling subroutines using the &, you should almost always use () also: &remove();. Not doing so gives the called routine access to the caller's @_; that is, a shift() in remove would take away one of direct's arguments. This can lead to hard-to-find bugs. &subname; without parens is only useful as an optimization in rare circumstances.

Alternatively, drop the & too, and either place the body of your subs before they are called, or use a forward declaration:  sub remove; sub declare;