Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [Alex] Passing hash to global in template?

Quote Reply
Re: [Alex] Passing hash to global in template? In reply to
I need a global to check if a plugin is installed or not, so decide to execute the tag in the template or not.
This is how I would like to do:
Code:
<%if check_plugin( 'foo' => '1', 'bar' => '2' )%>
<%Plugins::myplugin::function%><%endif%>

I also checked your code, and works fine:
Code:
<%mytag( foo => 1, bar => 2 )%>

and then in your global:

my %hash = @_;
use Data::Dumper;
print "<br>\n hash: " . Dumper(\%hash) . "<br>\n";
This works fine. Hash content will be: { 'foo' => '1', 'bar' => '2' }.

But if I place an 'if' statement before the global call, then will not print the hash as earlier Frown:
Code:
<%if mytag( foo => 1, bar => 2 )%>
Hash content will be: { 'HASH(0x21cd8c8)' => undef }.

Why? What happens if I use 'if' statement? Does is pass arguments other way?

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...
Subject Author Views Date
Thread Passing hash to global in template? ryel01 3186 Jun 15, 2002, 2:02 PM
Thread Re: [ryel01] Passing hash to global in template?
Alex 3074 Jun 17, 2002, 10:55 AM
Thread Re: [Alex] Passing hash to global in template?
webmaster33 3018 Dec 13, 2002, 2:22 AM
Thread Re: [webmaster33] Passing hash to global in template?
Jagerman 2984 Dec 13, 2002, 3:21 AM
Post Re: [Jagerman] Passing hash to global in template?
webmaster33 3015 Dec 13, 2002, 3:44 AM
Post Re: [Jagerman] Passing hash to global in template?
webmaster33 2981 Dec 13, 2002, 6:49 AM