develooper Front page | perl.perl6.users | Postings from July 2011

Form of I/O statements

Thread Next
From:
Parrot Raiser
Date:
July 12, 2011 00:36
Subject:
Form of I/O statements
Message ID:
CACwLAp99a=jGKcHLzjgJt+amC4_kzhtn3MXL5gsiRC+WuYtX_w@mail.gmail.com
To print the contents of $skeleton to a file whose name is in
$new_file, what should the code look like? I cannot find an example in
the tests.

Printing to STDOUT (by default) works; every attempt to write to a
named file has failed. Is this another Not Yet Implemented?

Executing this code:

my $skeleton = "bones\n";
my $new_file = "x_file";
my $handle   = open($new_file, :w);
$handle.print $skeleton;

produces

===SORRY!===
Confused at line 4, near "$handle.pr"

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About