[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] $\ undefined?



At 11:07 AM 3/3/98, Stephan Somogyi wrote:
>I assumed that setting $\ to "\x0a" and then printing each line to a
>filehandle would result in the desired effect, but it didn't; for some
>inexplicable reason I wound up with DOS linebreaks instead.

Hm.  That works, it really does.  I think you are mistaken.

>So I tried the following and got a baffling response when running it
>from within the MacPerl 5.1.9r4 app:
>
>        #!perl -w
>        use strict;
>
>        print ord($\);
>
>        # Use of uninitialized value.
>        File 'Untitled'; Line 4
>
>Is $\ not automatically pre-initialized? If not, and since just setting
>it to \x0a doesn't seem to be resulting in the desired effect, how do I
>define output linebreaks to be \x0a instead of \x0d\x0a?

No, $\ is undefined unless you give it a value.

--
Chris Nandor               pudge@pobox.com           http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==                    MacPerl: Power and Ease                     ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch