[EMAIL PROTECTED] writes:
>    Hello,
> 
>  I have a wish for Perl 6. I would like if the open-funktion
>  opens only a file if it doesn't exist.
>  Of course, I can first test if the file exist.
> 
>   if (-e $filename)
>   { print "file already exists!"; }
>   else
>   { open (FH, ">$filename") }
> 
>  My suggestion is to have a character for the open-mode-character that
>  indicate that the file should not already exist.

Like O_EXCL, yeah, that'd be nice.

But in Perl 6, you don't have to specify things like that through the
mode string: you can specify them through named parameters:

    my $fh = open ">$filename" :excl;

Luke

Reply via email to