Open for Writing : Open file « File « Perl
- Perl
- File
- Open file
Open for Writing
# Format: open(FILEHANDLE, ">FILENAME)";
#!/usr/bin/perl
$file="data.txt";
open(HANDOUT, ">$file") || die "Can't open newfile: $!\n";
print HANDOUT "hello world.\n";
print HANDOUT "hello world again.\n";
Related examples in the same category