On Fri, Sep 01, 2000 at 08:46:50PM -0000, Perl6 RFC Librarian wrote:
> Many programs have so-called "resource configuration" files (at least
> that's what I call them) that are loaded and executed upon program
> startup. Some example programs that have this ability include bash,
> mutt, and python. Perl should do something similar.
I'd like to point out that Perl is not a program, it is a programming
language. I can see why programs need configuration files, but why
does a programming language need one? The program itself is the
configuration. An rc file seems redundant.
I'm having a hard time thinking of real uses for a .perlrc file.
Perhaps someone could provide some examples?
Here's a little pros/cons list running through my head right now...
pro con
Customize @INC We have PERL5LIB
Forcing -T on Will break most existing programs.
Makes one-liners annoying.
Forcing -w on Makes one-liners annoying.
Makes running existing programs
annoying.
We have PERL5OPT
Forcing strict on. Same as -T.
We have PERL5OPT
Running auditing modules like Same as -T.
B::Lint and Dunce::Files We have PERL5OPT
[As a reminder, /usr/bin is typically full of Perl code which you use but
cannot control]
So the major problem here is .perlrc will break existing code and make
one-liners a pain in the ass. If there was an environment where
neither of these was an issue, it might be useful. The one thing
which came up was web servers. You could give the web server user a
.perlrc file and enforce things on CGI programs. However, at least
under mod_perl, you can specify pre-loaded code. So the set of
usefulness becomes small.
Furthermore, .perlrc files can currently be implemented without a core
patch. Write a script which looks for a .perlrc file, generates a bit
of perl code, prefixes this to the program being run and then passes
it all to perl. Put that in place of /usr/bin/perl and tada! We
could develop such a script and distribute it with Perl. Such a
script also makes a good prototype, to hash out the pros and cons of
this RFC should anyone want to go forward with it.
--
Michael G Schwern http://www.pobox.com/~schwern/ [EMAIL PROTECTED]
Just Another Stupid Consultant Perl6 Kwalitee Ashuranse
Maybe they hooked you up with one of those ass-making magazines.
-- brian d. foy as misheard by Michael G Schwern