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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Sub R's

 



SirAnvil
Deleted

Feb 9, 2001, 10:15 AM

Post #1 of 5 (492 views)
Sub R's Can't Post

Can one take all the sub routines from the perl program and slap them in another file and somehow require them at the beggining of the program lauch. that way you could use the same routine for several different perl programs or my perl code won't look so sloppy with a million and two subs in it.

:)

SirAnvil
www.christiangamers.org


SirAnvil
Deleted

Feb 9, 2001, 12:09 PM

Post #2 of 5 (490 views)
Re: Sub R's [In reply to] Can't Post

Okay, never mind I figured it out.

I basically creat a file like this
subs.pl
and put all my sub routines in this. Then at the end of the file I have a 1; to make it true or somthing. then I
require 'subs.pl';

so in my perl code if I have
&sub
and the routine is in the .pl file it works. Neato!!!!

One question,
does the .pl file still require the perl thingy?
#!/usr/bin/perl

?

SirAnvil
www.christiangamers.org


muinatit
Deleted

Feb 9, 2001, 2:55 PM

Post #3 of 5 (487 views)
Re: Sub R's [In reply to] Can't Post

Nope.

muinatit
muinatit@hotpop.com


SirAnvil
Deleted

Feb 9, 2001, 3:45 PM

Post #4 of 5 (486 views)
Re: Sub R's [In reply to] Can't Post

I got to work on my timing. I ask a question then figure it out... DUH. I'm liking this having my subs in another file thing. It gets a little confusing but the master code looks great

SirAnvil
www.christiangamers.org


Jasmine
Administrator / Moderator

Feb 11, 2001, 11:15 PM

Post #5 of 5 (469 views)
Re: Sub R's [In reply to] Can't Post

Sounds like you just may need to pause a moment, contemplate your question again, and figure it out Smile But no bother, so long as you let people know that you've figured it out so they don't spend time replying Smile


 
 


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

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