Home: Perl Programming Help: Advanced:
requires requires requires



yotam_k
Deleted

Jan 26, 2001, 2:50 PM


Views: 9092
requires requires requires

Somwone please tell me the contex of how requiring a file .
can you use in your answer this file :
"/forum/forum1-1.pl"

Thank You All
Yotam.




modified
Deleted

Jan 26, 2001, 6:00 PM


Views: 9091
Re: requires requires requires


Code
require "./forum/forum1-1.pl";



yotam_k
Deleted

Jan 27, 2001, 2:51 AM


Views: 9086
Re: requires requires requires

Can I require A function?
Should I write In the Top Of the file I want to require :
#!/usr/bin/perl ?

Yotam.




modified
Deleted

Jan 27, 2001, 7:19 AM


Views: 9078
Re: requires requires requires

When you require a file, you take all of the subroutines in that file and make them usable in your script.



yotam_k
Deleted

Jan 27, 2001, 8:03 AM


Views: 9076
Re: requires requires requires

So I can't include :
sub xyz {
}
?




Jasmine
Administrator / Moderator

Jan 27, 2001, 9:04 AM


Views: 9074
Re: requires requires requires

You *are* including subroutine xyz if that sub is in the file you required.

Perhaps we're misunderstanding?



yotam_k
Deleted

Jan 27, 2001, 11:07 AM


Views: 9072
Re: requires requires requires

The problem is that i can't understand why my program returns 500 Error when I am doing exectly what you are saying ...




modified
Deleted

Jan 27, 2001, 1:22 PM


Views: 9070
Re: requires requires requires

Do you have the -T switch on?



yotam_k
Deleted

Jan 27, 2001, 2:38 PM


Views: 9069
Re: requires requires requires

God....
Now you'v questioned something I realy Can't Say...
I am using A free hosting service That I think you know
It's virtualave.net .
I realy Can't say if the have what you'v asked me for , but If you think it's realy nessecery I'll Ask them...

But thank you very much...
Yotam.



modified
Deleted

Jan 27, 2001, 7:07 PM


Views: 9065
Re: requires requires requires

No, no. Okay you dont have the -T switch. Some people (like myself) like to have our shebangs say:


Code
#!/usr/bin/perl -T 
[/pre

-T or Taint is Perl's built in security system. :)



zanardi
journeyman

Jan 27, 2001, 8:19 PM


Views: 9063
Re: requires requires requires

i preffer:


Code
#!/usr/bin/perl -wT 
use strict;

:)

My BBS


modified
Deleted

Jan 27, 2001, 8:52 PM


Views: 9061
Re: requires requires requires

I use


Code
#!/usr/bin/perl -Tw

But I just realized that it's the same thing. :x

I would use strict, but I can't seem to figure out how to make my scripts complaint with strict. I figured out the Taint stuff from an FAQ.. but cant find anything for strict. :|