I made a working solution, but I don't like this so much.
I had to pass the $IN, $CFG, $GLOBALS, $USER global variables to the called sub, which is not really logical...
Global:
use Links::test;
Links::test::menu_template($IN, $CFG, $GLOBALS, $USER);
use GT::Dumper;
print "Content-Type: text/html\n\n";
print "\$CFG: " . GT::Dumper::Dumper(\$CFG) . "<br>\n\n";
}',
Links/test.pm:
# ==================================================================
use strict;
use vars qw/$GRAND_TOTAL $IN $CFG/;
use GT::Dumper;
sub menu_template {
# --------------------------------------------------------
# This routine determines how the rate failure page will look like.
($IN, $CFG) = @_;
print "Content-Type: text/html\n\n";
print "\$CFG: " . GT::Dumper::Dumper(\$CFG) . "<br>\n\n";
}
This prints the $CFG correctly, but I still would like to have the globals exported to my module's namespace.
Any idea how to reach this?
Best regards,
Webmaster33
Paid Support from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
I had to pass the $IN, $CFG, $GLOBALS, $USER global variables to the called sub, which is not really logical...
Global:
Code:
'menu_left' => 'sub { use Links::test;
Links::test::menu_template($IN, $CFG, $GLOBALS, $USER);
use GT::Dumper;
print "Content-Type: text/html\n\n";
print "\$CFG: " . GT::Dumper::Dumper(\$CFG) . "<br>\n\n";
}',
Links/test.pm:
Code:
package Links::test; # ==================================================================
use strict;
use vars qw/$GRAND_TOTAL $IN $CFG/;
use GT::Dumper;
sub menu_template {
# --------------------------------------------------------
# This routine determines how the rate failure page will look like.
($IN, $CFG) = @_;
print "Content-Type: text/html\n\n";
print "\$CFG: " . GT::Dumper::Dumper(\$CFG) . "<br>\n\n";
}
This prints the $CFG correctly, but I still would like to have the globals exported to my module's namespace.
Any idea how to reach this?
Best regards,
Webmaster33
Paid Support from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...