in reply to Can't get text to print

Nothing is printed? No stars at all?

That's the complete and tested script?

update
Your open is wrong considered bad practice, the < MODE is missing.

Cheers Rolf

(addicted to the Perl Programming Language and ☆☆☆☆ :)

update

updated update :)

Replies are listed 'Best First'.
Re^2: Can't get text to print
by vinoth.ree (Monsignor) on Oct 20, 2014 at 10:50 UTC

    I hope, If the mode is missing by default the file takes the default mode that is "<" (read only) mode.


    All is well

      from the linked documentation:

      "If MODE is < or nothing, the file is opened for input."

      Update: Intended as response to pre-update version of Re: Can't get text to print and misplaced. Mea culpa. </update>

      From http://perldoc.perl.org/functions/open.html (5.20)

      If three (or more) arguments are specified, the open mode (including optional encoding) in the second argument are distinct from the filename in the third. If MODE is < or nothing, the file is opened for input.

      i.e., opened for reading. And also:

      In the one- and two-argument forms of the call (emphasis supplied) ... (y)ou can--but shouldn't--omit the mode in these forms when that mode is < .


      check Ln42!