in reply to File handling basics

You have to add directory path to The name when opennig The file.
See readdir

Replies are listed 'Best First'.
Re^2: File handling basics
by ElectroRed (Initiate) on Jul 17, 2015 at 10:22 UTC
    Thanks man. It worked. Now I want to read every line. How I do it?

      If you are successfully opened the files, then your code,should be working.

      open (F, $file) or die "cannot open file"; while (<F>){ print $_; } close F;

      All is well. I learn by answering your questions...
        Yeah. It's working. But  print $_; is printing whole text at a time. I want read every line. store it as an array and process.