anjaana78 has asked for the wisdom of the Perl Monks concerning the following question:

How do i create a file if its not present and write to that file.
  • Comment on how do i ceate a file if its not present

Replies are listed 'Best First'.
Re: how do i ceate a file if its not present
by azatoth (Curate) on May 16, 2001 at 19:45 UTC
    open FH (">>myfile.txt") || die "Could not open / create file : $!\n"; print FH;