tpav has asked for the wisdom of the Perl Monks concerning the following question:

Is there a way to handle large files (>2Gigs) in Perl 5.004_04 on Solaris 8?

I tried both open and sysopen (with O_LARGEFILE) and both failed.

I am thinking of doing it the 'hard' way with UNIX commands split and join and processing it in smaller chunks, but what the heck, usually TMTOWTDI, isn't it?

  • Comment on Large Files in Perl 5.004_04 (more than 2Gigs) on Solaris 8

Replies are listed 'Best First'.
Re (tilly) 1: Large Files in Perl 5.004_04 (more than 2Gigs) on Solaris 8
by tilly (Archbishop) on Sep 28, 2001 at 15:56 UTC
    Unless you specifically compile Perl with large file support (which is a more recent feature), Perl cannot handle it directly. The usual workaround is to open a pipe that cats from and to the file. This works because while Perl doesn't understand large files, it understands endless pipes, and your cat utility understands how to stream large files.

    Yeah, it is a hack. But it is a useful one to know about.

Re: Large Files in Perl 5.004_04 (more than 2Gigs) on Solaris 8
by grinder (Bishop) on Sep 28, 2001 at 14:59 UTC

    Um, 5.004_04 is sorta old. Like, to give you an idea of the timescale, the web wasn't invented at the time it was released. Are you really sure it's inconceivable to install 5.6.1? You don't necessarily have to overwrite the 5.004 installation, you can install it alongside.</p.

    I say that because I doubt the perl binary knows what to do with O_LARGEFILE, but if you compiled it today, it probably would. And if you get stuck, call for help again.

    --
    g r i n d e r
Re: Large Files in Perl 5.004_04 (more than 2Gigs) on Solaris 8
by tpav (Initiate) on Sep 28, 2001 at 18:47 UTC
    grinder, unfortunately for various reasons we cannot follow your solution (which in the end would have been the most desirable...)

    tilly, your 'hack' did the trick in the most magnificent way! It saved me a lot of fuss.

    Thanks for your help, both of you.