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

[cgiapp] runmode return scalar reference ?


hi,

poking through C::A src code and i noticed that one can return a scalar reference as output from a
runmode. as indicated by the followying lines from run subroutine.

# Support scalar-ref for body return
my $bodyref = (ref($body) eq 'SCALAR') ? $body : \$body;
....
# Build up total output
my $output  = $headers.$$bodyref;
.....
return $output;

C::A doc doesn't mention it and i have never seen ppl doing stuff like 

sub my_runmode {
    return \$tt->process(...);
}

but it seems to be a good thing to do,especially in mod_perl. my question would be.. is this a
well-known behaviour?

thanks,

James.





 
____________________________________________________________________________________
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


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