Rafael Garcia-Suarez wrote:

>Steve Hay wrote:
>  
>
>>Perhaps rather than making the test allow for the difference, the better 
>>solution might be to fix up $! under Borland to effectively chomp the 
>>trailing newline?
>>    
>>
>
>Consistency is good.
>
>  
>
>>Where is the code that sets up $! if I wanted to give that a try?
>>    
>>
>
>Look up C<case '!'> in mg.c.
>
Thanks.

I now have all tests OK with this patch:

==== //depot/perl/mg.c#349 - C:\p5p\bleadperl\mg.c ====
@@ -896,6 +896,12 @@
        errno = saveerrno;
        }
 #endif
+       {
+       STRLEN len = SvCUR(sv);
+       while (len > 0 && isSPACE(SvPVX(sv)[len-1]))
+           --len;
+       SvCUR_set(sv, len);
+       }
        SvNOK_on(sv);   /* what a wonderful hack! */
        break;
     case '<':

Is it worth pulling the "chomp" code out into a macro and using it for 
the $^E case too?

Is there a "chomp" or "trim" macro anywhere already?  I couldn't see 
one, but it seems like quite a common thing to want to do.


------------------------------------------------
Radan Computational Ltd.

The information contained in this message and any files transmitted with it are 
confidential and intended for the addressee(s) only.  If you have received this 
message in error or there are any problems, please notify the sender 
immediately.  The unauthorized use, disclosure, copying or alteration of this 
message is strictly forbidden.  Note that any views or opinions presented in 
this email are solely those of the author and do not necessarily represent 
those of Radan Computational Ltd.  The recipient(s) of this message should 
check it and any attached files for viruses: Radan Computational will accept no 
liability for any damage caused by any virus transmitted by this email.

Reply via email to