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

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'

Replies are listed 'Best First'.
Re^4: How to read the file from stdin using perl?
by gopikavi (Initiate) on May 09, 2017 at 10:02 UTC
    But this wont help my query

      But you need to do some work yourself


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