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

Re: [ic] How to include HTTP GET response in an IC page


On 07/26/2006 09:55 AM, DB wrote:
The tag works if I use it like this:
[get-url "http://example.com/mypage.xml";]

...However if I try

[calcn]
	my $page = $Tag->get_url('http://www.example.com/mypage.xml');
	$page =~ m!<string>(.+?)</string>!;
	$1;
[/calcn]

then all I see is 0

Try it with just the first line in the [calcn] (without the regexp and the $1). That will tell you if it's the get_url that's failing or the regexp.

I tried escaping the / using

You only have to escape the / if the regexp is bounded by /. That's why I used ! to bound the regexp.

Can anyone help me figure out what's wrong ?

You may not be able to run it from the calc block, try this:

[tmp result][get_url http://www.example.com/mypage.xml][/tmp]
[calcn]
	$Scratch->{result} =~ m!<string>(.+?)</string>!;
	$1;
[/calcn]

Peter
_______________________________________________
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.