[comp.lang.perl] usersubs vs require broken?

ronald@robobar.co.uk (Ronald S H Khoo) (04/27/91)

Is there any known bad interaction between usersubs and "require"?  I've
got this little curseperl program which dies if I "require 'keys.ph'",
but works fine with keys.ph in the file itself.  (Keys.ph is tiny, and
is included below, the actual program is also tiny, but probably won't work
with a standard BSD curseperl :-( -- it aggravates some nasty bugs in curses
which I had to fix.

One symptom I get is that the magicvars $COLS and $LINES seem to be clobbered
if keys.ph is 'require'd.  I think $stdscr is too, which may explain why
the whole thing just cores on me before anything happens.

Help!

-- keys.ph --
sub KEY_F0 {0410;}
sub KEY_F {
    local($x) = @_;
    eval "( &KEY_F0 + ($x))";
}
sub KEY_DOWN {0402;}
sub KEY_UP {0403;}
sub KEY_LEFT {0404;}
sub KEY_RIGHT {0405;}
sub KEY_HOME {0406;}
sub KEY_IC {0513;}
sub KEY_NPAGE {0522;}
sub KEY_PPAGE {0523;}
sub KEY_LL {0533;}
sub KEY_B2 {0532;}
1;
-- 
Ronald Khoo <ronald@robobar.co.uk> +44 81 991 1142 (O) +44 71 229 7741 (H)