On 09/28/2017 09:45 PM, Brandon Allbery wrote:
On Fri, Sep 29, 2017 at 12:41 AM, ToddAndMargo <toddandma...@zoho.com <mailto:toddandma...@zoho.com>> wrote:

    Does perl 6 have an equivalent to bash's "-f" to
    see if a file exists?  Or is that a system call?


IO::Path's .f method. (Or .e to not require it to be a file, etc. as usual.)

     pyanfar Z$ 6 '".profile".IO.f.say'
     True

Hi Brandon,

How do I get this to give me a "False" instead of crashing
and wagging the finger at me?

$ perl6 -e 'say "eraseme.txt".IO.f;'
True

$ 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

Many thanks,
-T

Reply via email to