develooper Front page | perl.vmsperl | Postings from March 2012

Re: what was VMS do here? (was [perl #79960] Setting $/ to read fixedrecords can corrupt valid UTF-8 input)

Thread Previous | Thread Next
From:
Craig A. Berry
Date:
March 2, 2012 07:36
Subject:
Re: what was VMS do here? (was [perl #79960] Setting $/ to read fixedrecords can corrupt valid UTF-8 input)
Message ID:
455FA576-9C6A-43F0-B658-558B74A3E292@mac.com

On Mar 2, 2012, at 1:51 AM, Johan Vromans wrote:

> Nicholas Clark <nick@ccl4.org> writes:
> 
>> So I'd like to know, if a programmer on VMS sets $/ to read records, but on
>> a file handle marked with :utf8, what do they want?
>> 
>> (and if the answer is "their head examining", that's actually useful, as it
>> means that the least insane thing to implement is what we get)
> 
> In VMS, and its predecessor RSX, the purpose of a file with fixed width
> records has always been that you can easily and efficiently retrieve a
> specific record at all times. These files were often referred to as
> 'random access files'. Random access files typically didn't have record
> terminators.
> 
> In flat files systems, you can find record NNN by seeking to position
> NNN*width, and seeking loses its efficiency when done on characters.

Not really relevant to the discussion of $/ and UTF-8, but to be pedantically correct, relative access to files with fixed-length records is only one of several random access methods available on VMS.  The others don't require the records to be fixed length.

________________________________________
Craig A. Berry
mailto:craigberry@mac.com

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About