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

I deploy a large perl application on Solaris, and I need more than 255 simultaneously open file handles for some configurations. Not wanting to build a 64-bit perl (32-bit Oracle DBD installed usually), I've historically got around this by exporting PERLIO=perlio in my shell before starting the any processes. Recently, I've run into a more interesting occurence of needing this. Anyway my question is, why can't I set this in %ENV, in a BEGIN block or otherwise? Is this something that the vm needs to see during bootstrap, or is there a way to set this at runtime? Ideally, I'd like to use PerlIO 'perlio', but that appears to work only for new layers. Any ideas/docs/pointers would be appreciated..

Regards,
Ezra

Replies are listed 'Best First'.
Re: PERLIO environment variable
by diotalevi (Canon) on Sep 29, 2004 at 16:44 UTC

    I don't know the significance of the PERLIO environment variable but I can suggest a work-around to getting the environment variable set if isn't already: re-exec the current program after having set the variable. You could put this code into the import() function of a module and say use ... ( PERLIO => '...' ); if you needed/wanted to abstract it out.

    BEGIN { if ( not $ENV{'PERLIO'} ) { $ENV{'PERLIO'} = ...; EXEC_LOOP: { exec $^X, @ARGV; # This should not be reached. warn "Couldn't fork: $!"; sleep $sleep; redo; } } }