
marcel
New User
Nov 25, 2009, 8:50 AM
Post #1 of 3
(439 views)
|
|
About require and global variable
|
Can't Post
|
|
Hello all, I would like to *include* a file with variable definition on my perl script. This file is shared with a php application which includes it also. That are my settings (very simplified): Config: $name = "foo"; $email = "bar"; main.pl: require "Config"; require "function.pl"; print $name; main.php: <?php include("Config"); echo $name; ?> This is working as wanted but I have one more file level (function.pl) in my perl script and it s not working anymore function.pl: package Func; sub myFunc { print $name; } What am I doing wrong ? Thanks a lot.
|