Hi,
I am trying to create a file but its not working. No file is created.
Code:
#!C:/Perl64/bin/perl.exe
my $existringdir = 'dir1';
mkdir $existringdir unless -d $existingdir; # Check if dir exists. If not create it.


open (MYFILE, '<$existringdir/data.txt');
print MYFILE "Bob\n";
 close (MYFILE);
The running process is shown below
D:\Zulfi\PERL MAIN FOLDER>perl file1.pl

D:\Zulfi\PERL MAIN FOLDER>dir dir1
Volume in drive D has no label.
Volume Serial Number is 8E4F-05BE

Directory of D:\Zulfi\PERL MAIN FOLDER\dir1

11/09/2013 12:53 PM <DIR> .
11/09/2013 12:53 PM <DIR> ..
11/09/2013 12:59 PM 0 file.txt
1 File(s) 0 bytes
2 Dir(s) 524,336,050,176 bytes free

D:\Zulfi\PERL MAIN FOLDER>type file1.pl
#!C:/Perl64/bin/perl.exe
my $existringdir = 'dir1';
mkdir $existringdir unless -d $existingdir; # Check if dir exists. If not create
it.


open (MYFILE, '<$existringdir/data.txt');
print MYFILE "Bob\n";
close (MYFILE);

D:\Zulfi\PERL MAIN FOLDER>
Plz guide me.

Zulfi.