[EMAIL PROTECTED] wrote:

If the enduser programmer want to force it into scalar context they can:
print scalar fooyou();

I knew about that but the problem is most of the users (incuding myself ;p) will want to print it without the same $header info twice and don't want to have a bunch of print scalar whatevr();


If there is no way to tell if fooyou() was called in 'print context' then we'll just use scalar, but I was hoping there was a way to tell...

like this would be super nice if such a beast as wantprint existed...

return "$header$data1$data2" if wantprint;
return ("$header$data1","$header$data2") if wantarray;
return "$header$data1$data2";

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to