At 10.39 +0300 01-05-16, Ariel Scolnicov wrote:
>How does the printing happen in the correct order?  I mean, if I said
>
>     my $x = "Post order: &show($root, $post)\n";
>     print $x;
>
>then (I hope) we're agreed printing would happen in the *wrong* order
>(first the output of show($root, $post), then the value of $x (and $x
>eq "Post order: \n").

Yes, it would, as would the Perl 5 equivalent:

sub show {print "6"}
print "Perl ${show()}\n";

(That prints "6Perl", not "Perl 6".)

If you want to call the subroutine in the middle of the string, you 
should make it _return_ something, not print it.

Cajo
-- 
Carl Johan Berglund, [EMAIL PROTECTED], 0708-136 236
Adverb Information, http://www.adverb.se, 08-555 788 80

Reply via email to