Changeset 16153 for docs/Perl6/Spec

Show
Ignore:
Timestamp:
05/01/07 18:46:51 (19 months ago)
Author:
lwall
Message:

print and say default to $*DEFOUT.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • docs/Perl6/Spec/IO.pod

    r15657 r16153  
    1212 Contributions: Mark Stosberg <mark@summersault.com> 
    1313 Date:          12 Sep 2006 
    14  Last Modified: 8 Feb 2007 
    15  Version:       16 
     14 Last Modified: 1 May 2007 
     15 Version:       17 
    1616 
    1717This is a draft document. Many of these functions will work as in Perl 5, 
     
    299299=item print LIST 
    300300 
     301=item .print(FILEHANDLE) 
     302 
    301303=item .print 
    302304 
     
    307309more complicated than a variable should be put into parentheses. 
    308310 
    309 If FILEHANDLE is omitted, prints to standard output. 
    310 The form with leading dot prints C<$_> to standard output. 
     311If FILEHANDLE is omitted, prints to C<$*DEFOUT>, which is aliased to C<$*OUT> 
     312when the program starts but may be temporarily or permanently rebound to 
     313some other file handle.  The form with leading dot prints C<$_> to C<$*DEFOUT> 
     314unless an explicit filehandle is supplied. 
     315 
    311316It is a compiler error to use a bare C<print> without arguments. 
    312317(However, it's fine if you have an explicit argument list that evaluates to 
     
    317322properties to change line endings. 
    318323 
    319 =item printf 
     324=item say FILEHANDLE: LIST 
     325 
     326=item FILEHANDLE.say(LIST) 
     327 
     328=item FILEHANDLE.say: LIST 
     329 
     330=item say LIST 
     331 
     332=item .say(FILEHANDLE) 
    320333 
    321334=item say 
    322335 
    323 This is a version of print() that auto-appends a newline: 
     336This is identical to print() except that it auto-appends a newline after 
     337the final argument. 
    324338 
    325339    Was:    print "Hello, world!\n"; 
     
    328342As with C<print>, it is a compiler error to use a bare C<say> without 
    329343arguments. 
     344 
     345=item printf(FORMAT, LIST) 
     346 
     347=item .printf(FORMAT, LIST) 
     348 
     349The function form works as in Perl 5.  The method form works on 
     350filehandle objects, not formats. 
    330351 
    331352=back