in reply to why is the content of frame.txt file not displaying

Most of the problems you've encountered regarding this project were well answered in the thread begun with your previous post, Problem printing contents of file.

So, please step back and review the responses previously provided - as a courtesy to PerlMonks... and for the wisdom you'll perhaps be able to absorb with somewhat more diligent effort.

By way of reminder of the information in some of those replies, note that when this code is checked (ie, perl -c scriptname) without "use strict; use warnings" the output is:

perl -c 693525.pl [Mon Jun 23 21:24:06 2008] 693525.pl: Unquoted string "step" may clash + with future reserved word at 693525.pl line 12. 693525.pl syntax OK

and with strict and warnings, this ensues:

~$ perl -c 693525.pl Content-type: text/html <h1>Software error:</h1> <pre>Bareword &quot;step&quot; not allowed while &quot;strict subs&quo +t; in use at 693525.pl line 12. 693525.pl had compilation errors. </pre> <p> For help, please send mail to this site's webmaster, giving this error + message and the time and date of the error. </p> [Mon Jun 23 21:24:48 2008] 693525.pl: Bareword "step" not allowed whil +e "strict subs" in use at 693525.pl line 12. [Mon Jun 23 21:24:48 2008] 693525.pl: 693525.pl had compilation errors +.

Please consider adopting a personal policy of using strict and warnings until you are far more expert with perl... and -- if you absolutely must and know why you're doing so-- turn off the relevant strictures. Again, the previous thread offers several notes on this, the essence of which is that you should consider "strict" and "warnings" tools to help you write working code; not as some kind of punishment or penalty.

Replies are listed 'Best First'.
Re^2: why is the content of frame.txt file not displaying
by ketaki (Acolyte) on Jun 25, 2008 at 07:53 UTC
    my computer is behaving nuts!... see what its doing.. i prints the file frame.txt for the code:
    open(fhrame,$filename) or die "Couldnt open '$filename': $!"; while(<fhrame>) { print "$_\n"; }
    but it refuses to print the file for the code:
    open(frame,$filename) or die "Couldnt open '$filename': $!"; while(<frame>) { print "$_\n"; }
    the diffrence in the 2 sets of code is fhrame is replaced by frame. thats all. Can anyone ever give a logical explanation to this weird phenomena? or it seems there could be some prob with the word frame. maybe its a keyword or something.. what say?
      Unlikely story.
      use strict;
      use warnings;
      use UPPERCASE for filehandles (thats the convention)
      make sure the file is not empty