Win32 Environment Variable Read-only?

2006-02-03 Thread L. Neil Johnson
Using AS Perl 5.8.7 under W98SE, the PATH environment variable is 
displayed, then assigned a new value; but the new value doesn't propagate 
back to the MS-DOS %PATH% variable. Are the %ENV values read-only?

  C:\Programs\PERLSET
  ...
  PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PERL\BIN\;C:\THINKPAD
  ...

  C:\Programs\PERLperl
  print $ENV{PATH}\n;
  $ENV{PATH} = 'C:\WINDOWS;C:\WINDOWS\COMMAND';
  print $ENV{PATH}\n;
  ^D
  C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PERL\BIN\;C:\THINKPAD
  C:\WINDOWS;C:\WINDOWS\COMMAND

  C:\Programs\PERLSET
  ...
  PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PERL\BIN\;C:\THINKPAD
  ...

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Win32 Environment Variable Read-only?

2006-02-03 Thread Alexander Apprich
L. Neil Johnson wrote:
 Using AS Perl 5.8.7 under W98SE, the PATH environment variable is 
 displayed, then assigned a new value; but the new value doesn't propagate 
 back to the MS-DOS %PATH% variable. Are the %ENV values read-only?
 
   C:\Programs\PERLSET
   ...
   PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PERL\BIN\;C:\THINKPAD
   ...
 
   C:\Programs\PERLperl
   print $ENV{PATH}\n;
   $ENV{PATH} = 'C:\WINDOWS;C:\WINDOWS\COMMAND';
   print $ENV{PATH}\n;
   ^D
   C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PERL\BIN\;C:\THINKPAD
   C:\WINDOWS;C:\WINDOWS\COMMAND
 
   C:\Programs\PERLSET
   ...
   PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PERL\BIN\;C:\THINKPAD
   ...

that's because you get a copy of the environment for your perl
process. after you process is finished everything is like before.

Hth

Alex
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Win32 Environment Variable Read-only?

2006-02-03 Thread $Bill Luebkert
L. Neil Johnson wrote:

 Using AS Perl 5.8.7 under W98SE, the PATH environment variable is 
 displayed, then assigned a new value; but the new value doesn't propagate 
 back to the MS-DOS %PATH% variable. Are the %ENV values read-only?

Basically you can only change the env vrbls for the current task and
any children it spawns - not the parent (you have to do that at boot up).

   C:\Programs\PERLSET
   ...
   PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PERL\BIN\;C:\THINKPAD
   ...
 
   C:\Programs\PERLperl
   print $ENV{PATH}\n;
   $ENV{PATH} = 'C:\WINDOWS;C:\WINDOWS\COMMAND';
   print $ENV{PATH}\n;
   ^D
   C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PERL\BIN\;C:\THINKPAD
   C:\WINDOWS;C:\WINDOWS\COMMAND
 
   C:\Programs\PERLSET
   ...
   PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PERL\BIN\;C:\THINKPAD
   ...

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Net::SMTP Question

2006-02-03 Thread Dirk Bremer
I have a need to send multiple email messages within a single instance
of a program. I have a problem where the first composed email message is
sent (and received) okay, while the subsequent messages are not. The
code is similar to this:

use Net::SMTP;
$smtp = Net::SMTP-new('mailhost');
$smtp-mail($ENV{USER});

# Loop over the following for each message
$smtp-to('postmaster');
$smtp-data();
$smtp-datasend(To: postmaster\n);
$smtp-datasend(\n);
$smtp-datasend(A simple test message\n);
$smtp-dataend();

$smtp-quit;

Note the loop as shown above. What am I doing wrong? Do I need to create
a new SMTP object for each message? 

Dirk Bremer - Senior Systems Engineer - ESS/AMS - NISC Lake St. Louis MO
- USA Central Time Zone
636-755-2652 fax 636-755-2503

[EMAIL PROTECTED]
www.nisc.coop

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


logging IPs

2006-02-03 Thread Adam Peterson
hi,

i have a cgi script that i would like to add some logging to. i would like
to log the ip of those using it. is there an easy way to capture this? i
know i can look at the server logs but i'd like to be able to log the
script inputs and ip of the requestor.

any help and example code is appreciated

thanks!
-adam


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Net::SMTP Question

2006-02-03 Thread DZ-Jay

Dirk Bremer wrote:

Note the loop as shown above. What am I doing wrong? Do I need to create
a new SMTP object for each message? 


You have to start each message transaction with the MAIL FROM SMTP 
command (i.e. $smtp-mail() ).  You do not need to reconnect unless the 
server kicks you out after sending an email (some do!).


You might want to revise your code to something like:

use Net::SMTP;
$smtp = Net::SMTP-new('mailhost');

# start loop
# Loop over the following for each message
$smtp-mail($ENV{USER});  # -- Start with this every time!
$smtp-to('postmaster');
$smtp-data();
$smtp-datasend(To: postmaster\n);
$smtp-datasend(\n);
$smtp-datasend(A simple test message\n);
$smtp-dataend();
# end loop

