You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Eric-Olivier Le Bigot <Er...@spectro.jussieu.fr> on 2002/04/01 19:27:20 UTC

Print OUT in sub [2.0b7]: bug?


  Hello,

I get a strange behavior when I use a sub that does not contain any [++]
block:

-------------------------------------------------------------------------
[$ sub definedSub $]
[#+ 'hello' +#]
[- print OUT " IN ROUTINE\n"; -]
[$ endsub $]
Here is the output of the routine 'definedSub':
[- definedSub; -]
-------------------------------------------------------------------------

produces nothing.

But if I uncomment the 'hello' line, then it works as I expected and
produces:

-------------------------------------------------------------------------
Here is the output of the routine 'definedSub': hello IN ROUTINE
-------------------------------------------------------------------------

  Is it a normal behavior?

  EOL

--
Eric-Olivier LE BIGOT (EOL)
------o-o----------------------------------------------------o-o------
        National Institute of Standards and Technology (NIST)
        100 Bureau Drive, Stop 8401
        Gaithersburg, MD  20899-8401
        United States of America
------o-o----------------------------------------------------o-o------
off.: (301)-975-4397                               fax: (301)-975-4578
home: (301)-633-3160                         e-mail: elebigot@nist.gov




---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Print OUT in sub [2.0b7]: bug?

Posted by Gerald Richter <ri...@ecos.de>.
 Hello,
>
> I get a strange behavior when I use a sub that does not contain any [++]
> block:
>
> -------------------------------------------------------------------------
> [$ sub definedSub $]
> [#+ 'hello' +#]
> [- print OUT " IN ROUTINE\n"; -]
> [$ endsub $]
> Here is the output of the routine 'definedSub':
> [- definedSub; -]
> -------------------------------------------------------------------------
>
> produces nothing.
>
> But if I uncomment the 'hello' line, then it works as I expected and
> produces:

I works as soon as there is any output (also literal text works) before the
print OUT inside the sub. This is a bug of Embperl, but isn't so easy to
fix, so I put it on the TODO list for now

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org