Nicpetbio23! has asked for the wisdom of the Perl Monks concerning the following question:
Why doesn't this read my file into the array properly? How can I fix it
-----------------------------------------------------------------------
print "Please enter id file\n"; my $file = <STDIN>; open (my $handle, '<',$file); chomp (my @lines = <$handle>); close $handle;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: open fails to open file when filename read from STDIN
by LanX (Saint) on Jul 09, 2017 at 17:31 UTC | |
Re: open fails to open file when filename read from STDIN
by hippo (Archbishop) on Jul 09, 2017 at 21:04 UTC | |
by KurtZ (Friar) on Jul 09, 2017 at 23:14 UTC | |
Re: open fails to open file when filename read from STDIN
by Anonymous Monk on Jul 09, 2017 at 17:29 UTC | |
Re: open fails to open file when filename read from STDIN
by karlgoethebier (Abbot) on Jul 10, 2017 at 09:30 UTC |