CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
require problems



Dec 24, 2000, 2:04 PM

Post #1 of 3 (755 views)
require problems Can't Post

when i use the require function, it prints out everything from the .pl, is there a way so that it only prints what i want. Specifically just the one subroutine?


Dec 24, 2000, 4:55 PM

Post #2 of 3 (753 views)
Re: require problems [In reply to] Can't Post

I've never tried it, but I remember there being a difference similar to that problem when you try use instead of require, try use "" just to see if it will not print the scripts output and then go ⊂ after you use the file. I'm not 100% sure by no means but it's worth a quick try.


Administrator / Moderator

Dec 31, 2000, 9:30 AM

Post #3 of 3 (743 views)
Re: require problems [In reply to] Can't Post

Without seeing the required file, it's hard to figure this out. But you may have a subroutine call inside the required file, which is telling the required file to do some work.

For example:

# calling file
require "";

#called file



sub dosomething {

If there's a subroutine call outside of a subroutine, it will run. To avoid this, don't use any subroutine calls outside of a subroutine block.

If this doesn't help, please post the required file and we'll try to help.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives