[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ic] variables


On Thu, 28 Jul 2005, JT Justman wrote:

Okay this should be easy, but I don't know enough about Interchange or Perl.
I'm just trying to make a basic variable that I can put into some html code,
this is what I'm trying to do:

[perl]
$site = "icdevgroup";
return $site;
[/perl]

<html>
<a href="www.$site.org">ICDEVGROUP.ORG</a>
</html>

I can't get this to work, anyone have any idea on how I should go about
this. Sorry for the basic question.

Thanks,
Brian

Hi, Brian. Maybe I can help you get on the right track.

Variables that you define within a [perl] tag only exist within that
tag.

That's actually not true ... variables not otherwise scoped are auto-created package variables visible throughout the page. This works fine:

[calcn]
    $site = "icdevgroup";
    return;
[/calcn]

<a href="http://www.[calcn] $site [/calcn].org">ICDEVGROUP.ORG</a>

I'm not recommending this technique for this scenario, but it does work and occasionally has its uses.

Jon

--
Jon Jensen
End Point Corporation
http://www.endpoint.com/
_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.