Mega Code Archive

 
Categories / Perl / File
 

Using write function to write string to a file

use IO::File; $filehandle = new IO::File; $filehandle->open(">hello.txt") or die "Cannot open hello.txt"; $text = "Hello!"; $filehandle->write($text, length($text)); $filehandle->close;