-----------------------------------------
Craig Moynes
Internship Student
netCC Development
IBM Global Services, Canada
Tel: (905) 316-3486
[EMAIL PROTECTED]



                                                                                       
                            
                    "Stephen P.                                                        
                            
                    Potter"              To:     Craig Moynes/Markham/IBM@IBMCA        
                            
                    <[EMAIL PROTECTED]       cc:     [EMAIL PROTECTED], 
[EMAIL PROTECTED]                            
                    i.org>               Subject:     Re: Strange chop behaviour       
                            
                                                                                       
                            
                    05/01/01 01:39                                                     
                            
                    PM                                                                 
                            
                                                                                       
                            
                                                                                       
                            




|Always check the return status of your opens.
I did not check the return status because it was a sample program and was
only for demonstration in here.

|| while ( !eof(ERR) )
||         $in = <ERR>;

|You are mixing things here you don't want to mix.  This should just be:

|while ($in = <ERR>) {

|You *can* mix these, but there is no real reason to.  Especially not in
|your sample code.

Why don't I want to mix these ?

I use chop when I know that each line will terminate with a newline
character.  If I were to use chomp I would require checks to make sure the
record seperator was set to what I expected.


|What version are you using.  This is not the output I get if I use the
|first two lines as the input file (scp_err).  My output looks like what
I'd
|expect:

I am using AIX.  It was placing an additional control character on the end
of the first line.  This has neven happened to me before reading the output
of commands from a file so I suspect it has something to do with scp.  But
I could be wrong.  I imagine the strange character was causing havoc with
print statements.


Thanks for your suggestions.


Reply via email to