in reply to Re: working with files
in thread working with files

Dave, thanks for your reply
print $_;
is not printing anything in the screen. the problem with my script is, program hangs as if an endless loop, no output to the screen or output file.

Replies are listed 'Best First'.
Re^3: working with files
by davido (Cardinal) on Nov 02, 2005 at 09:14 UTC

    This is a problem:

    while(IN){

    It should be

    while( <IN> ) {

    If you had been using warnings you would have seen this message:

    Bareword found in conditional at yourscript.pl line xx. Name "main::IN" used only once: possible typo at yourscript.pl line xx +.

    And if you had been using strict, you would have seen this fatal message:

    Bareword "IN" not allowed while "strict subs" in use at yourscript.pl +line xx. Execution of yourscript.pl aborted due to compilation errors.

    It will really help you to keep on top of these hard to spot bugs if you remember to start every script off with:

    use strict; use warnings;

    Update: I believe someone already mentioned to you in an earlier thread that you should be using strictures and warnings. Strictures and warnings will cause Perl to complain when it encounters things that are probably bugs in your code (or at least bad practices). And all that noise is helpful in isolating and eliminating such bugs and bad practices.


    Dave