Perl 6 Perl 6 today #44

Basic I/O

Use for and .lines to iterate over an IO object

my $fh = open('README', :r);
for $fh.lines -> $line {
    say $line;
}
$fh.close();

Note that .lines auto-chomps input

Copyright © 2009
http://www.pmichaud.com/2009/pres/