Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: NET::SMTP

by Bush Dr (Initiate)
on Aug 11, 2003 at 15:51 UTC ( [id://282909]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://282909]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-20 04:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found