$smtp-quit;
# EOF

dZ.

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: :SMTP Question

2006-02-03 Thread Hill, David K
I believe you need to re-create the object for each message
You are opening a connection, then you quit the connection then every
subsequent message is sent to the bit bucket.

Personally I would create a connection to the email server, send you
email, quite that session then start again with another connection.

-d

David K Hill



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Dirk Bremer
Sent: Friday, February 03, 2006 9:38 AM
To: perl-win32-users@listserv.ActiveState.com
Subject: Net::SMTP Question

I have a need to send multiple email messages within a single instance
of a program. I have a problem where the first composed email message is
sent (and received) okay, while the subsequent messages are not. The
code is similar to this:

use Net::SMTP;
$smtp = Net::SMTP-new('mailhost');
$smtp-mail($ENV{USER});

# Loop over the following for each message
$smtp-to('postmaster');
$smtp-data();
$smtp-datasend(To: postmaster\n);
$smtp-datasend(\n);
$smtp-datasend(A simple test message\n);
$smtp-dataend();

$smtp-quit;

Note the loop as shown above. What am I doing wrong? Do I need to create
a new SMTP object for each message? 

Dirk Bremer - Senior Systems Engineer - ESS/AMS - NISC Lake St. Louis MO
- USA Central Time Zone
636-755-2652 fax 636-755-2503

[EMAIL PROTECTED]
www.nisc.coop

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: logging IPs

2006-02-03 Thread Chris
hi,

i have a cgi script that i would like to add some logging to. i would like
to log the ip of those using it. is there an easy way to capture this? i
know i can look at the server logs but i'd like to be able to log the script
inputs and ip of the requestor.

any help and example code is appreciated

thanks!
-adam

--


print $ENV('REMOTE_ADDR'); #apache

-or-

print $ENV('REMOTE_HOST'); #IIS



- Chris


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: :SMTP Question

2006-02-03 Thread Chris
Dirk Bremer wrote:

I have a need to send multiple email messages within a single instance of a
program. I have a problem where the first composed email message is sent
(and received) okay, while the subsequent messages are not. The code is
similar to this:

use Net::SMTP;
$smtp = Net::SMTP-new('mailhost');
$smtp-mail($ENV{USER});

# Loop over the following for each message
$smtp-to('postmaster');
$smtp-data();
$smtp-datasend(To: postmaster\n);
$smtp-datasend(\n);
$smtp-datasend(A simple test message\n);
$smtp-dataend();

$smtp-quit;

Note the loop as shown above. What am I doing wrong? Do I need to create a
new SMTP object for each message? 




Creating a new object was the only way I could make it work. If your sending
the exact same message to a number of recipients, the To parameter will
accept an array of addresses.

- Chris


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Net::SMTP Question

2006-02-03 Thread Dirk Bremer
 Dirk Bremer wrote:
  Note the loop as shown above. What am I doing wrong? Do I 
 need to create
  a new SMTP object for each message? 
 
 You have to start each message transaction with the MAIL FROM SMTP 
 command (i.e. $smtp-mail() ).  You do not need to reconnect 
 unless the 
 server kicks you out after sending an email (some do!).
 
 You might want to revise your code to something like:
 
 use Net::SMTP;
 $smtp = Net::SMTP-new('mailhost');
 
 # start loop
  # Loop over the following for each message
  $smtp-mail($ENV{USER});  # -- Start with this every time!
  $smtp-to('postmaster');
  $smtp-data();
  $smtp-datasend(To: postmaster\n);
  $smtp-datasend(\n);
  $smtp-datasend(A simple test message\n);
  $smtp-dataend();
 # end loop
 
 $smtp-quit;
 # EOF

DZ-Jay wins the Friday's Best Answer Award for this week. I have many
programs that send single email messages, but none that needed to send
multiple until now. His advice as stated above worked perfectly. The
documentation for Net::SMTP is rather sparse and doesn't address this
situation. DZ-Jay has his choice of a virtual-6-pack or a virtual bottle
of reserve for his great response. 

Dirk Bremer - Senior Systems Engineer - ESS/AMS - NISC Lake St. Louis MO
- USA Central Time Zone
636-755-2652 fax 636-755-2503

[EMAIL PROTECTED]
www.nisc.coop 

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Win32 Environment Variable Read-only?

2006-02-03 Thread Chris Wagner
At 04:54 AM 2/3/2006 -0700, [EMAIL PROTECTED] wrote:
Using AS Perl 5.8.7 under W98SE, the PATH environment variable is 
displayed, then assigned a new value; but the new value doesn't propagate 
back to the MS-DOS %PATH% variable. Are the %ENV values read-only?

A child process can't change the environment of its parent process.




--
REMEMBER THE WORLD TRADE CENTER ---= WTC 911 =--
...ne cede malis

0100

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs