in reply to efficiently printing to 30 files

FileCache handles this for you quite nicely, but i've read that it wont' work with 'use strict;'

$ perl -e 'use FileCache; for("a".."z"){cacheout $_; print $_ $_,$/;}' $ ls a d g j m p s v y b e h k n q t w z c f i l o r u x $ cat a a $ cat b b $

Replies are listed 'Best First'.
Re: Re: efficiently printing to 30 files
by belg4mit (Prior) on Mar 06, 2003 at 23:11 UTC
    This was fixed in perl 5.8, I ought to upload that version (1.02) to CPAN seperately, but until then you can get it at ftp://pthbb.org/pub/pm/FileCache/.

    UPDATE: I may have misunderstood what you said. Versions of FileCache prior to 5.8 would, themselves, not compile under strict. this is what I thought you meant. However, it seems likely you were referring to the fact that the current FileCache implementation uses symbolic filehandles and hence requires no strict 'refs'. I have thought of a solution, which has other benefits. Namely, to use IO::Handle. This leads to some difficult decisions though. See my recent posts to perl5-porters for more information.

    --
    I'm not belgian but I play one on TV.

      cool. i caught it as 'Perl Recipe of the Day' on http://www.perl.com a few days ago. the perldoc for the version i have doesn't have much in way of examples. i saw the 'strict' warning on some message board somewhere that google gave me. nice to know it's strict safe now.