UBB.Dev
Posted By: Chuck1616 Require??? - 07/29/2001 12:03 AM
What I am about to ask may sound confusing, but please bear with me.

Say I have "script a"(script_a.cgi) that contains a hash.

%script_a_hash = (
'name_test' => 'This Is A Name',
'des_test' => 'This is a description'
)

But I also have "script b"(script_b.cgi) that requires the use of variables from that hash.

How would I go about calling information from "script a" to "script b"?

Would it be done like*:

require '/scrip_a.cgi';

print $script_a_hash{name_test};

Because when I try that all I get is a blank screen.

Any help is appreciated.
-----------------
* NOTE: That is just an exert, I do have the PERL path, etc.
Posted By: Mark Badolato Re: Require??? - 07/29/2001 12:28 AM
Something else is wrong.

I just tested using your exact example listed above:

script_a.cgi:
Code
code:

script_b.cgi:
Code
code:

Output:
This Is A Name

Either your require file didn't get included (which SHOULD have thrown an error to you) or you had something else wrong.

--mark
Posted By: Chuck1616 Re: Require??? - 07/29/2001 1:09 AM
I have no idea what could be wrong, it just doesn't work for me.

I used that same exact code as below, checked my Perl path, uploaded in ASCII, CHMODED, ran it, and get an error 500.
Posted By: jordo Re: Require??? - 07/29/2001 1:49 AM
throw a

1;

in at the end of the script a file.
Posted By: Chuck1616 Re: Require??? - 07/29/2001 4:47 AM
Thanks for all your help!

I finally managed to get it work. Once again thanks. smile
© UBB.Developers