Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Strange behavior with require Message-ID: <11392@jpl-devvax.JPL.NASA.GOV> Date: 11 Feb 91 23:48:20 GMT References: Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Distribution: comp Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 48 In article victor@ibm.com writes: : Last week I built perl 3 patch level 44 for the two sets of : workstations that we have here: Sun 4's and IBM RT/PC's running bsd : 4.3. Both built just fine, and passed all tests. Just today I : decided to try the Date subroutines and calculator. On the Sun's it : worked just fine (we have shared file systems under NFS). But on the : RT's I get the following output when I run dtc: : : dtc[3]: require: not found : dtc[5]: =: not found : Date Calculator version 1.0 : : dtc[7]: h for help)\n": not found : (type : > : dtc[8]: syntax error at line 10 : `)' unexpected Note that these are *shell* error messages, not Perl messages. That's your clue. : Strangely enough, I can successfully run other scripts having require. : In fact if I change the require to include, the same behavior ensues. : If I comment it out, things start running ok, but, of course, the : subroutines in the require'd file aren't found. For sake of : reference, the beginning of dtc is: : : #!/usr/local/bin/perl -I/homes/irt/victor/perl : : require 'date.pl'; : : $command = ''; : print " Date Calculator version 1.0\n"; : print " (type `h' for help)\n"; : print "> "; : : : Does anybody have a clue as to what could be wrong? Your #! line is obviously not working right, probably because it's too long. First, make sure perl really is in /usr/local/bin. Then change the front of the script to this: #!/usr/local/bin/perl unshift(@INC, "/homes/irt/victor/perl"); require 'date.pl'; Larry