I was just reading about this!
On 29 September 2017 at 14:53, ToddAndMargo <[email protected]> wrote:
>
> $ perl6 -e 'say "erasxeme.txt".IO.f;'
> Failed to find '/home/linuxutil/erasxeme.txt' while trying to do '.f'
> in block <unit> at -e line 1
>
When you do:
"erasxeme.txt".IO.f
It will fail (before the .f even) on the .IO call because "erasxeme.txt"
does not exist. perl6 will then throw an exception when you try to use the
value of that failed call.
So, you need to not "use" the value of the failed .IO call:
if not $f.IO.f { say "$f not found" }
--
Norman Gaywood, Computer Systems Officer
School of Science and Technology
University of New England
Armidale NSW 2351, Australia
[email protected] http://turing.une.edu.au/~ngaywood
Phone: +61 (0)2 6773 2412 Mobile: +61 (0)4 7862 0062
Please avoid sending me Word or Power Point attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html