DJRik has asked for the wisdom of the Perl Monks concerning the following question:

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

Replies are listed 'Best First'.
Re: else statement
by FunkyMonk (Bishop) on Aug 16, 2007 at 14:15 UTC
    Can you enclose your code in code tags (<code> ... </code>) please.

    There's more than two problems, I'm afraid.

    • There's no semicolon at the end of close.
    • if ($child => 0) doesn't make sense. Did you mean >=?
    • kill => $child; doesn't make sense either. Did you mean kill $child?
    • You're missing a closing brace from your BEGIN block.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: else statement
by shoness (Friar) on Aug 16, 2007 at 15:52 UTC
    You're still missing a semicolon...
    if ( my $child >= 0 ) { kill $child; } else { close LOGFILE; undef $CONN; }
Re: else statement
by robot_tourist (Hermit) on Aug 17, 2007 at 15:34 UTC

    From your supplied code fragment, I think the unexpected end of file is because there is no EOL to tell the program to stop printing before it reaches the end of the file.

    Here-docs are discussed way down (search for <<EOF) in the perlop perldoc page here.

    How can you feel when you're made of steel? I am made of steel. I am the Robot Tourist.
    Robot Tourist, by Ten Benson