#use strict; use warnings; use Data::Dumper; use Win32API::File 0.08 qw( :ALL ); my $testfile = "test.xml"; print "file exists\n" if -e $testfile; my $hObject = createFile( $testfile, 'rw k e' ); unless ( $hObject ) { die "error creating handle: $^E\n"; } print Dumper( $hObject); my $fh; OsFHandleOpen( FHTEST, $hObject, 'rw' ) or die "OsFHandleOpen: $^E\n"; print FHTEST "test"; print "finished\n"; __DATA__ output: Name "main::FHTEST" used only once: possible typo at D:\Users\lock\t2.pl line 18. file exists $VAR1 = 116; finished