my $filename = "testfile.txt"; { open FH, "<$filename" or ( open FH, ">$filename" and close FH and redo ) or die "Bleah!\n$!"; }
There's more than one way to do it. ;)
Dave
In reply to Re: File opening/creating
by davido
in thread File opening/creating
by kokoko12000
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |