[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] realperl
Haha! I found it!
For one, minivend uses strict vars... so you must declare all
your variables...
ie my($recrd);
otherwise it will fail... also...
while ($recrd.=<CODE>);
does not work for me... however
while(<DATA>) {$recrd .= $_;}
does. try this:
#!/usr/bin/perl
my $recrd;
if (!open(CODE,"/catalogs/crs/cgi/hithere.pl")) {
return "Problem opening hithere.pl: $!";
}
while (<CODE>) {$recrd .= $_};
return $recrd;
now... I realize that may be annoying... and there is a way
to turn off stricts that you could put into realperl... but
I don't know it off the top of my head.
On Tue, Nov 23, 1999 at 09:48:29PM +0200, Albert A. Modderkolk wrote:
> ****** message to minivend-users from "Albert A. Modderkolk" <mdd@advwebsys.com> ******
>
> I can't get realperl to work...
>
> This is what I have defined in minivend.cfg:
>
> UserTag realperl HasEndTag
> UserTag realperl CanNest
> UserTag realperl Interpolate
> UserTag realperl Routine <<EOF
> sub {
> my $str = eval {eval $_[0] or die;};
> if ($@) {return "<PRE>$@</PRE>";}
> return $str;
> }
> EOF
>
> In a page I have defined:
>
> [realperl]
> [include /catalogs/crs/cgi/hi-there.pl]
> [/realperl]
>
> hi-there.pl contains:
>
> #!/usr/bin/perl
> if (!open(CODE,"/catalogs/crs/cgi/hithere.pl")) {
> return "Problem opening hithere.pl: $!";
> }
> while ($recrd.=<CODE>);
> return $recrd;
>
> Originally hi-there.pl contained a return('Hi there'); and that worked.
> Execution of this code generates an eval error 1(?) on line 2.
> I have had a response on previous queries to use GlobalSubs but as far
> as I understand that I need to define the code in the minivend.cfg but
> that is not very flexible...
>
> What am I doing wrong?
> Tia, Albert
>
>
>
>
> -
> To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
> email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
> Archive of past messages: http://www.minivend.com/minivend/minivend-list
--
Anthony Ball ant@maine.com
MaineStreet Communications, Inc 208 Portland Road, Gray, ME 04039
tel:1.207.657.5078 fax:1.207.657.5048 http://www.maine.com/
- References:
- realperl
- From: "Albert A. Modderkolk" <mdd@advwebsys.com>