I am reading a file with
my @titles = @*ARGS.slurp;
and then just
I am very fond of such a quick way of reading a file instead of every time
dance of "$fh = open...; <$fh>"
a problem is - my file contains characters /[\x80-\xFF]/, and all that
characters get replaced with the space.
There is something with binmode, encoding, unicode, but I just want get
binary stream out of my file.
Is it possible with "slurp"?
pugs -we "@*ARGS.say" foobarfluffy
outputs foobarfluffy as expected, whereas
pugs -we "@*ARGS.say" -foobarfluffy
> Is it possible with "slurp"?
What you want should be something like
if Perl 6 is going to follow Perl6::Slurp according to Damian's CPAN
module. But it is not supported yet by Pugs, I think. Currently,
"slurp" accepts an only parameter (a filename or a handle). By now,
this seems to works:
Not so short, but at least it is there.