in reply to Re: i am suppsed to do following. i am super new. can anyone help me?
in thread i am suppsed to do following. i am super new. can anyone help me?

adding the open and print statement
  • Comment on Re^2: i am suppsed to do following. i am super new. can anyone help me?

Replies are listed 'Best First'.
Re^3: i am suppsed to do following. i am super new. can anyone help me?
by davido (Cardinal) on Jan 28, 2016 at 02:45 UTC

    perlintro#Files-and-I/O has documentation on how to open a file for input, and how to read from a file. Your assignment also shows the example, "$line = <TEST-INPUT>;", which will work to read a line from the file with one exception: Filehandles, like other identifiers in Perl shouldn't have a hyphen in them. Remove that hyphen and it becomes a valid identifier for a filehandle. Just make sure that your open opens the filehandle first.

    perlintro#Basic-syntax-overview shows how print can be used to print a string literal. perlintro#Perl-variable-types shows how to print a variable, such as $line.


    Dave