.say for "share.txt".IO.lines.unique;
my %words;
for slurp.comb(/\w+/).map(*.lc) -> $word {
%words{$word}++;
}
say %words.kv;
for dir('.', test => *) -> $file {
rename $file, $file.lc if $file.f;
}
my $f = open "foo",:w;
$f.print(time);
$f.close;
unlink "foo";
my $f = open "foo",:w;
$f.print(time);
$f.close;
my $io = IO::Path.new("foo");
$io.copy("foo2");
unlink ("foo2");
$io.rename("foo2");
unlink ("foo2");
my $something;
repeat {
$something = prompt 'enter something: ';
say $something;
} while $something;
my $filename = shift @*ARGS;
for $filename.IO.lines -> $line {
say $line;
}
for lines() {
.say;
}
my $filename = shift(@*ARGS);
my $fh = open $filename, :a;
my $something;
repeat {
$something = prompt 'enter something: ';
$fh.say($something);
} while $something;
my $total = 0;
for @files -> $filename {
$total += lines($filename.IO).grep(
{ $_ !~~ /<&insigline>/ }
).elems;
CATCH {
when X::IO {
note "Couldn't read $filename";
} }
}
say $total;