Path: utzoo!utgpu!watserv1!watmath!att!tut.cis.ohio-state.edu!VAX1.CC.UAKRON.EDU!math-cs.kent.edu!news From: gorpong@math-cs.kent.edu (Gordon C. Galligher) Newsgroups: comp.lang.perl Subject: Perl 3.0 PL28 package and subroutine PROBLEMS (ie: I NEED HELP) Keywords: Package, Subroutine Message-ID: <1990Sep4.190721.8505@math-cs.kent.edu> Date: 4 Sep 90 19:07:21 GMT Organization: Kent State University Lines: 47 I am attempting to write a function: alarm() in Perl using Perl 3.0 PL28. I have done the following: package ALARM; ...comment stuff... ($version, $patchlevel) ..... (Make sure I'm at least perl 3 pl9 for pipe()) sub main'alarm { ....the body of the function.... } In my test file (talarm.pl), I do the following: require "alarm.pl"; print "blah blah blah"; $time = &alarm(10); The perl execution dies with: "Undefined subroutine 'alarm' called at ./talarm.pl line 9." OK, what am I doing wrong? I thought that preceding the alarm subroutine with the main', I would be putting it into the main's dataspace/stack. This is obviously not occuring. Perl -d is absolutely no help, even when I 'require' some functions which do not change packages, it does not know about them with the 'S' command. I did not want to post the entire file, because it is over 140 lines, and that is really out of the scope of my question. The require does not fail, but the subroutine also does not show up in the main package. Before you suggest, I tried: $val = &ALARM'alarm(10); and got the same error, which leads me to believe that something is seriously wrong, with the way I am doing it, or perl. (Of course, it could not be ANYTHING that I am doing, could it :-) Any suggestions would be greatly appreciated. If it would not be too much trouble, I would appreciate the answers posted, so others can benefit from this wierdness. Thank you very much. -- Gordon. P.S. For the person asking about a timeout for , the sooner I get help on this problem, the sooner you can have your timeout (hint, hint).