Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion (Re: The strings design document)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jeff Clites  
View profile  
 More options Apr 30 2004, 11:38 am
Newsgroups: perl.perl6.internals
From: jcli...@mac.com (Jeff Clites)
Date: Fri, 30 Apr 2004 08:38:18 -0700
Local: Fri, Apr 30 2004 11:38 am
Subject: Re: [Q2] (Re: The strings design document)
On Apr 28, 2004, at 5:01 AM, Dan Sugalski wrote:

> At 3:17 AM -0700 4/28/04, Jeff Clites wrote:
>> On Apr 23, 2004, at 2:43 PM, Dan Sugalski wrote:

>>> For example, consider the following:

>>>   use Unicode;
>>>   open FOO, "foo.txt", :charset(latin-3);
>>>   open BAR, "bar.txt", :charset(big5);
>>>   $filehandle = 0;
>>>   while (<>) {
>>>     if ($filehandle++) {
>>>       print FOO $_;
>>>     } else {
>>>       print BAR $_;
>>>     }
>>>     $filehadle %= 2;
>>>   }

>> What's the input record separator here?

> The filehandle default, which depends on the encoding and character
> set of the input data, or so Larry's told me.

So the nature of my question here is that I assume the input record
separator will be set as a string, with something similar to: $/ = "\n"
or $/ = "----" or whatever.

If that's the case, presumably the user won't have to keep resetting it
as they open files stored in a different encodings, if (from their
point of view) they're using the same separator--they'll just set it
once. But having it defined as a string would seem to imply that you'll
have to transcode as you read to a common representation, in order to
find the line endings. That is, if $/ was assigned "latin-1" when it
was created, then you'll be forced to transcode to UTF-8 (or something)
as you read, right?

JEff


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.