Thursday, November 24, 2022

Create a file and write something to it using perl

 use strict;

use warnings;

$|=1;

sub main{

my $output='output.txt';

open(OUTPUT,'>'.$output)or die "Can't create $output.\n";

print OUTPUT "Hello\n";

close(OUTPUT);

}

main();


No comments:

Post a Comment