[ic] problems printing with perl

Ed LaFrance interchange-users@icdevgroup.org
Thu Aug 29 16:06:01 2002


At 03:41 PM 08/29/2002 -0400, you wrote:
>Hey everyone-
>
>I'm trying to add some perl into one of the admin interface pages, except 
>it's not printing to the page!
>the following doesn't work:
>
>[perl]
>print("test");
>[/perl]
>
>while the following does:
>[perl]
>return "test";
>[/perl]
>
>of course the latter ends my perl run, as well.
>
>does anyone have any idea why in the world this is happening?
>

print uses STDOUT, which is closed by Interchange by default. When echoing 
output/results with perl and Interchange, you'll want to store output in a 
variable (or in an Interchange data structure like $Scratch) and then 
return it on the last line:

[perl]
         my $output = 'Something';
         return $output;
[/perl]

- Ed L.


===============================================================
Increase profits from your Interchange store...
http://www.newmediaems.com/cgi-bin/nm/software_fus.html
===============================================================
New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          eCommerce | Consulting | Hosting
Placerville, CA  95667         edl@newmediaems.com
(530) 622-9421                 http://www.newmediaems.com
(866) 519-4680 Toll-Free       (530) 622-9426 Fax
===============================================================