jn Tue, Feb 22, 2005 at 10:54:26AM -0000, Rafael Garcia-Suarez wrote: > I had this silly idea, to try to add %ENV to pugs. That would be an > interesting exercise. So I can write CGI scripts. Maybe. But I don't > know what's the Right way to do it in Perl 6. Any hints ?
In Perl6 I think you do it by populating the %*ENV hash, when the script is first run. To add it, hack Main.hs line 102 to add a new SGlobal symbol of a VHash. If you already have a list of pairs "x", it is as simple as: VHash $ MkHash (listToFM x) Now, to obtain the list of ENV, hack Posix.hs to add an import of System.Posix.Env, and you'll have a that list of pairs via the "getEnvironment" call: x <- getEnvironment Find me on #perl6 if you're unsure how to approach this. :) Thanks, /Autrijus/
pgpgF80FtbGOg.pgp
Description: PGP signature