|
|
Joined: Jul 2001
Posts: 37
Member
|
Member
Joined: Jul 2001
Posts: 37 |
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.
|
|
|
|
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
|
P.I.T.A. / Programmer
Joined: Sep 2000
Posts: 755 |
Something else is wrong. I just tested using your exact example listed above: script_a.cgi: script_b.cgi: 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
"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
|
|
|
|
Joined: Jul 2001
Posts: 37
Member
|
Member
Joined: Jul 2001
Posts: 37 |
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.
|
|
|
|
Joined: Aug 2000
Posts: 874
Moderator / Developer
|
Moderator / Developer
Joined: Aug 2000
Posts: 874 |
throw a
1;
in at the end of the script a file.
|
|
|
|
Joined: Jul 2001
Posts: 37
Member
|
Member
Joined: Jul 2001
Posts: 37 |
Thanks for all your help! I finally managed to get it work. Once again thanks.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 1,157
Joined: July 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|