That would work if I was writing a script using a plan.  However what I do
right now is just add one function at a time, going back to improve sections
of code whenever I figure out a better way of doing things.  It's a terrible
way to code, I know, but I never seem to be able to wait long enough to
sketch out a plan and it works for the most part.  Most of the time when I
really want to differentiate between print lines, I just put some nonsense
in there like 'print "Grrr: $variable\n";  so I know that's the actual line.
I haven't gotten past the one program stage yet.  I will file that away for
when I start writing my code libraries.

-Sarah (not a hacker, just a hack programmer)

-----Original Message-----
From: Chas Owens [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 13, 2002 10:19 AM
To: Kirby_Sarah
Cc: '[EMAIL PROTECTED]'
Subject: RE: How could this happen?


Whereas there is nothing you can do about being brainfried, there are
things you can do to help minimize mistakes like this one.  The first is
to always attach the line number and filename (and possibly process id)
to any debug messages (or for that matter any log messages) you send. 
You can do this yourself like this

print "DEBUG on line", __LINE__, " of file ", __FILE__, ":debug
message\n";

or you can just use the warn function to do your debug printing for you

warn("Debug message");

Make sure not to end the message with a "\n" since that prevents warn
from tacking the line number and file name onto the output.

It may also be important (in the case of log files) to note the version
of the code you are running.  To my knowledge there is no standard way
of marking the version of a script, but I have found that a global named
$VERSION is often used for this purpose.

On Mon, 2002-08-12 at 19:09, Kirby_Sarah wrote:
> Nevermind, my brain is fried. Duh, a second print statement somewhere.  I
> wish there were a RTFM for life.  Time to toss in the towel and live to
> program another day.
> 
> Thanks again for the patience.
> 
> -Sarah
> 
> -----Original Message-----
> From: Kirby_Sarah [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 12, 2002 6:56 PM
> To: '[EMAIL PROTECTED]'
> Subject: How could this happen?
> 
> 
> 
> This is really weird.  
> 
> I've been trying to figure out why the value of a scalar changes when I
send
> it to a subroutine, so I tried assigning the value within the subroutine
to
> see if it was getting the value some other way, and this is what I got: 
> 
> Code:
> 
>       $banana = "3.1.2.3.3.5.B.06";
>       print $banana."\n";
> 
> Output:
> 
> 3.1.2.3.3.5.B.06
> 3.1.2.3.3.5.B.06
> 3.1.4.3.3.5.B.04 
> 3.1.2.3.3.5.B.06
> 3.1.2.3.3.5.B.06
> 
> Now, how the heck did that alternative value sneak in there?  It is a
valid
> value for this scalar, but not the one I expected.
> 
> -Sarah
> 
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
-- 
Today is Setting Orange the 6th day of Bureaucracy in the YOLD 3168
This statement is false.

Missile Address: 33:48:3.521N  84:23:34.786W


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to