Gossamer Forum
Quote Reply
parsing values
Hi,

I am trying to include the result of a currency conversion via Pagebuilder - everything is going well until I have to pass the values.. :-(


I use:
Code:
<%LWP::Simple::get('http://www.oanda.com/converter/classic?&user=USERNAME&level=release&date_fmt=normal&value=$value&exch=$exch&expr=$expr&ConvertNow&date=$exdate')%>

I can pass the values in the URL so they are available in the template - but can't insert them in the <%LWP...

Any ideas on how to get the values into the URL?

Thanks in advance

Klaus

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] parsing values In reply to
I don't think you can do it like that. The parser will assume you are passing a normal string into LWP::Simple::get() and so none of the variables will interpolate.

You'll need to use a global. Something like:

Code:
sub {
my $url = "http://www.oanda.com/converter/classic?&user=USERNAME&level=release&date_fmt=normal&value=%s&exch=%s&expr=%s&ConvertNow&date=%s";

require LWP::Simple;
return LWP::Simple::get(sprintf($url, @_));
}

Then for the tag...

Code:
<%your_global($value, $exch, $expr, $exdate)%>
Quote Reply
Re: [Paul] parsing values In reply to
Thanks Paul - that did the trick :-)

Klaus

http://www.ameinfo.com