in reply to Re: How to read the file from stdin using perl?
in thread How to read the file from stdin using perl?

are you suggesting me to pass STDIN instead of filename.
  • Comment on Re^2: How to read the file from stdin using perl?

Replies are listed 'Best First'.
Re^3: How to read the file from stdin using perl?
by shmem (Chancellor) on May 09, 2017 at 09:53 UTC

    No. I am suggesting to read the filehandle STDIN as you do with your filehandle F - via the diamond operator "<>" or readline. No need to pass STDIN anywhere.

    $| = 1; # turn on autoflush print "Enter file name: "; my $answer = <STDIN>; chomp $answer; # remove newline char from answer print "file name is '$answer'\n";
    perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
      But this wont help my query

        But you need to do some work yourself


        Give a man a fish:  <%-{-{-{-<