in reply to perl handle and common variable

I tried and seems OK, so why we need the file handle?

Because you didn't read the documentation for open or perlintro?