in reply to Re: NET::SMTP
in thread Not hard-code text with NET::SMTP ?

that's the way I've done it now. It will be the only line in that file. I'm using:
open (PAGE, "<staging.log");
any ideas?

Replies are listed 'Best First'.
Re(3): NET::SMTP
by elbie (Curate) on Aug 11, 2003 at 15:58 UTC

    I suspect that staging.log is playing tricks on you, but having a blank line at the end of the file. You can always check if the contents of the current instance of $line is empty before you assign it to $newline.

    Something like this:

    if( $line =~ /^\s*$/ ) { $newline = "Blank line."; } else { $newline = $line; }

    Or, better yet, you could play around with debug mode and step through the program as it runs.

    elbieelbieelbie

Re: Re: Re: NET::SMTP
by sgifford (Prior) on Aug 11, 2003 at 16:28 UTC

    If you're sure that's the only line in the file, a simpler and perhaps less error-prone method is to use:

    $newline = join("",<PAGE>);
    which will read in all of the lines from the file and concatenate them into one string.

    In any case, printing out $newline as a debugging aid will probably help you track this problem down without sending a zillion messages.