Date: 14 Sep 2001 23:38:21 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: Perl (slurping) is TOO much fun
Message-Id: <slrn9q553h.920.damian@puma.qimr.edu.au>

Logan Shaw chose 14 Sep 2001 14:17:45 -0500 to say this:
>In article <slrn9q39rb.og2.damian@puma.qimr.edu.au>,
>Damian James <damian@qimr.edu.au> wrote:
>> ... Even then,
>>for some operations it will be easier to slurp for now, then later tie() your
>>data structure to a disk file.
>
>Is there an easy tie() equivalent for this?

I should have moderated my language. 'Easy' probably isn't the right word
:-). Neither is 'will'.

>[slurping examples snipped]
>If so, that could be a good answer to some of the "how do you modify a
>file in place" questions.
>

No. You are simply moving the 'modify in place' code from the main program
to the package containing the methods for working with the file the
variable is tie()ed to. The presence of the required functionality in a
CPAN module make it easier, of course.

There is a Tie::Handle module on CPAN by Steffen Beyer, whose namespace has
been reclaimed by the synonymous core module, but which appears to have the
functionality required to do the above. It also appears not to have been
maintained since 1997. 

Perhaps someone can shed some light?

Cheers,
Damian
-- 
@:=grep!(m!$/|#!..$|),split//,<DATA>;@;=0..$#:;while($:=@;){$;=rand
$:--,@;[$;,$:]=@;[$:,$;]while$:;push@|,shift@;if$;[0]==@|;select$,,
$,,$,,1/80;print qq x\bxx((@;+@|)*$|++),@:[@|,@;],!@;&&$/}  __END__
Just another Perl Hacker, ### rev 3.3 -- stupidectomy performed :-)


