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: Intermediate:
Using perl modules proving frustrating


New User

Feb 19, 2010, 8:03 AM

Post #1 of 3 (743 views)
Using perl modules proving frustrating Can't Post

My modules don't always seem to work... relatively simple tasks being done and my program will quit running as soon as there is a subroutine call to something in a module.

I have someone here who has managed to get perl modules working but only with every single scalar lexically scoped with my. They won't read global scalars from my main script.

Any advice on the most efficient way of working with module subroutines? I feel like I have to pass and return 10+ scalars every time I make a simple subroutine call... makes it seem worthless to even have these subroutines.

Veteran / Moderator

Feb 19, 2010, 8:58 AM

Post #2 of 3 (737 views)
Re: [clearwaternw] Using perl modules proving frustrating [In reply to] Can't Post

Without seeing your code, it's hard to say what you're doing wrong, but I can say that using/passing globals is almost always (about 99.8% of the time) the wrong thing to do.


Feb 19, 2010, 10:01 AM

Post #3 of 3 (729 views)
Re: [clearwaternw] Using perl modules proving frustrating [In reply to] Can't Post

If you want to learn how to program, then you should strike the word 'global variable' from your lexicon. Every time you create a global variable in your code, the person sitting next to you should bash you in the knee cap with claw end of a claw hammer.

(This post was edited by 7stud on Feb 19, 2010, 10:05 AM)


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

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