On Mon, Mar 14, 2005 at 08:06:08AM -0800, Larry Wall wrote: > On Mon, Mar 14, 2005 at 10:58:00PM +1100, Andrew Savige wrote: > : my $fh = open(@ARGS[0]); > : my @lines = =$fh; > : $fh.close(); > : for @lines { print"$_" } > : > > Hmm. It's probably a design bug. I'm wondering if we have to specify > that ordinary assignment not only copies logically but, in fact, always > does ** flattening (immediate flattening) like Perl 5
Except ** does not flatten recursively, so: my $lines = [ =$fh ]; is still borked. Do we want a *** "nuke everything flat" semantic device, if not the operator? Or an eager context on the right hand side of "="? On the other hand, we can alternatively specify that closing a file handle must force all thunks associated to it, i.e. in this case fill @lines with real data. Pugs can do that just fine, but I have no idea how parrot is to achieve that... Thanks, /Autrijus/
pgpEBaFEN7Eb3.pgp
Description: PGP signature