Skip to content

Latest commit

 

History

History
26 lines (16 loc) · 383 Bytes

File metadata and controls

26 lines (16 loc) · 383 Bytes

If it is okay to have a temporary copy of the entire file in memory:

spurt "output.txt", slurp "input.txt";

Otherwise, copying line-by line:

my $in = open "input.txt";
my $out = open "output.txt", :w;
for $in.lines -> $line {
    $out.say: $line;
}
$in.close;
$out.close;