in reply to Re: Cool way to parse Space Separated Value and CSV files
in thread Cool way to parse Space Separated Value and CSV files

How to take input from user rather than hard coding for this solution
  • Comment on Re^2: Cool way to parse Space Separated Value and CSV files

Replies are listed 'Best First'.
Re^3: Cool way to parse Space Separated Value and CSV files
by Corion (Patriarch) on May 21, 2018 at 07:35 UTC

    I assume that you want to run the program on a user-specified file instead of the hardcoded file?

    Command line parameters are available in the @ARGV array, see perlvar.

    You can read user input from STDIN, like my $filename = <STDIN>;

    Once you have the filename, modify the open statement to use a filename instead of opening a here-document.

    A reply falls below the community's threshold of quality. You may see it by logging in.