[31231] in Perl-Users-Digest
Perl-Users Digest, Issue: 2476 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 13 18:09:44 2009
Date: Sat, 13 Jun 2009 15:09:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 13 Jun 2009 Volume: 11 Number: 2476
Today's topics:
Re: reading a select form from perl <hjp-usenet2@hjp.at>
Re: reading a select form from perl <tadmc@seesig.invalid>
Re: reading a select form from perl <uri@StemSystems.com>
Re: reading a select form from perl <tadmc@seesig.invalid>
Re: reading a select form from perl <hjp-usenet2@hjp.at>
Re: regex problem sln@netherlands.com
Re: regex problem <cwilbur@chromatico.net>
Re: regex problem <ben@morrow.me.uk>
require from autoload module <marc.girod@gmail.com>
Re: require from autoload module <marc.girod@gmail.com>
Re: require from autoload module <marc.girod@gmail.com>
Re: require from autoload module <1usa@llenroc.ude.invalid>
Re: require from autoload module <marc.girod@gmail.com>
Re: require from autoload module <ben@morrow.me.uk>
Re: require from autoload module <ben@morrow.me.uk>
Re: set environment in perl through windows <ben@morrow.me.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 13 Jun 2009 15:49:08 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: reading a select form from perl
Message-Id: <slrnh37bil.e8c.hjp-usenet2@hrunkner.hjp.at>
On 2009-06-10 11:34, Tad J McClellan <tadmc@seesig.invalid> wrote:
> Vit <FiNaR76@gmail.com> wrote:
>> print MAIL "From: $email_address\n";
>> print MAIL "To: test\@domain.com\n";
>> print MAIL "Subject: Web Request\n\n";
>> print MAIL "Comment: $enquiry\n";
I would split these two lines into three:
print MAIL "Subject: Web Request\n";
print MAIL "\n";
print MAIL "Comment: $enquiry\n";
Otherwise the end of the header is too easy to miss.
>> #print MAIL "Interest: $interest\n"
>> print MAIL "\n.\n";
>
>
> print MAIL <<ENDMAIL;
> From: $email_address
> To: test\@domain.com
> Subject: Web Request
>
> Comment: $enquiry
>
> .
> ENDMAIL
I strongly disagree. Here documents are horrible to read. They are
somewhat bearable if they are at the top level, but consider this:
sub process_form {
some();
code();
to();
get();
parameters();
if (everything_ok()) {
do();
some();
more();
open ( MAIL, "| /usr/sbin/sendmail -t" ) or die "...";
print MAIL <<ENDMAIL;
From: $email_address
To: test\@domain.com
Subject: Web Request
Comment: $enquiry
.
ENDMAIL
some();
more();
}
clean();
up();
}
I vastly prefer repeating 'print MAIL' on every line to to breaking the
visual structure of the program and never use here documents.
In this case I'd probably use a single print, though:
open ( MAIL, "| /usr/sbin/sendmail -t" ) or die "...";
print MAIL
"From: $email_address\n",
"To: test\@domain.com\n",
"Subject: Web Request\n",
"\n",
"Comment: $enquiry\n",
"\n",
".\n";
hp
------------------------------
Date: Sat, 13 Jun 2009 09:57:25 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: reading a select form from perl
Message-Id: <slrnh37fil.t8u.tadmc@tadmc30.sbcglobal.net>
Peter J. Holzer <hjp-usenet2@hjp.at> wrote:
> On 2009-06-10 11:34, Tad J McClellan <tadmc@seesig.invalid> wrote:
>> print MAIL <<ENDMAIL;
>> From: $email_address
>> To: test\@domain.com
>> Subject: Web Request
>>
>> Comment: $enquiry
>>
>> .
>> ENDMAIL
>
> I strongly disagree. Here documents are horrible to read. They are
> somewhat bearable if they are at the top level,
or if you apply the techniques given in the FAQ answer below so
that they are indented the same as the containing code:
perldoc -q here.doc
Why don't my <<HERE documents work?
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Sat, 13 Jun 2009 12:33:40 -0400
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: reading a select form from perl
Message-Id: <87eito2ivv.fsf@quad.sysarch.com>
>>>>> "TJM" == Tad J McClellan <tadmc@seesig.invalid> writes:
TJM> Peter J. Holzer <hjp-usenet2@hjp.at> wrote:
>>
>> I strongly disagree. Here documents are horrible to read. They are
>> somewhat bearable if they are at the top level,
TJM> or if you apply the techniques given in the FAQ answer below so
TJM> that they are indented the same as the containing code:
TJM> perldoc -q here.doc
TJM> Why don't my <<HERE documents work?
i love here docs and use them where many people wouldn't. i don't have
any issues with the indent of the closing token so that never bothers
me. the win for here docs is seeing your text as it will be printed
(other than interpolation) without noisy \n and quote chars and all. i
can see long lines and wrap them in the code. the syntax means you can
have the item comma right after the opening token vs way after the
closing quote. you can use here docs as args in a call and have much
cleaner code than a long quoted string followed by either more args or
the close of the call. the only issue i hear is the closing token but
that is nothing compared to all the wins i mentioned. and as tad and the
FAQ point out, you can even hack the indent at run time (i never do
that).
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Sat, 13 Jun 2009 13:34:29 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: reading a select form from perl
Message-Id: <slrnh37s9l.uvv.tadmc@tadmc30.sbcglobal.net>
Uri Guttman <uri@StemSystems.com> wrote:
>>>>>> "TJM" == Tad J McClellan <tadmc@seesig.invalid> writes:
>
> TJM> Peter J. Holzer <hjp-usenet2@hjp.at> wrote:
> >>
> >> I strongly disagree. Here documents are horrible to read. They are
> >> somewhat bearable if they are at the top level,
>
>
> TJM> or if you apply the techniques given in the FAQ answer below so
> TJM> that they are indented the same as the containing code:
>
> TJM> perldoc -q here.doc
>
> TJM> Why don't my <<HERE documents work?
>
> i love here docs and use them where many people wouldn't. i don't have
> any issues with the indent of the closing token so that never bothers
> me. the win for here docs is seeing your text as it will be printed
> (other than interpolation) without noisy \n and quote chars and all.
> the only issue i hear is the closing token
An issue I had meant to mention but forgot was:
Here-docs can easily morph into a "templating system", and applying
"system" to here-docs isn't something that I am able to do with
a straight face.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Sat, 13 Jun 2009 23:16:06 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: reading a select form from perl
Message-Id: <slrnh385on.uc4.hjp-usenet2@hrunkner.hjp.at>
On 2009-06-13 16:33, Uri Guttman <uri@StemSystems.com> wrote:
>>>>>> "TJM" == Tad J McClellan <tadmc@seesig.invalid> writes:
>
> TJM> Peter J. Holzer <hjp-usenet2@hjp.at> wrote:
> >>
> >> I strongly disagree. Here documents are horrible to read. They are
> >> somewhat bearable if they are at the top level,
>
>
> TJM> or if you apply the techniques given in the FAQ answer below so
> TJM> that they are indented the same as the containing code:
>
> TJM> perldoc -q here.doc
>
> TJM> Why don't my <<HERE documents work?
I know that FAQ entry. The proposed solution is fragile (it breaks
when you change the indentation) and replacing a constant with a
function call doesn't doesn't strike me as particularly elegant.
> i love here docs and use them where many people wouldn't.
[...]
> the only issue i hear is the closing token but
> that is nothing compared to all the wins i mentioned.
I don't care much about the closing token, I care about all the text in
the here document itself. I find a long block of text which isn't indented
along the rest of the code very distracting.
I like the way this is solved in SPL. Quoting from the manual:
| Another way of quoting strings in SPL are so-called Here-Documents. They
| work a little bit differently in SPL compared to other languages such as Perl.
|
| An example:
|
| debug <<EOT
| This is a debug message.
| It is quoted using the Here-Documents mechanism.
| Substitutions work here: 5 + 3 = ${ 5 + 3 }
| EOT;
|
| The Here-Document starts with ’<<Token’ and is terminated by the next
| occurrence of ’Token’. A white space character (i.e. also a newline character)
| after ’<<Token’ is ignored. Unlike in other languages, the terminating ’Token’
| doesn’t need to be at the beginning of a new line. Also note that the ’;’, which
| terminates the command, is located after the end token. The Here-Document
| starts immediately after ’<<Token’. The special substitutions (which are described
| in the next section) do work in this kind of Here-Document.
|
| If ’>>’ instead of ’<<’ is used, the Here-Document is literal and no substitutions
| are performed.
|
| The ’<<Token’ (or ’>>Token’) may be followed by any special character,
| which is then used as so-called indenting character. All characters from the
| beginning of a line in the Here-Document until the first occurrence of that
| indenting character are ignored:
|
| debug <<EOT:
| :This Here-Document is using indenting characters.
| :So there is no indenting in the output.
| EOT;
hp
------------------------------
Date: Sat, 13 Jun 2009 02:11:44 -0700
From: sln@netherlands.com
Subject: Re: regex problem
Message-Id: <uro635dibftejvdqn6oa7hkao1v37oiouo@4ax.com>
On Fri, 12 Jun 2009 12:20:05 -0700 (PDT), sstark <sstark@us.ibm.com> wrote:
>Hi all, I know I will be told that I should be using one of the HTML
>or XML parsers to perform this task, and you're right! :-) but still
>I'd like to know why my little regex while() loop isn't working.
>
>Here's a sample XHTML code snippet that I'm working on:
>
>[code]<pre>
><li>description <a href="overview_mh.html#overview">(1)</a>, <a
>href="catalog.html#catalog">(2)</a>
></pre>[code]
>
>My goal:
>
>1. Read a line of an XHTML file.
>2. If it contains an href= attribute, grab everything up to the
>opening href quote and print it out to a file.
>3. Read the href attribute itself, change it and print the changed
>version out to the file.
>4. Delete everything from the beginning of the line up to the closing
>quote of the href attribute.
>5. Check to see if there's another href on the line; if so, repeat. If
>not, print out the rest to the file.
>
>Here's a code snippet:
>
>[code]<pre>
> while($line =~ /^(.*?href\s*=\s*\")([^\"]+)(\".*)/i){ #"
^ ^ ^
Don't need to escape these dbl quotes.
and you probably need /is at the end.
plus there doesen't seem to be a need to have capture #3
or the .* in #3's group since it looks like your buffering
$line .= <DATA> somewhere. If so, the line will always contain
the remainder after substitution and pos() will always be reset.
I could be wrong.
> my $prev =$1;
> my $href =$2;
> print NEW $prev;
> # do some stuff to the href
> # ...
> print NEW $href;
> # remove both $prev and $href from $line and continue
> print "VALUE OF prev: $prev\n";
> print " BEFORE: $line";
> $line =~ s/^$prev//;
> print " AFTER: $line";
> $line =~ s/^$href//;
> }
> print $line;
></pre>[/code]
>
>For some reason, the s/^$prev//; isn't working; The result looks
>something like this:
>
>VALUE OF prev: ">(1)</a>, <a href="
>BEFORE: ">(1)</a>, <a href="catalog.html#catalog">(2)</a>
>AFTER: ">(1)</a>, <a href="catalog.html#catalog">(2)</a>
>
>Why isn't it deleting the value of $prev in $line?
>
>Meanwhile, yes I'm looking at one of the parsers.
>
>thanks,
>Scott
Somebody already mentioned the parenths metachars as a
pattern in the substitution. So thats your problem.
However, it might be less expensive if you slurped in the
whole file and avoid the substitution altogether. But, the
substitution is a easy buffering mechanism, albeit expensive
on time.
-sln
-------------
use strict;
use warnings;
# /(?:(.*?href\s*=\s*)(["'])(.*?)(\2))|(.*)/isg
my $line = join ( '', <DATA>);
my $count = 1;
while( $line =~ /
(?:
(.*?href\s*=\s*) # $1 all up to the next and including href=
(["']) # $2 " or ' (1+2 = prev)
(.*?) # $3 attribute value (unquoted)
(\2) # $4 what $2 is (" or ')
)
| # or
(.*) # $5 the remainder (only hit once)
/xisg)
{
print "Pass ".$count++.":\n------------\n";
if (defined $1) {
print "prev:\n".$1.$2."\n";
print "val:\n".$3."\n";
print "end:\n".$4."\n";
}
if (defined $5) {
print "final:\n".$5."\n";
}
}
__DATA__
<pre>
<li>description <a href="overview_mh.html#overview">(1)</a>,
<a href="catalog.html#catalog">(2)</a>
</pre>
------------------------------
Date: Sat, 13 Jun 2009 09:12:05 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: regex problem
Message-Id: <86vdn0wa56.fsf@mithril.chromatico.net>
>>>>> "s" == sstark <sstark@us.ibm.com> writes:
s> Why isn't it deleting the value of $prev in $line?
Because ^ doesn't do what you think it does, and it only works in
the code you have there out of pure luck and coincidence.
Charlton
--
Charlton Wilbur
cwilbur@chromatico.net
------------------------------
Date: Sat, 13 Jun 2009 20:07:21 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: regex problem
Message-Id: <90adg6-ald.ln1@osiris.mauzo.dyndns.org>
Quoth Charlton Wilbur <cwilbur@chromatico.net>:
> >>>>> "s" == sstark <sstark@us.ibm.com> writes:
[ sstark's code was
$line =~ s/^$prev//;
]
> s> Why isn't it deleting the value of $prev in $line?
>
> Because ^ doesn't do what you think it does, and it only works in
> the code you have there out of pure luck and coincidence.
Please explain further. ^ means 'match at the beginning of the string',
unless /m is given, in which case it means 'match at the beginning of
any line'. How is this not what the OP thought it meant?
Ben
------------------------------
Date: Sat, 13 Jun 2009 03:38:34 -0700 (PDT)
From: Marc Girod <marc.girod@gmail.com>
Subject: require from autoload module
Message-Id: <119b2e02-d7f3-4d93-92e5-c583efc88127@s12g2000yqi.googlegroups.com>
Hello,
From an autoloaded function, a require statement succeeds, without
importing any function.
Using the same module works fine from a normal script.
I suspect a problem with my own autoloaded module, or an interaction
of the autoload mechanism.
The code snippet from my autoloaded function:
--8<------
package ClearCase::Wrapper::MGi;
$VERSION = '0.11';
use warnings;
use strict;
use vars qw($ct $eqhl $prhl $diat);
($eqhl, $prhl, $diat) = qw(EqInc PrevInc DelInc);
sub compareincs($$) {
...
}
use AutoLoader 'AUTOLOAD';
use ClearCase::Wrapper;
...
sub unlock() {
my $fl = "ClearCase::Wrapper::ForceLock";
eval "require $fl";
...
--8<------
My test script:
--8<------
#!/usr/bin/perl -w
use ClearCase::Wrapper::ForceLock;
my $lt = 'ZZZ_1.00';
my $v = '/wran_cm_makesystem';
flocklt($lt, $v);
--8<------
Under the debugger, with the latter, I get:
main::(./flock:5): my $lt = 'ZZZ_1.00';
DB<1> S ClearCase::Wrapper::ForceLock.*
ClearCase::Wrapper::ForceLock::BEGIN
ClearCase::Wrapper::ForceLock::flocklt
ClearCase::Wrapper::ForceLock::funlocklt
ClearCase::Wrapper::ForceLock::ssh
Whereas with the former:
o blib/lib/auto/ClearCase/Wrapper/MGi/unlock.al):954):
954: eval "require $fl";
DB<3> S ClearCase::Wrapper::(For|MGi).*
ClearCase::Wrapper::ForceLock::BEGIN
ClearCase::Wrapper::MGi::BEGIN
ClearCase::Wrapper::MGi::compareincs
ClearCase::Wrapper::MGi::unlock
DB<4> n
ClearCase::Wrapper::MGi::unlock((eval 303)[blib/lib/ClearCase/Wrapper/
MGi.pm (autosplit into blib/lib/auto/ClearCase/Wrapper/MGi/unlock.al):
954]:3):
3:
DB<4> p $?
0
DB<5> S ClearCase::Wrapper::(For|MGi).*
ClearCase::Wrapper::ForceLock::BEGIN
ClearCase::Wrapper::MGi::BEGIN
ClearCase::Wrapper::MGi::compareincs
ClearCase::Wrapper::MGi::unlock
Clearly (!?) I have 'entered' the ForceLock module (even before my run-
time require!), but not have not gone far enough to define and import
the functions there...
It seems to me like the problem is not in the imported module, since
it works from the test script.
As if there was a cycle?
Can you help me make sense of that?
Thanks!
Marc
------------------------------
Date: Sat, 13 Jun 2009 07:07:10 -0700 (PDT)
From: Marc Girod <marc.girod@gmail.com>
Subject: Re: require from autoload module
Message-Id: <76f5a1ae-17ca-4fd2-80c0-073c2df74845@i6g2000yqj.googlegroups.com>
Just a precision...
On Jun 13, 11:38=A0am, Marc Girod <marc.gi...@gmail.com> wrote:
> The code snippet from my autoloaded function:
>
> --8<------
...
> use AutoLoader 'AUTOLOAD';
> use ClearCase::Wrapper;
> ...
1;
__END__
...
> sub unlock() {
> ...
> --8<------
> Can you help me make sense of that?
Also, I read now perlmod, and try to use the UNITCHECK, CHECK, and
INIT blocks...
Thanks!
Marc
------------------------------
Date: Sat, 13 Jun 2009 09:44:30 -0700 (PDT)
From: Marc Girod <marc.girod@gmail.com>
Subject: Re: require from autoload module
Message-Id: <b941014b-b523-4fb1-8d5e-6705b6e8454d@y7g2000yqa.googlegroups.com>
On Jun 13, 3:07=A0pm, Marc Girod <marc.gi...@gmail.com> wrote:
> Also, I read now perlmod, and try to use the UNITCHECK, CHECK, and
> INIT blocks...
Some progress...
I use now:
require $fl
with $fl having the file name...
Somehow, eval "require $fl" seems not to inject the functions names to
my scope.
And I added a 'no AutoLoader' at the block level.
I am not quite there yet, but there is some hope that your help might
come too late!
Marc
------------------------------
Date: Sat, 13 Jun 2009 18:05:30 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: require from autoload module
Message-Id: <Xns9C298F5CED8EEasu1cornelledu@127.0.0.1>
Marc Girod <marc.girod@gmail.com> wrote in news:b941014b-b523-4fb1-8d5e-
6705b6e8454d@y7g2000yqa.googlegroups.com:
> On Jun 13, 3:07 pm, Marc Girod <marc.gi...@gmail.com> wrote:
>
>> Also, I read now perlmod, and try to use the UNITCHECK, CHECK, and
>> INIT blocks...
>
> Some progress...
> I use now:
> require $fl
> with $fl having the file name...
> Somehow, eval "require $fl" seems not to inject the functions names to
> my scope.
> And I added a 'no AutoLoader' at the block level.
It is hard for me to follow what you are doing and I am not sure why you
need the eval.
Is:
require $fl;
$fl->import;
not doing what you want?
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
------------------------------
Date: Sat, 13 Jun 2009 12:26:55 -0700 (PDT)
From: Marc Girod <marc.girod@gmail.com>
Subject: Re: require from autoload module
Message-Id: <f81cebc8-a74d-4e8f-b18b-041819907fc6@j18g2000yql.googlegroups.com>
On Jun 13, 7:05=A0pm, "A. Sinan Unur" <1...@llenroc.ude.invalid> wrote:
> It is hard for me to follow what you are doing and I am not sure why you
> need the eval.
I am sorry. It is a bit hard to extract enough, yet not too much.
I got now something that works, but there surely is room for
improvement.
> Is:
>
> require $fl;
> $fl->import;
>
> not doing what you want?
"perldoc -f require" explains that eval is required in that case.
I didn't try 'import'. Isn't it implicit?
This would explain why my attempts failed...
In my current version, there is no import, and I convert myself
the Foo::Bar syntax into Foo/Bar.pm before passing to require.
Marc
------------------------------
Date: Sat, 13 Jun 2009 20:24:19 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: require from autoload module
Message-Id: <30bdg6-f8e.ln1@osiris.mauzo.dyndns.org>
Quoth "A. Sinan Unur" <1usa@llenroc.ude.invalid>:
> Marc Girod <marc.girod@gmail.com> wrote in news:b941014b-b523-4fb1-8d5e-
> 6705b6e8454d@y7g2000yqa.googlegroups.com:
>
> > On Jun 13, 3:07 pm, Marc Girod <marc.gi...@gmail.com> wrote:
> >
> >> Also, I read now perlmod, and try to use the UNITCHECK, CHECK, and
> >> INIT blocks...
> >
> > Some progress...
> > I use now:
> > require $fl
> > with $fl having the file name...
> > Somehow, eval "require $fl" seems not to inject the functions names to
> > my scope.
> > And I added a 'no AutoLoader' at the block level.
>
> It is hard for me to follow what you are doing and I am not sure why you
> need the eval.
The eval is conventional as a way of turning
require Foo::Bar;
into
require "Foo/Bar.pm";
and also to catch errors.
To the OP: the following works for me:
~/src/perl% cat AutoTest.pm
package AutoTest;
use AutoLoader qw/AUTOLOAD/;
1;
__END__
sub autotest {
my $f = "AutoTest2";
eval "require $f" or die "can't load $f: $@";
AutoTest2::autotest();
}
~/src/perl% cat AutoTest2.pm
package AutoTest2;
sub autotest {
warn "autotest successful";
}
1;
~/src/perl% mkdir auto
~/src/perl% perl -MAutoSplit -e'autosplit "AutoTest.pm", "auto"'
AutoSplitting AutoTest.pm (auto/AutoTest)
~/src/perl% perl -MAutoTest -eAutoTest::autotest
autotest successful at AutoTest2.pm line 4.
~/src/perl%
What do you have to change to get it to stop working?
Ben
------------------------------
Date: Sat, 13 Jun 2009 21:39:48 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: require from autoload module
Message-Id: <kdfdg6-c551.ln1@osiris.mauzo.dyndns.org>
Quoth Marc Girod <marc.girod@gmail.com>:
> On Jun 13, 7:05 pm, "A. Sinan Unur" <1...@llenroc.ude.invalid> wrote:
>
> > Is:
> >
> > require $fl;
> > $fl->import;
> >
> > not doing what you want?
>
> "perldoc -f require" explains that eval is required in that case.
> I didn't try 'import'. Isn't it implicit?
Not with require (that's sort-of the point).
use Foo::Bar LIST;
is exactly equivalent to
BEGIN {
require Foo::Bar;
Foo::Bar->import(LIST);
}
which in turn is exactly equivalent to
BEGIN {
require "Foo/Bar.pm";
Foo::Bar->import(LIST);
}
(yes, 'require' at least understands /-separated paths on all systems).
Ben
------------------------------
Date: Sat, 13 Jun 2009 20:04:09 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: set environment in perl through windows
Message-Id: <9q9dg6-ald.ln1@osiris.mauzo.dyndns.org>
Quoth Jürgen Exner <jurgenex@hotmail.com>:
> Slickuser <slick.users@gmail.com> wrote:
> >I want to set a permanent environment on Windows and use it right
> >away.
> >None of this work, any help?
<snip>
>
> Of course these settings will not be inherited by the parent process,
> i.e. by the process that initiated the Perl process. If that's what you
> had in mind then I suggest to consult
> perldoc -q environment
I don't. The only entry in that FAQ answer is for 'Unix', and isn't
adaptable to Win32.
See the Win32::Env module, and note the caveats that
- changing the permanent environment this way will *not* affect %ENV
in your process: you must change that yourself if you need to;
- this will not affect the environment of already-running processes,
or (in general) of the processes they start. You may be able to do
this (if you really think you need to) using Win32::EnvProcess.
Ben
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 2476
***************************************