#!/usr/bin/perl use strict; use warnings; use CGI qw(:standard); use CGI::Carp 'fatalsToBrowser'; my $dir = "c:/inetpub/wwwroot/data"; print header('text/plain'); if ( open my $fh,'>',$dir.'/write.txt' ){ print "OK : write.txt created in $dir"; close $fh; } else { print "ERROR : No write permission to $dir" }