This problem is seen when the noao.imred.specred package is loaded. The offending
code is in specred.cl:
#{ SPECRED package definition
proto # bscale
package specred
# Slitproc
cl < doslit$doslittasks.cl
task sparams = "specred$sparams.par"
specred.cl loads proto before executing the package statement. It then
loads the doslittasks.cl task which defines a number of new tasks. These
tasks think they are in the proto package, because the current package
and current package binary aren't passed to doslittasks.
It's very easy to fix; just make sure that the IrafPkg? run function appends
the current package to loadedPath: that is where the current package and
current package binary are evaluated from.