you can understand in this way:
The file name here is where you save your work.
( you use close() to save your file )
So it doesn't matter the file has data inside or not.
ONLY the data in the handle will write to your file.
ie. This ">" is an overwrite, if you are opening an existed file
So, since you are open a file for WRITE, so it couldn't READ, while you read
nothing, so you write nothing. End up, you harvest an empty file
For Perl and bash (one of the linux shells) ">" is the standard way to say: "redirect this stuff to the named file and overwrite (delete) its previous contents with this".
And ">>" is the standard way to say: "add this material after the last line of the file (updating this contents) but preserve any previous contents that you found in this file". ">>" works also in perl and in bash
If the file is missing both do basically the same. Create a "box" (the file) and dump all the "bricks" into this box.
So, let's see what are you doing:
open (HAN , ">" ,'D:\RAM\perl\test') or die "$!";
# DELETE the contents of this file and open it
# nothing here to mach, the file is empty, no survivor "e" chars
print HAN ;
# thus, nothing is changed and nothing left to print to the file