ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl6-internals
perl6-internals
Past-pm printing the return value of the main routine
by Allison Randal other posts by this author
Dec 12 2006 3:45PM messages near this date
[perl #41082] [PATCH] Cygwin: conflicting types for _LIB_VERSION | Re: Past-pm printing the return value of the main routine
In Punie or Perl 6, when I execute a simple statement:

   print "2";

It prints "21". This is because a) the return value of a successful 
print is "1", b) the main routine is returning the value of the last 
statement (note this is correct for Perl, but isn't correct for all 
languages), and c) HLLCompiler is printing out the return value of the 
eval'd code here:

     376   save_output_1:
     377     print ofh, result
     378     close ofh

Commenting out line 377 gives the correct behavior of just printing "2". 
My question is, why is HLL compiler printing out the return value of the 
main routine?

Allison

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved