RE: HElp needed

2003-06-21 Thread Scot Robnett
Why can't you use CGI.pm? Some company policy or something? If you aren't
going to use that, you can still (aack) parse out the CGI input manually
if you have to, then use opendir/readdir/closedir to build arrays of file
and directory names and print them out. Or just print them out without going
through the extra step of building an array, if you don't need it later. The
following would print out any non-directory files within a given directory.

#!C:\Perl\bin\perl.exe -w

use strict;
my $dir = q(C:\Perl\html);
chdir($dir);
opendir(DIR, $dir) || die "can't opendir $dir: $!";
while(my $file = readdir(DIR)) {
 print $file . "\n" if -f $file;
}
closedir DIR;


Results in the output:

Active.css
CHANGES.html
Commlic.rtf
Commlic.txt
index.html
perlmain.html
perltoc.html
readme.html
RELEASE.html


Scot R.
inSite




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
$Bill Luebkert
Sent: Saturday, June 21, 2003 1:05 AM
To: ashish srivastava
Cc: [EMAIL PROTECTED]
Subject: Re: HElp needed


ashish srivastava wrote:
> Hi,
> My application needs to create an HTML page which shows all the
directories
> and files(UNIX platform).
> The file/dirs should have a link that should take them to the direc. or if
> it id a file  it should open  it.
> At present i am doing this by doing 'ls', storing the output in an array
and
> then printing the array..
> But how do i go to the next level of dir(or open the file) once the user
> clicks on his choice?
> I was thinking of passing the selected object name to another perl program
> which will do the 'ls' and print the o/p.
> Please suggest how to go about doing this..
> Also, i cannot use CGI.pm module
>
> Any sortof help would be greatly appreciated.

Without CGI, you would be forced to use ASP/JS/?? that would be embedded
in the HTML (which may not allow for what you want [not an expert]).

If you have an Apache server, just let the server handle it by making
sure you don't have an index.html and that you have Indexes turned on
in the httpd.conf or .htaccess file.

">
Options Indexes


--
  ,-/-  __  _  _ $Bill LuebkertMailto:[EMAIL PROTECTED]
 (_/   /  )// //   DBE CollectiblesMailto:[EMAIL PROTECTED]
  / ) /--<  o // //  Castle of Medieval Myth & Magic
http://www.todbe.com/
-/-' /___/_<_http://dbecoll.tripod.com/ (Free site for
Perl/Lakers)


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
BEGIN:VCARD
VERSION:2.1
N:Robnett;Scot
FN:Scot Robnett
ORG:inSite Internet Solutions
NOTE;ENCODING=QUOTED-PRINTABLE:Low cost web hosting, 50 MB disk space, easy and intuitive browser-based pag=
e builder and control panel, 2000 product shopping cart, contact management,=
 site promotion, and free tech support:=0D=0A=0D=0A	http://www.mawebcenters.=
com/insite2000
TEL;WORK;VOICE:(815) 206-2907
TEL;CELL;VOICE:(815) 790-9687
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;;Square West Center=0D=0A454 W. Jackson St.;Woodstock;IL;60098;United State=
s of America
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:Square West Center=0D=0A454 W. Jackson St.=0D=0AWoodstock, IL 60098=0D=0AUni=
ted States of America
URL;HOME:http://www.insiteful.tv
URL;WORK:http://www.insiteful.tv
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
REV:20030223T194915Z
END:VCARD


RE: FW: IDE for Perl/CGi

2003-06-17 Thread Scot Robnett
'pearl' should be Perl (for the language) or perl (for the binary).

"born shell" should be "Bourne Shell".

You don't say what kind of an error you're getting with the MSI, you just
say "it fails." Fails how?

If you've done shell programming, a lot of Perl will look familiar to you.
When you get it installed, just go to C:\Perl\html\index.html and review the
documentation.

Scot R.
inSite



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Cameron Dorey
Sent: Tuesday, June 17, 2003 9:35 AM
To: '[EMAIL PROTECTED]'
Subject: Re: FW: IDE for Perl/CGi


Pervaiz, Yasir wrote:
>
> ANYONE CAN help get pearl 5.8 going on my windows 2000 server machine. I
> like to run few scripts to get some information from user manager in
windows
> 2000. I have installed and got the msi file. it fails. any idea any help
you
> can offer me to get the pearl going for me. I have done some korn shell
and
> born shell programming.
> Thanks in advance for your help.

Perhaps the problem is that you are trying to install pearl, instead of
perl, as all or us are using ;).

Seriously, you  don't say what happens when "it fails." Without this
information, no one can give you anything but the most generic help.
That being said, maybe the msi you downloaded is corrupted, download it
again. It happens.

Cameron

--
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
[EMAIL PROTECTED]

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Help needed -- Net::telnet gives errors

2003-06-14 Thread Scot Robnett
I am also working on a project that requires passing a password via the web,
and obviously did not want to do so URL encoded with GET. My suggestions:

A. Use CGI.pm's param() method to get your
   form data. I second Carl's question as to why
   you would manually parse the form data when
   you can get all of the form data into a hash
   by simply doing

use CGI;
my $query = new CGI;
my %formvalues = $query->Vars;


B. The way I went about the password issue
   without using GET, or even a POST with hidden
   fields (better but still not ideal), is to
   use CGI::Session to generate a unique session
   ID once the username and password are authenticated.
   Now I use the session ID in hidden fields where
   I can, URL encoded using GET where I have to, but
   the username and password are not being passed
   around insecurely. The CGI::Session docs are
   pretty decent on the examples, so you shouldn't
   have much trouble with it. You can also use the
   generated session ID as a cookie and fake
   statefulness that way.

Your solution may require more effort because you are using a telnet session
and authenticating that way, where I'm just authenticating against either
.htaccess files or MySQL columns, so you've got another link in the chain
there.

But then again telnet passes username/password in plain ascii, so we're back
to the security issue on that end of it. Have you considered initiating an
SSH session rather than a telnet session? Just a thought...

Scot R.
inSite



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Carl Jolley
Sent: Saturday, June 14, 2003 7:29 PM
To: ashish srivastava
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: Help needed -- Net::telnet gives errors


On Sat, 14 Jun 2003, ashish srivastava wrote:

> Hi Ibrahim
> Thanks for ur help !
> I am able to connect to the UNIX server using Prompt=>'/[\w]$-/' (the
login
> being the user id with which the person has logged in eg. "tom-" ). But 1
> more prob.
> i have an application in which this perl script is being called by an HTML
> form (the usual Login screen ) and the login pwd is passed to the perl
> script
>
> This is my code for the HTML form
> ==
> 
> 
>   Login Screen
> 
> 
>  User Log in Screen 
> 
>  action="/cgi-bin/telp.pl" method="GET" >
> 
> User id  :    
> 
> 
> Password :
>  
>       Value="Submit" >
> 
> 
>
> 
> 
>
> And this is the Perl code
> 
>
> use CGI;
> use CGI::Carp qw(fatalsToBrowser);
> use Net::Telnet();
> print "Content-type:text/html\n\n";
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
> @pairs = split(/&/,$buffer);
> print " @pairs \n";
> $j=0;
> foreach $pair (@pairs) {
> ($name, $value) = split(/=/, $pair);
> $value =~ tr/+/ /;
>   #($dummy,$name)= split(/?/,$name);
> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
> $FORM{$name} = $value;
>   $info[$j]= $value;
>   $j++;
> }
>
>
> $t = new Net::Telnet (Timeout => 10, Prompt
> =>'/-/i',input_log=>'D:\server\logs\inputlog.txt');
>  $t->open("xxx..xxx.xxx") or die "Server not found \n";
> $t->login($usr, $pwd);
>   @lines = $t->cmd("ls -l");
>   foreach $temp(@lines)
>   {
> print "$temp";
>   }
>
> ==> The problem is that when i clik submit in the login screen, it dosent
> paas the usrname nad pswd to the perl prog. I dont understand why this is
> happening.
> Please help.
>

It's because you said the method was GET but you tried to retreive the
value from the form as though the method was POST. When the method is GET
the form values are passed via the $ENV{QUERY_STRING}. I strongly suggest
that the GET method NOT be used when you are passing a password unless you
only want to keep the password secret from those who don't know how to
view/source on an HTML page. Also why are you "hand-parsing" the form
input anyway when the CGI module has already done it for you?

 [EMAIL PROTECTED] 
 All opinions are my own and not necessarily those of my employer 

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
BEGIN:VCARD
VERSION:2.1
N:Robnett;Scot
FN:Scot Robnett
ORG:inSite Internet Solutions
NOTE;ENCODING=QUOTED-PRINTABLE:Low cost web hosting, 50 MB disk space, easy and intuitive browser-based pag=
e builder and control panel, 2000 product shopping cart, contact management,=
 site promotion, and free tech support:=0D=0A=0D=0A	http://www.mawebcenters.=
com/insite2000
TEL;WORK;VOICE:(815) 206-2907
TEL;CELL;VOICE:(815) 790-9687
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;;Square West Center=0D=0A454 W. Jackson St.;Woodstock;IL;60098;United Sta

RE: Reverse of Chomp...

2003-06-12 Thread Scot Robnett
Title: Reverse of Chomp...



Would this 
work?
 
    map { print "$_ \n" } 
@array;
 
I think that 
still loops through it though. H.
 
 


  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]On Behalf Of 
  George GallenSent: Thursday, June 12, 2003 3:46 
  PMTo: [EMAIL PROTECTED]Subject: 
  Reverse of Chomp...
  Is there a way to reverse chop/chomp 
  I'm reading  into an array, then    chomping off the last character of each of the 
     array elements. 
  Now I'd like to write the array back out   to , but I want to put the \n's back 
  between   each of the lines. 
  Aside from looping through the array, and    print each element followed by a \n to 
      is there an easier way 
  like: 
     unchop(@array) ;  = @array ; 
  
  I guess I could write a short subroutine, but didn't 
  want to re-invent the wheel, even though there isn't 
  much re-inventing in that routine. 
  Thanks George 

BEGIN:VCARD
VERSION:2.1
N:Robnett;Scot
FN:Scot Robnett
ORG:inSite Internet Solutions
NOTE;ENCODING=QUOTED-PRINTABLE:Low cost web hosting, 50 MB disk space, easy and intuitive browser-based pag=
e builder and control panel, 2000 product shopping cart, contact management,=
 site promotion, and free tech support:=0D=0A=0D=0A	http://www.mawebcenters.=
com/insite2000
TEL;WORK;VOICE:(815) 206-2907
TEL;CELL;VOICE:(815) 790-9687
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;;Square West Center=0D=0A454 W. Jackson St.;Woodstock;IL;60098;United State=
s of America
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:Square West Center=0D=0A454 W. Jackson St.=0D=0AWoodstock, IL 60098=0D=0AUni=
ted States of America
URL;HOME:http://www.insiteful.tv
URL;WORK:http://www.insiteful.tv
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
REV:20030223T194915Z
END:VCARD


RE: Date from string

2003-06-10 Thread Scot Robnett
Have you tried the Date::Format module? Otherwise some good old fashioned
splitting or regexing might be in order. :)

Scot R.
inSite



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Bryan
Tom Team EITC
Sent: Tuesday, June 10, 2003 1:26 PM
To: '[EMAIL PROTECTED]';
[EMAIL PROTECTED]
Subject: Date from string


I am creating a daily report that pulls all sorts of WMI information from
every server in my enterprise.  I am simply looking for ideas about
formatting the date returned by the eventlog.  It returns in a format like
so:

20030609150223.00-240

And I would like to re-format it to be more readable, something like this:

15:02:23 JUN 09 2003

Any comments or code appreciated.

Tom Bryan
Systems Administrator
EDS

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Help with associative arrays/hashes.

2003-06-06 Thread Scot Robnett
I suspect you mean %NOMINET rather than NOMINET; if I'm mistaken let me
know. But here's one way to do it:

foreach my $key(keys(%NOMINET)) {
 print "$key = $NOMINET{$key} \n";
}

or if you want to return the keys alphabetically:

foreach my $key(sort(keys(%NOMINET))) {
 print "$key = $NOMINET{$key} \n";
}

##

Given an associative array as the one given below:

NOMINET => {
  name=> 'omain Name:\s+(\S+)',
  registrant  => 'egistered For:\s*(.*?)\n',
  ips_tag => 'omain Registered By:\s*(.*?)\n',
  record_updated_date => 'Record last updated on\s*(.*?)\s+',
  record_updated_by   => 'Record last updated on\s*.*?\s+by\s+(.*?)\n',
  nameservers => 'listed in
order:[\s\n]+(\S+)\s.*?\n\s+(\S*?)\s.*?\n\s*\n',
  whois_updated   => 'database last updated at\s*(.*?)\n',
 },

How can I retrieve the values for each of the keys within this array?  I am
assuming with my perl program that these keys are getting filled,  because I
have specified that the whois server needs to use this parser format in its
response.

Pls help with any clues that you might have...

Thanks,

Kavita Chhabria
Systems Developer
Apogent Technologies
(269) 544-7515
[EMAIL PROTECTED]
BEGIN:VCARD
VERSION:2.1
N:Robnett;Scot
FN:Scot Robnett
ORG:inSite Internet Solutions
NOTE;ENCODING=QUOTED-PRINTABLE:Low cost web hosting, 50 MB disk space, easy and intuitive browser-based pag=
e builder and control panel, 2000 product shopping cart, contact management,=
 site promotion, and free tech support:=0D=0A=0D=0A	http://www.mawebcenters.=
com/insite2000
TEL;WORK;VOICE:(815) 206-2907
TEL;CELL;VOICE:(815) 790-9687
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;;Square West Center=0D=0A454 W. Jackson St.;Woodstock;IL;60098;United State=
s of America
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:Square West Center=0D=0A454 W. Jackson St.=0D=0AWoodstock, IL 60098=0D=0AUni=
ted States of America
URL;HOME:http://www.insiteful.tv
URL;WORK:http://www.insiteful.tv
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
REV:20030223T194915Z
END:VCARD


RE: coping files

2003-04-02 Thread Scot Robnett
use File::Copy

http://search.cpan.org/author/JHI/perl-5.8.0/lib/File/Copy.pm
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Unix/Linux question ...

2003-04-02 Thread Scot Robnett
Probably better off using opendir and readdir. They're built into Perl and
you don't need to launch another child process to get the results you want.
This worked for me, and should work on Windoze or *NIX. I created 4
directories: DMAR, DMAX, BFMAR, BFMAX.

#
#!C:\Perl\bin\perl.exe

my $dir = 'C:\Documents and Settings\SRobnet\Desktop';
my @ary = ();
opendir(MYDIRECTORY, $dir) or die "Can\'t open directory $dir: $!";
@ary = grep { (/^DMA/)||(/^BFMA/) && -d "$dir/$_" } readdir(MYDIRECTORY);
closedir(MYDIRECTORY);

foreach my $item(@ary) {
 print $item . "\n";
}

1;
#

Results:

C:\Documents and Settings\SRobnet\Desktop>perl dir.pl
DMAR
DMAX
BFMAR
BFMAX

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Converting JPG to TIF ...

2003-04-02 Thread Scot Robnett
Something like this may work

#!/usr/bin/perl -w

use Image::Magick;
my ($image, $foo);
$image = Image::Magick->new;
$foo = $image->Read('image.jpg');
$foo = $image->Write('image.tif');

# Image::Magick (PerlMagick) module found here:
# http://www.imagemagick.org/www/perl.html

# Also, you must have ImageMagick 5.4.3 or above and
# Perl 5.005_02 or above installed on the system.

# This works on UNIX but I think it may work on 
# Windows too. You can get ImageMagick for Windows here:
# ftp://ftp.imagemagick.org/pub/ImageMagick/windows/

# Scot R.
# inSite
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Removing all \n in a text file.

2003-03-31 Thread Scot Robnett
Matt,

That was assuming $/ is set to \n as per "the usual", should have clarified
that. I didn't see any need to use the regex in that case, but there's
always more than one way to do it. I think chomp handles line feed
characters as well as newlines, but not 100% positive about that.

Scot R.
inSite


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Ross Matt-QMR000
Sent: Monday, March 31, 2003 10:58 PM
To: [EMAIL PROTECTED]
Subject: RE: Removing all \n in a text file.


Same as Scot but instead of Chomp
 $_ =~ s/\n//g;
that way if you would not chomp a character that you want to keep.
Later,
Matt

-Original Message-
From: Scot Robnett [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 10:52 PM
To: Daniel Gross; [EMAIL PROTECTED]
Subject: RE: Removing all \n in a text file.


That seems like a lot of work when you could just do something like what's
shown below. And I'm sure someone is going to follow with something shorter
and cleaner than this one, but it's a start. I did test it and it worked.


#!C:\Perl\bin\perl.exe -w

use strict;
my $file = 'C:\path\to\file.txt';
my @ary  = ();

open(FILE, "<$file");
@ary = ;
close(FILE);

open(FILE, ">$file");
for(@ary) {
 chomp;
 print FILE $_;
}
close(FILE);

print "Newlines removed. \n";



#
This was the file before:
#
line1
line2
line3
line4
line5
line6
line7
line8
line9
line10


#
This was the file after:
#
line1line2line3line4line5line6line7line8line9line10



Scot R.
inSite


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
BEGIN:VCARD
VERSION:2.1
N:Robnett;Scot
FN:Scot Robnett
ORG:inSite Internet Solutions
NOTE;ENCODING=QUOTED-PRINTABLE:Low cost web hosting, 50 MB disk space, easy and intuitive browser-based pag=
e builder and control panel, 2000 product shopping cart, contact management,=
 site promotion, and free tech support:=0D=0A=0D=0A	http://www.mawebcenters.=
com/insite2000
TEL;WORK;VOICE:(815) 206-2907
TEL;CELL;VOICE:(815) 790-9687
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;;Square West Center=0D=0A454 W. Jackson St.;Woodstock;IL;60098;United State=
s of America
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:Square West Center=0D=0A454 W. Jackson St.=0D=0AWoodstock, IL 60098=0D=0AUni=
ted States of America
URL;HOME:http://www.insiteful.tv
URL;WORK:http://www.insiteful.tv
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
REV:20030223T194915Z
END:VCARD


RE: Removing all \n in a text file.

2003-03-31 Thread Scot Robnett
That seems like a lot of work when you could just do something like what's
shown below. And I'm sure someone is going to follow with something shorter
and cleaner than this one, but it's a start. I did test it and it worked.


#!C:\Perl\bin\perl.exe -w

use strict;
my $file = 'C:\path\to\file.txt';
my @ary  = ();

open(FILE, "<$file");
@ary = ;
close(FILE);

open(FILE, ">$file");
for(@ary) {
 chomp;
 print FILE $_;
}
close(FILE);

print "Newlines removed. \n";



#
This was the file before:
#
line1
line2
line3
line4
line5
line6
line7
line8
line9
line10


#
This was the file after:
#
line1line2line3line4line5line6line7line8line9line10



Scot R.
inSite


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Not matching a dot

2003-03-10 Thread Scot Robnett
A few issues on the regex:

1. Dot "." has special meaning, so escape it.
   Without the escape, it means "Match any
   single character with the exception of a
   new line character."

2. The filename may contain more than one dot,
   so tell the regex if the file contains one
   or more dots, we'll skip it and just print 
   the "undotted" filenames.

3. Are you sure you want to skip all files
   with dots in the name? That would skip files
   like "index.html" and "data.txt". If you just
   want to skip the ones that start with a dot,
   use ^ just like you did.



#!/usr/bin/perl -w

use strict;

my $start_dir = $ARGV[0] || ".";
use File::Find;
print "Temp file list:\n";
find sub {
  return unless -f;
  my $file=$File::Find::name;
  unless( $_ =~ /[\.]+/) {
print "$file\n";
  }
}, $start_dir;


BEGIN:VCARD
VERSION:2.1
N:Robnett;Scot
FN:Scot Robnett
ORG:inSite Internet Solutions
NOTE;ENCODING=QUOTED-PRINTABLE:Low cost web hosting, 50 MB disk space, easy and intuitive browser-based pag=
e builder and control panel, 2000 product shopping cart, contact management,=
 site promotion, and free tech support:=0D=0A=0D=0A	http://www.mawebcenters.=
com/insite2000
TEL;WORK;VOICE:(815) 206-2907
TEL;CELL;VOICE:(815) 790-9687
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;;Square West Center=0D=0A454 W. Jackson St.;Woodstock;IL;60098;United State=
s of America
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:Square West Center=0D=0A454 W. Jackson St.=0D=0AWoodstock, IL 60098=0D=0AUni=
ted States of America
URL;HOME:http://www.insiteful.tv
URL;WORK:http://www.insiteful.tv
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
REV:20030223T194915Z
END:VCARD


RE: Having problems with Net::Telnet

2003-03-03 Thread Scot Robnett
Show us the code?




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Lupi, Guy
Sent: Monday, March 03, 2003 5:22 PM
To: '[EMAIL PROTECTED]'
Subject: Having problems with Net::Telnet


Please excuse me if this is an extremely basic question, this is my first
post and I am a beginner, but I can't seem to get Net::Telnet to work.  I am
getting the following error when I try to run a script using the Net::Telnet
module.

Can't locate object method "new" via package "Net::Telnet" (perhaps you
forgot t
o load "Net::Telnet"?) at telnet.txt line 2.

I have looked on the net, and I found some advice, but nothing I do seems to
work.  I ran the libnet.cfg file, and ran ppm to install net-telnet, and
telnet.pm is definitely in my Perl installation.  I think my code is
correct, I copied it exactly from a website and simply replaced their IP
address with my own.  I am running ActivePerl on a Windows XP workstation.
I am a beginner, so be gentle :).



Guy H. Lupi


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
BEGIN:VCARD
VERSION:2.1
N:Robnett;Scot
FN:Scot Robnett
ORG:inSite Internet Solutions
NOTE;ENCODING=QUOTED-PRINTABLE:Low cost web hosting, 50 MB disk space, easy and intuitive browser-based pag=
e builder and control panel, 2000 product shopping cart, contact management,=
 site promotion, and free tech support:=0D=0A=0D=0A	http://www.mawebcenters.=
com/insite2000
TEL;WORK;VOICE:(815) 206-2907
TEL;CELL;VOICE:(815) 790-9687
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;;Square West Center=0D=0A454 W. Jackson St.;Woodstock;IL;60098;United State=
s of America
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:Square West Center=0D=0A454 W. Jackson St.=0D=0AWoodstock, IL 60098=0D=0AUni=
ted States of America
URL;HOME:http://www.insiteful.tv
URL;WORK:http://www.insiteful.tv
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
REV:20030223T194915Z
END:VCARD


RE: Help with HTML::Parser

2003-02-24 Thread Scot Robnett
Use ppm to verify your installation is up to date.

C:\WINNT\SYSTEM32> ppm
PPM interactive shell (2.1.5) - type 'help'
for available commands.
PPM> verify HTML::Parser
Package 'HTML-Parser' is up to date.
PPM>

If it says that an upgrade is available, do another install.

PPM> install HTML::Parser

-
Scot Robnett
inSite Internet Solutions
[EMAIL PROTECTED]



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Malcolm Debono
Sent: Monday, February 24, 2003 3:50 PM
To: Scot Robnett; [EMAIL PROTECTED]
Subject: Re: Help with HTML::Parser


Thanks for emails.
Can you please let me know how to uninstall the HTML::Parser.
Then I will reinstall it.

This email may be duplicated.

Malcolm

- Original Message -
From: "Scot Robnett" <[EMAIL PROTECTED]>
To: "Malcolm Debono" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Monday, February 24, 2003 3:11 PM
Subject: RE: Help with HTML::Parser


> Is HTML::Parser in your Perl path? If not, right underneath your shebang
> line, do
>
> BEGIN {
>  unshift(@INC,"/path/to/HTML")
>  # Parser.pm is under the HTML directory and
>  # Perl will automatically find recursively
> }
>
> Otherwise I think there may be an issue with your HTML::Parser
installation
> (missing files, files in the wrong place, etc.)
>
> -
> Scot Robnett
> inSite Internet Solutions
> [EMAIL PROTECTED]
>
>
>
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of
> Malcolm Debono
> Sent: Monday, February 24, 2003 5:58 AM
> To: [EMAIL PROTECTED]
> Subject: Help with HTML::Parser
>
>
> Help please.
> I am getting an error. I don't know if the code is right 
>
> Can't locate auto/HTML/Parser/.al in @INC (@INC contains: C:/Perl/lib
> C:/Perl/site/lib .) at C:/Perl/site/lib/HTML/Parser.pm line 82
>
> or if I use ('$content') #line 22
>
> Can't locate auto/HTML/Parser/$content.al in @INC (@INC contains:
> C:/Perl/lib C:/Perl/site/lib .) at C:/Perl/site/lib/HTML/Parser.pm line 82
>
> The list.dat is looking up url's ie:
> http://yes/testextract.htm
> http://yes/lnks/okay.html
>
> 
>
> #!/usr/bin/perl
> use strict;
> use HTML::Parser();
>
> # Absolute path to list.dat file:
> my $infile = "/Inetpub/wwwroot/cgi-bin/extracthtml/list.dat";
>
> # Absolute path to extract.dat file:
> my $outfile = "/Inetpub/wwwroot/cgi-bin/extracthtml/extract2.dat";
>
> my ($content,$url);
>
> open PAGE, "<$infile" or die "Can't open $infile: $!";
> while () {
> chomp;
> next if not /http/i;
> &getinfo ($_);
> }
> close PAGE;
>
> open(OUTFILE,">$outfile") || die("can not open file because $!");
> my $p = HTML::Parser->new($content);#line 22
> $p->handler( start => \&start_handler, 'tag, attr' );
> $p->parse_file('$content') || die $!;
> close(OUTFILE);
>
>
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>  -
>
> sub getinfo {
> my $url = shift;
> use LWP::Simple 'get';
>
> my $content = get ($url);
> return 0 if not $content;
>
> }
>
>
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>  -
>
> sub start_handler {
> if($_[0] eq 'input') {
>  print OUTFILE $_[1]{name},"\t",$_[1]{value},"\n";
> }
> }
>
>
> __END__
>
>
>
>
> ___
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
> ___
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
>


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
BEGIN:VCARD
VERSION:2.1
N:Robnett;Scot
FN:Scot Robnett
ORG:inSite Internet Solutions
NOTE;ENCODING=QUOTED-PRINTABLE:Low cost web hosting, 50 MB disk space, easy and intuitive browser-based pag=
e builder and control panel, 2000 product shopping cart, contact management,=
 site promotion, and free tech support:=0D=0A=0D=0A	http://www.mawebcenters.=
com/insite2000
TEL;WORK;VOICE:(815) 206-2907
TEL;CELL;VOICE:(815) 790-9687
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;;Square West Center=0D=0A454 W. Jackson St.;Woodstock;IL;60098;United State=
s of America
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:Square West Center=0D=0A454 W. Jackson St.=0D=0AWoodstock, IL 60098=0D=0AUni=
ted States of America
URL;HOME:http://www.insiteful.tv
URL;WORK:http://www.insiteful.tv
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
REV:20030223T194915Z
END:VCARD


RE: Help with HTML::Parser

2003-02-24 Thread Scot Robnett
Sorry, did a no-no and forgot the semicolon. Should have been

BEGIN {
 unshift(@INC,"/path/to/HTML");
}

Haven't finished my coffee yet this morning.

-----
Scot Robnett
inSite Internet Solutions
[EMAIL PROTECTED]




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Scot Robnett
Sent: Monday, February 24, 2003 9:11 AM
To: Malcolm Debono; [EMAIL PROTECTED]
Subject: RE: Help with HTML::Parser


Is HTML::Parser in your Perl path? If not, right underneath your shebang
line, do

BEGIN {
 unshift(@INC,"/path/to/HTML")
 # Parser.pm is under the HTML directory and
 # Perl will automatically find recursively
}

Otherwise I think there may be an issue with your HTML::Parser installation
(missing files, files in the wrong place, etc.)

-
Scot Robnett
inSite Internet Solutions
[EMAIL PROTECTED]



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Malcolm Debono
Sent: Monday, February 24, 2003 5:58 AM
To: [EMAIL PROTECTED]
Subject: Help with HTML::Parser


Help please.
I am getting an error. I don't know if the code is right 

Can't locate auto/HTML/Parser/.al in @INC (@INC contains: C:/Perl/lib
C:/Perl/site/lib .) at C:/Perl/site/lib/HTML/Parser.pm line 82

or if I use ('$content') #line 22

Can't locate auto/HTML/Parser/$content.al in @INC (@INC contains:
C:/Perl/lib C:/Perl/site/lib .) at C:/Perl/site/lib/HTML/Parser.pm line 82

The list.dat is looking up url's ie:
http://yes/testextract.htm
http://yes/lnks/okay.html



#!/usr/bin/perl
use strict;
use HTML::Parser();

# Absolute path to list.dat file:
my $infile = "/Inetpub/wwwroot/cgi-bin/extracthtml/list.dat";

# Absolute path to extract.dat file:
my $outfile = "/Inetpub/wwwroot/cgi-bin/extracthtml/extract2.dat";

my ($content,$url);

open PAGE, "<$infile" or die "Can't open $infile: $!";
while () {
chomp;
next if not /http/i;
&getinfo ($_);
}
close PAGE;

open(OUTFILE,">$outfile") || die("can not open file because $!");
my $p = HTML::Parser->new($content);#line 22
$p->handler( start => \&start_handler, 'tag, attr' );
$p->parse_file('$content') || die $!;
close(OUTFILE);

#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 -

sub getinfo {
my $url = shift;
use LWP::Simple 'get';

my $content = get ($url);
return 0 if not $content;

}

#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 -

sub start_handler {
if($_[0] eq 'input') {
 print OUTFILE $_[1]{name},"\t",$_[1]{value},"\n";
}
}


__END__




___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Help with HTML::Parser

2003-02-24 Thread Scot Robnett
Is HTML::Parser in your Perl path? If not, right underneath your shebang
line, do

BEGIN {
 unshift(@INC,"/path/to/HTML")
 # Parser.pm is under the HTML directory and
 # Perl will automatically find recursively
}

Otherwise I think there may be an issue with your HTML::Parser installation
(missing files, files in the wrong place, etc.)

-
Scot Robnett
inSite Internet Solutions
[EMAIL PROTECTED]



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Malcolm Debono
Sent: Monday, February 24, 2003 5:58 AM
To: [EMAIL PROTECTED]
Subject: Help with HTML::Parser


Help please.
I am getting an error. I don't know if the code is right 

Can't locate auto/HTML/Parser/.al in @INC (@INC contains: C:/Perl/lib
C:/Perl/site/lib .) at C:/Perl/site/lib/HTML/Parser.pm line 82

or if I use ('$content') #line 22

Can't locate auto/HTML/Parser/$content.al in @INC (@INC contains:
C:/Perl/lib C:/Perl/site/lib .) at C:/Perl/site/lib/HTML/Parser.pm line 82

The list.dat is looking up url's ie:
http://yes/testextract.htm
http://yes/lnks/okay.html



#!/usr/bin/perl
use strict;
use HTML::Parser();

# Absolute path to list.dat file:
my $infile = "/Inetpub/wwwroot/cgi-bin/extracthtml/list.dat";

# Absolute path to extract.dat file:
my $outfile = "/Inetpub/wwwroot/cgi-bin/extracthtml/extract2.dat";

my ($content,$url);

open PAGE, "<$infile" or die "Can't open $infile: $!";
while () {
chomp;
next if not /http/i;
&getinfo ($_);
}
close PAGE;

open(OUTFILE,">$outfile") || die("can not open file because $!");
my $p = HTML::Parser->new($content);#line 22
$p->handler( start => \&start_handler, 'tag, attr' );
$p->parse_file('$content') || die $!;
close(OUTFILE);

#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 -

sub getinfo {
my $url = shift;
use LWP::Simple 'get';

my $content = get ($url);
return 0 if not $content;

}

#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 -

sub start_handler {
if($_[0] eq 'input') {
 print OUTFILE $_[1]{name},"\t",$_[1]{value},"\n";
}
}


__END__




___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Technical Arguments for using Perl in a web environment...

2003-01-23 Thread Scot Robnett
Can I be the first to ask this not to become a M$ lovers vs. M$ haters
sparring match? Let's all help each other here. Thanks and I'll shut up now.
:)

-
Scot Robnett
inSite Internet Solutions
[EMAIL PROTECTED]



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Tillman, James
Sent: Thursday, January 23, 2003 9:39 AM
To: 'Herbold, John W.'; [EMAIL PROTECTED]
Subject: RE: Technical Arguments for using Perl in a web environment...


> -Original Message-
> From: Herbold, John W. [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 23, 2003 10:32 AM
> To: [EMAIL PROTECTED]
> Subject: RE: Technical Arguments for using Perl in a web
> environment...
>
>
[...]
> I just
> believe that any thing MS makes is faster ;-)

???  You've got to be kidding, right?

jpt
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: nslookups

2003-01-15 Thread Scot Robnett



You may be able 
to just do that with a system call, but you can also use Net::Nslookup. This is 
from CPAN at http://search.cpan.org/author/DARREN/Net-Nslookup-1.11/lib/Net/Nslookup.pm :
 
use 
Net::Nslookup;my @addrs = nslookup $host;my @mx = nslookup(qtype => 
"MX", domain => "perl.org");my $a  = nslookup(host => 
"use.perl.org", type => "A");my @mx = nslookup(domain => "perl.org", 
type => "MX");my @ns = nslookup(domain => "perl.org", type => 
"NS");
Scot 
Robnett
inSite Internet 
Solutions
[EMAIL PROTECTED]
 

  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]]On Behalf Of 
  Fontenot, PaulSent: Wednesday, January 15, 2003 12:44 
  PMTo: [EMAIL PROTECTED]Subject: 
  nslookups
  
  Is there a module etc… for perl 
  that can perform an nslookup?


RE: Puzzle of the Week

2002-12-04 Thread Scot Robnett
I'm sure there are more elegant ways to do this, and I'm sure they'll be
coming through the list shortly, but here's an option:


my @days =('Sunday','Monday','Tuesday',
'Wednesday','Thursday','Friday','Saturday');
foreach my $text(@days) {
 $text =~ s/day/day\'s Games/;
}


-
Scot Robnett
inSite Internet Solutions
[EMAIL PROTECTED]


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Erich C. Beyrent
Sent: Wednesday, December 04, 2002 10:34 AM
To: [EMAIL PROTECTED]
Subject: Puzzle of the Week


Hey everyone,

I have a string of data that I am parsing that looks like this:

# Replace all of the apostrophed days of week
if ($text =~ s/(Sunday's)|(Sunday's Games)/)
{
$day = "Sunday";
$text =~ s/(Sunday's)|(Sunday's Games)//;
}
elsif ($text =~ s/(Monday's)|(Monday's Games)/)
{
$day = "Monday";
$text =~ s/(Monday's)|(Monday's Games)//;
}
elsif ($text =~ s/(Tuesday's)|(Tuesday's Games)/)
{
$day = "Tuesday";
$text =~ s/(Tuesday's)|(Tuesday's Games)//;
}
elsif ($text =~ s/(Wednesday's)|(Wednesday's Games)/)
{
$day = "Wednesday";
$text =~ s/(Wednesday's)|(Wednesday's Games)//;
}
elsif ($text =~ s/(Thursday's)|(Thursday's Games)/)
{
$day = "Thursday";
$text =~ s/(Thursday's)|(Thursday's Games)//;
}
elsif ($text =~ s/(Friday's)|(Friday's Games)/)
{
$day = "Friday";
$text =~ s/(Friday's)|(Friday's Games)//;
}
elsif ($text =~ s/(Saturday's)|(Saturday's Games)/)
{
$day = "Saturday";
$text =~ s/(Saturday's)|(Saturday's Games)//;
}

Surely there is a more efficient and cleaner way to code this.  Any and all
assistance is GREATLY appreciated.

Thanks!

-Erich-

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Email

2002-11-08 Thread Scot Robnett
use CGI;
use Win32::OLE;
use Win32::OLE::Const("Microsoft CDO for NTS 1.2 Library");

my $q = new CGI;
my %params = $q->Vars; # May not work with older
 # versions of CGI.pm but it's
 # an exceptionally easy way of
 # getting the nv pairs into a hash.
 # Use caution on params containing
 # multiple values, you'll have to
 # use array refs and that would
 # require a little more code

my $user_email = $params{'email'}; # if form field named 'email'
my $body = "";

foreach my $key(keys(%params)) {
 $body .= "$key = $params{$key}\n"; # build the mail body
}

my $from = $user_email;
my $to = 'your_name\@your_site.com';
my $subject = 'Hi';
my $objMail = Win32::OLE->new("CDONTS.Newmail");
$objMail->Send($from,$to,$subject,$body,CdoHigh);


-
Scot Robnett
inSite Internet Solutions
[EMAIL PROTECTED]



-Original Message-
From: [EMAIL PROTECTED]
[mailto:perl-win32-users-admin@;listserv.ActiveState.com]On Behalf Of
Krishna, Hari
Sent: Friday, November 08, 2002 12:24 PM
To: 'Mohanty, Debi (MED, TCS)';
[EMAIL PROTECTED]
Subject: RE: Email


use CDONTS. Thats the best way to do it..PERL working is little bit of more
coding..

-Original Message-
From: Mohanty, Debi (MED, TCS) [mailto:Debi.Mohanty@;med.ge.com]
Sent: Friday, November 08, 2002 1:21 PM
To: [EMAIL PROTECTED]
Subject: Email


Hi,
Here I want to generate a mail, on clicking of a submit button
on my web page.
Basically my requirement is as : -

1. Enter a value in a text box.
2. Click on the Submit button present on the web page.

On clicking of this submit button I want to generate a email, which will
send the value entered in the text box as a body message to a particular
address.

Here I had done the coding for my WebPages in Java.

Please suggest me how could I implement a perl script which will do the
email options in it.

Thanks&Regards
Debi



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: DESPERATE

2002-09-18 Thread Scot Robnett

This is untested, but what about copying the files to the new directory
first and then deleting them? I'm also not sure, but you might have to do
these operations separately rather than both of them inside the same while
loop. I don't know if Perl cares which one of the operations it does first
inside the while statement and you certainly don't want to delete before you
copy. :-)

my $dir = 'D:\ftproot\edi\inbox';
my $copydir = 'D:\ftproot\edi\tmp';
opendir(INVOICES,$dir) or die "$! \n";
while (my $invoice = readdir(INVOICES))
{
 system('copy /Y $_ $copydir\\$_');
 # suppress warnings, and this is
 # assuming you want to copy directories
 # as well as files; if not, you'll need
 # to use the -f switch to assure you
 # copy only files

 system('del /F/S/Q $_');
 # force deletion of read-only files,
 # delete recursively, suppress warnings
}
closedir(INVOICES);

-
Scot Robnett
inSite Internet Solutions
[EMAIL PROTECTED]
http://www.insiteful.tv




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
[EMAIL PROTECTED]
Sent: Tuesday, September 10, 2002 2:34 AM
To: [EMAIL PROTECTED]
Subject: DESPERATE



I'm really desperate here.
I have a list of files in:
D:\ftproot\edi\inbox\

I want to move these files to :
D:\ftproot\edi\tmp\
before I can start processing.


So I am using the code below but it doesn't work.
I know I'm not eligible, but will you please help.


opendir(INVOICES,'D:\ftproot\edi\test') || die "cannot open invoice: $!";

while ($invoice = readdir(INVOICES))
 {($invoice
  rename('D:\ftproot\edi\test\$invoice','D:\ftproot\edi\tmp\$invoice');
 }
closedir(INVOICES) || die "can't close  INVOICES: $!";


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: if & unless inverses ???

2002-08-20 Thread Scot Robnett

To me, it looks redundant. It's repetitive. It says the same thing over and
over. ;-)

Scot R.
inSite



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Michael D. Schleif
Sent: Tuesday, August 20, 2002 11:23 AM
To: Perl-Win32-Users List Service
Subject: if & unless inverses ???



Cleaning up some inherited code and I ran into this:

if ( ! $m_rkCfgTable->{Trace} eq "true") {
$m_nTraceLevelMin = -1;
return 0;
}

For the life of me, I cannot fathom why this is *not* identical?

unless ($m_rkCfgTable->{Trace} eq "true") {
$m_nTraceLevelMin = -1;
return 0;
}

What am I missing?

--

Best Regards,

mds
mds resource
888.250.3987

Dare to fix things before they break . . .

Our capacity for understanding is inversely proportional to how much we
think we know.  The more I know, the more I know I don't know . . .
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Update Info on retrieving password age from Unix

2002-08-20 Thread Scot Robnett

Sorry, I also meant to suggest a module such as Net::Telnet to log in to the
UNIX box. Although, if you can use Net::SSH, you're better off running a
secure login session (Telnet sends the login password in unencrypted ascii).

Net::SSH example from CPAN:

use Net::SSH qw(ssh issh sshopen2 sshopen3);

ssh('user@hostname', $command);

issh('user@hostname', $command);

ssh_cmd('user@hostname', $command);

ssh_cmd( {
 user => 'user',
 host => 'host.name',
 command => 'command',
 args => [ '-arg1', '-arg2' ],
 stdin_string => "string\n",
 });

sshopen2('user@hostname', $reader, $writer, $command);

sshopen3('user@hostname', $writer, $reader, $error, $command);






-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Peter
Eisengrein
Sent: Tuesday, August 20, 2002 10:23 AM
To: 'Oliver Wayne Contr AETC/DOXD'; Perl-Win32-Users (E-mail)
Subject: RE: Update Info on retrieving password age from Unix


I'm not familiar with what you are trying to do, but if you need to emulate
a login and do stuff as that user, you might want to check out Net::Telnet
or, if it's not 'telnet' that you're after you might try IO::Socket.


-Original Message-
From: Oliver Wayne Contr AETC/DOXD [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 20, 2002 09:14
To: Perl-Win32-Users (E-mail)
Subject: Update Info on retrieving password age from Unix


I am trying to write a script in Perl that will query the password age of my
Unix users and then lock their NT account if the password age on Unix is
over a certain limit. I can handle all the NT code, but I am not sure how to
retrieve the information from the Unix system. Any suggestions would be
welcome. I am still learning Perl so any code examples with explanations
would be appreciated.
More specifically, I want to query a Solaris Unix NIS+ system and retreive a
list of users and their password age from a Windows NT 4 box. I want to use
this information to lock their NT accounts if their password is over a
certain age on the Unix system. I have an account that allows access to this
information. What would be the best method to establish a connection and
then pull the information back to be processed on my NT box?


Wayne E. Oliver
System Administrator
AETC GCCS C4 Systems
DSN 487-7678
Comm: (210) 652-7678

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Update Info on retrieving password age from Unix

2002-08-20 Thread Scot Robnett

If your system is set to use pw_age in the /etc/passwd configuration,
something similar to this may work to get the age of the user's password. If
the pw_age option isn't set, then I'm not sure. This example is for a single
user only; you'd have to do something to iterate over each account.

#!/usr/bin/perl

use Config;
use strict;

# Get list of config params and values

 my %sig_num;
 my @sig_name;
 my @names = split ' ', $Config{sig_name};
 @sig_num{@names} = split ' ', $Config{sig_num};


# See if PWAGE is over 30 days, if so, force change

  if($sig_num{'PWAGE'} > 30)) {
   # Call passwd maintenance subroutine here
  }


I couldn't test it on my virtual FreeBSD account because pw_age isn't set,
but I was able to get all the other key=value pairs by doing

foreach my $key(keys(%sig_num)) {
 print $sig_num{$key};
}


HTH,

Scot R.
inSite



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Oliver
Wayne Contr AETC/DOXD
Sent: Tuesday, August 20, 2002 8:14 AM
To: Perl-Win32-Users (E-mail)
Subject: Update Info on retrieving password age from Unix


I am trying to write a script in Perl that will query the password age of my
Unix users and then lock their NT account if the password age on Unix is
over a certain limit. I can handle all the NT code, but I am not sure how to
retrieve the information from the Unix system. Any suggestions would be
welcome. I am still learning Perl so any code examples with explanations
would be appreciated.
More specifically, I want to query a Solaris Unix NIS+ system and retreive a
list of users and their password age from a Windows NT 4 box. I want to use
this information to lock their NT accounts if their password is over a
certain age on the Unix system. I have an account that allows access to this
information. What would be the best method to establish a connection and
then pull the information back to be processed on my NT box?


Wayne E. Oliver
System Administrator
AETC GCCS C4 Systems
DSN 487-7678
Comm: (210) 652-7678

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Getting cgis to work

2002-08-15 Thread Scot Robnett

That example should help illustrate my point

With PWS:


* Use PWS to flag the cgi-bin folder (or whatever folder
you use for your scripts) as executable.

* Make sure that the following string values exist in
the registry at the indicated key:[HKEY_LOCAL_MACHINE\System\
CurrentControlSet\Services\W3SVC\Parameters\Script Map]
.pl=c:\perl\bin\perl.exe %s %s
.cgi=c:\perl\bin\perlis.dll



With Apache:


Set 'ScriptAlias ' in httpd.conf.



Cheers,

Scot R.
inSite





-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Brian Steele
Sent: Thursday, August 15, 2002 4:29 PM
To: Perl Users
Subject: Re: Getting cgis to work


To get Perl scripts to work with PWS:

1. Install Perl (of course)
2. Use PWS to flag the cgi-bin folder (or whatever folder you use for your
scripts) as executable.
3. Make sure that the following string values exist in the registry at the
indicated key:
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3SVC\Parameters\Scrip
t Map]
.pl=c:\perl\bin\perl.exe %s %s
.cgi=c:\perl\bin\perlis.dll

This will map cgi files to perlIS and pl files to perl.exe.  Why would you
want to do this?  Well, you can debug using a pl file (errors sent to the
browser), then rename to cgi for production (errors sent to log file in
C:\Perl\bin).

The config's a bit different for IIS4 and higher.

Brian
(who's been using Perl with PWS for as long as he can remember - Apache?
ptui! :-)

- Original Message -
From: "$Bill Luebkert" <[EMAIL PROTECTED]>
To: "Perl Users" <[EMAIL PROTECTED]>
Sent: Thursday, August 15, 2002 3:33 PM
Subject: Re: Getting cgis to work


> Scot Robnett wrote:
> > On Windows, the shebang
line
> > is almost a frivolity - as long as the script has a .pl or .cgi
extension
> > (and you have .cgi associated with perl.exe), it should run. I'm not
> > suggesting to get rid of that line, because it would be bad style - but
> > Win32 doesn't really care about it.
>
> It's not Windoze per se, it's because PWS and IIS don't use the shebang
line to
> find the Perl exe - they use the file ext (.pl/.cgi) to find the
associated
> application.
>
> Apache and many Win32 shells *do* use the shebang line as does Perl itself
> to pick up the switches.
>
> --
>,-/-  __  _  _ $Bill Luebkert   ICQ=162126130
>   (_/   /  )// //   DBE Collectibles   Mailto:[EMAIL PROTECTED]
>/ ) /--<  o // //  http://dbecoll.tripod.com/ (Free site for Perl)
> -/-' /___/_<_http://www.todbe.com/
>
> ___
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Getting cgis to work

2002-08-15 Thread Scot Robnett

Thanks for the clarification. Although, the reason PWS and IIS don't use the
shebang line to find the perl executable is exactly the same reason Windows
doesn't use the MIME type to open other binaries. Everything is based on
file associations with extensions. You're right, of course...but the
underlying issue is still a combination of the PWS & IIS servers *and* the
OS itself.

It's probably just semantic anyway. He should still use Apache. ;-)

Scot R.
inSite


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
$Bill Luebkert
Sent: Thursday, August 15, 2002 2:34 PM
To: Perl Users
Subject: Re: Getting cgis to work


Scot Robnett wrote:
> On Windows, the shebang
line
> is almost a frivolity - as long as the script has a .pl or .cgi extension
> (and you have .cgi associated with perl.exe), it should run. I'm not
> suggesting to get rid of that line, because it would be bad style - but
> Win32 doesn't really care about it.

It's not Windoze per se, it's because PWS and IIS don't use the shebang line
to
find the Perl exe - they use the file ext (.pl/.cgi) to find the associated
application.

Apache and many Win32 shells *do* use the shebang line as does Perl itself
to pick up the switches.

--
   ,-/-  __  _  _ $Bill Luebkert   ICQ=162126130
  (_/   /  )// //   DBE Collectibles   Mailto:[EMAIL PROTECTED]
   / ) /--<  o // //  http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_http://www.todbe.com/

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Getting cgis to work

2002-08-15 Thread Scot Robnett

I believe that PWS requires that you place all CGIs in its own scripts
directory, unless you explicitly set your preferences otherwise. As long as
the scripts are in the correct place and PWS is running, chances are that
your 500 errors are a result of something else. On Windows, the shebang line
is almost a frivolity - as long as the script has a .pl or .cgi extension
(and you have .cgi associated with perl.exe), it should run. I'm not
suggesting to get rid of that line, because it would be bad style - but
Win32 doesn't really care about it.

Some advice:

- Use Carp and send fatals to the
  browser. You're not going to have
  helpful error logs with PWS on
  Win98, so printing the errors to
  the browser can help you decipher
  some of them.

- If you have to do this on Win98
  (shudder), then download a Win32
  copy of Apache 1.3.6 and use that.
  It's a better server, it's free,
  it's more configurable than PWS,
  it's stable, and it will be easier
  to make your sites portable to
  other platforms.

- Make sure the shopping cart script
  is made to be portable to Win32
  computers. It may try to do things
  like send e-mailed receipts using
  sendmail rather than a Windows-based
  mailer. The only way to really tell
  what's going on and *why* you're
  getting 500 errors is to see what
  those errors are. Perl and Apache
  make a great combo in reporting
  why errors happen, so I am once
  again suggesting the use of Apache
      and the sh*tcanning of PWS. :)


Scot Robnett
inSite Internet Solutions
[EMAIL PROTECTED]
http://www.insiteful.tv




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of m.
forster
Sent: Thursday, August 15, 2002 7:51 AM
To: Perl Users
Subject: Getting cgis to work


Hello. I am a complete newbie to perl (though familiar with other languages,
net and otherwise) and need some advice on getting perl cgis to work at all.
I have downloaded a shopping cart implementation from an Internet site and
cannot get anything other than "500 server errors".

My problem is this - I have set up the "personal web server" which comes
with Windows '98 and am using #! to point the cgis at perl. I have 2
or 3 questions I am seeking the answers to:

1) Will perl cgis work with the Windows web server so long as I have a perl
interpreter somewhere on my machine?

2) If so, can I just point the cgis with #! or do I need to do
something else?

3) I have downloaded and installed ActivePerl from O'Reilly's web site. I
received a .msi file which I used by running it to install perl. Do I point
the cgis to the perl.exe folder or the ActivePerl.msi folder?

Thanks in advance.

Mark Forster
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Split function

2002-07-15 Thread Scot Robnett

Would it be only semantic to escape the semicolon, or could it cause a
problem not to do so? I'm not asking to be picky, I really don't know. :)

Scot R.
inSite



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Ron
Grabowski
Sent: Monday, July 15, 2002 1:20 PM
To: [EMAIL PROTECTED]
Subject: Re: Split function


> I would like to split on either a double dash or a semi colon with one
> split using ( | ).

$_ = 'Hello-world;how--are--you;today';

print join "\n", split /--|;/;
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.372 / Virus Database: 207 - Release Date: 6/20/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.372 / Virus Database: 207 - Release Date: 6/20/2002

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: FILEHANDLE Problem

2002-07-15 Thread Scot Robnett

Check the capitalization of your filehandle. You open the filehandle as
FILE, then you try to find it with File. In the case of handles, case is
important.

You're doing this:

open(File, "../textfiles/test.txt");

Try this instead:

open(FILE, "../textfiles/test.txt");


HTH,

Scot Robnett
inSite Internet Solutions
[EMAIL PROTECTED]
http://www.insiteful.tv




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
steve silvers
Sent: Monday, July 15, 2002 11:59 AM
To: [EMAIL PROTECTED]
Subject: FILEHANDLE Problem


This is going to drive me nuts I have my test snippet below

#!/Perl

When I run this as shown below, I get the error: Invalid argument.

open(FILE, "d:\path_to\textfiles\test.txt") or die "Can't open $!";

if(eof(FILE)) {
print "IM EMPTY";
}
else {
while () {
chomp;
print;
}
}

When I run it as:
open(File, "../textfiles/test.txt")

I get file or directory not found. Now I know that all is well and the file
exists. I come out of the cgi-bin, and into the textfiles directory, and get
the test.txt file. But to no prevail.

Any suggestions greatly appreciated.
Steve.

_
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.372 / Virus Database: 207 - Release Date: 6/20/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.372 / Virus Database: 207 - Release Date: 6/20/2002

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Why my boss doesn't want Perl...

2002-04-26 Thread Scot Robnett

I'm also a *NIX fan myself. Microsoft sends mixed messages about Perl. Their
"official" position on it is that it is a robust language that deserves
support in Windows. However, do a search on msdn.com for "Perl," and the
only document you will come up with is the one that mentions their position
on it. There is not *one* document on MSDN regarding Perl implementation or
technical issues, even anything as simple as using PerlScript for active
server pages. Or, u...module installation. ;)

On the bright side, I haven't had any trouble with module installation using
ActivePerl 5.6.1 on Win2K, especially using PPM.

Then again, 'make install' on UNIX never gave me any fits either. And I
didn't have to restart that machine three times a day.

Scot Robnett
inSite Internet Solutions
[EMAIL PROTECTED]
[EMAIL PROTECTED]



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Dag
Richards
Sent: Friday, April 26, 2002 5:15 AM
Cc: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Re: Why my boss doesn't want Perl...


Ted Zeng wrote:
>
> I agree that Module installation is a nightmare with perl.
>
> ted
>
I think we all know that it is generally easier to code for Windows with
MS tools.
Its almost as though they were illegally leveraging a monopoly ...
They have gone to great lengths to erect barriers on their platforms to
keep other technology out, and to keep the addicted developer in.

If you want your products and services to be portable, you might want to
expend  the additional effort.

Yes module installation can be a pain, thank god for PERLApp.
--
Dag H. Richards ( No TITLE / No LETTERS )

The instructions said " ... use Windows 2000 or better ...".
So I installed Solaris 2.6.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Question

2002-04-18 Thread Scot Robnett
Title: Question



open(IN,"C\:\\text1.txt") or die "The following error occurred: $! 
\n";
 

  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]]On Behalf Of 
  Thiago BurinSent: Thursday, April 18, 2002 12:24 
  PMTo: [EMAIL PROTECTED]Subject: 
  Question
   Hi, 
   First of all, I would like to say  I am 
  a beginner. 
   Well, I have had a problem with the "open" 
  function. I wrote the following code: 
    --   open in , "c:\text1.txt" or 
  die "error reason: $!\n"; 
   I intended to open an existing file to write 
  on it. However, whenever I run this code an error message appear: "Invalid 
  Argument". I have tryied lots of changes in the code, but they weren't 
  successfull! Could anybody help me? Is it a library problem?
   Thanks, 
     Thiago 



RE: Filehandle and Widget printing.

2002-03-21 Thread Scot Robnett

Don't use system, use backticks to get the output of the command.

$foo = `cat foobar.txt`;
print FH $foo;



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Carter A. Thompson
Sent: Thursday, March 21, 2002 1:39 PM
To: Perl Users
Subject: Filehandle and Widget printing.




I have a Perl/Tk script that executes a system command.  What I'd like to
do is capture the output from this system command and redirect it to both
a filehandle and a text widget.

print FH "some string\n";# This prints to the logfile
$text->insert('end; "some string\n");# This prints to the text widget

system("cat foobar.txt");

Now, how to I get the output from the system command into the
filehandle and into the text widget?  I'm obviously overlooking
something.

I would do a "tee" but I don't think I can tee to a widget, or can I?

Any help is greatly appreciate.

Carter.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.333 / Virus Database: 187 - Release Date: 3/8/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.333 / Virus Database: 187 - Release Date: 3/8/2002

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: sending a file as an e-mail Attachment using Perl

2002-02-27 Thread Scot Robnett

I also use MIME::Lite. Works like a charm on *NIX, but I can't get it to
work with IIS on Win2K. I guess it's because my Windows host requires you to
use a CDO object instead of an actual executable mail program, since they're
an ASP shop.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Burak Gürsoy
Sent: Wednesday, February 27, 2002 12:45 PM
To: Bryan T. O'Malley; [EMAIL PROTECTED]
Subject: RE: sending a file as an e-mail Attachment using Perl


I use MIME::Lite


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Bryan
T. O'Malley
Sent: Wednesday, February 27, 2002 8:33 PM
To: [EMAIL PROTECTED]
Subject: sending a file as an e-mail Attachment using Perl


I have used net::smtp to send e-mail. Works great.


I am unable to figure out how to send a file as an e-mail attachment using
Perl.

Any pointers toward the solution to this problem will be greatly
appreciated.

Thank-you,

Bryan.






Bryan O'Malley, Actinide Analytical Chemistry, C-AAC
Quality and Information Management Team, MS G-740
PO Box 1663, MS G740, Los Alamos, NM 87545 Tel 505-665-1769
Fax (Lab Business Only): 505-665-4737
Personal Fax: (605)253-1459


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.325 / Virus Database: 182 - Release Date: 2/19/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.325 / Virus Database: 182 - Release Date: 2/19/2002

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: HELP !

2002-01-25 Thread Scot Robnett

John -

We run Active State Perl 5.6 on a Win2K server using IIS 5. I have had zero
problems like this; in fact Perl and ASP are working harmoniously on several
sites (scary ain't it? heh heh)

Let me get this straight...a Windows server is crashing and this is a unique
experience for them? ;-)

It is more likely the MySQL DB. If there is already an ODBC port in use by
SQL Server or Access, you may need to specify a port within DBI to make sure
you don't have a conflict.

-
Scot Robnett
inSite Internet Solutions
Square West Center
454 West Jackson Street
Woodstock, IL 60098
(815)206-2907 office
(815)342-6480 mobile
[EMAIL PROTECTED]
http://www.insiteful.tv




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Herbold, John W.
Sent: Friday, January 25, 2002 3:35 PM
To: Perl win32
Subject: HELP !


Quick question...

We are running Perl on IIS on a Win2K server.  Every once in a while all of
the services lock up in IIS, all websites and all ftp servers.  Some times
we can start the services back up, and some times we get the msg that the
port is in use.

Some of the network guys are starting to point the finger at Perl.  We are
using Perl to interface with MYSQL (same box) and DB2 databases (Mainframe).

Any ideas or suggestions, could it be my beloved Perl?

Thanks,

John W. Herbold Jr.
IS Specialist/DBA


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.317 / Virus Database: 176 - Release Date: 1/21/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.317 / Virus Database: 176 - Release Date: 1/21/2002

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: How to get text from javascript?

2001-12-21 Thread Scot Robnett

Books
-
Perl in a Nutshell
Programming Perl
Learning Perl
Perl/CGI Cookbook


On your computer

perldoc CGI.pm (in a shell)
C:\Perl\html\index.html (in your browser if on Windows)
/usr/bin/perl/html/index.html (in your browser if on *NIX)



Online
--
http://www.cpan.org

http://www.perl.com

http://www.perl.org

http://perl.oreilly.com

http://cgi.resourceindex.com/Documentation/Programming_Languages/Programming
_in_Perl/





-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
LSereb
Sent: Friday, December 21, 2001 8:00 PM
To: Scot Robnett; [EMAIL PROTECTED]
Subject: RE: How to get text from javascript?


You right, I use just get(URL).

Thank you, I'll try.
I tryes to find some help in documentation, and didn't
find.
Can you tell where I can find more.

Thanks,

Mark.
--- Scot Robnett <[EMAIL PROTECTED]> wrote:
> The question seems pretty vague, but I don't see any
> reason you just
> couldn't make the link a HERE document and then
> print it.
>
> my $link = <<"EOL";
>  foo
> 
> EOL
> print $link;
>
> Even if you include Javascript in the link, Perl
> will just happily print it
> out. You say all the information is gone when you
> try to save the document
> with Perl, so I'm assuming that you're not doing
> anything to help Perl know
> that there's Javascript coming.
>
> -
> Scot Robnett
> [EMAIL PROTECTED]
>
>
>
>
> -Original Message-
> From:
> [EMAIL PROTECTED]
>
[mailto:[EMAIL PROTECTED]]On
> Behalf Of
> LSereb
> Sent: Friday, December 21, 2001 2:57 PM
> To: [EMAIL PROTECTED]
> Subject: How to get text from javascript?
>
>
> Link is opening information window (java applet).
> When I'm trying to copy shortcut from link I get
> "javascript:void(0);", but when I copy and paste
>
>
> URL from the source into address bar, I can open and
> save page with needed information.
>
> When I'm saving the same page with perl, all
> information is gone.
>
> This is some URLs I can't to save correct:
>
>
http://www.dlis.dla.mil/CAGESearch/cagesearch_code.asp?CAGE=78286
>
http://www.dlis.dla.mil/CAGESearch/cagesearch_code.asp?CAGE=18350
>
http://www.dlis.dla.mil/CAGESearch/cagesearch_code.asp?CAGE=0YW97
>
> Is it some way to get text in such situation?
>
> Thanks, for any help.
>
> Mark
>
> __
> Do You Yahoo!?
> Send your FREE holiday greetings online!
> http://greetings.yahoo.com
> ___
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
>
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system
> (http://www.grisoft.com).
> Version: 6.0.306 / Virus Database: 166 - Release
> Date: 12/4/2001
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system
> (http://www.grisoft.com).
> Version: 6.0.306 / Virus Database: 166 - Release
> Date: 12/4/2001
>


__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.306 / Virus Database: 166 - Release Date: 12/4/2001

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.306 / Virus Database: 166 - Release Date: 12/4/2001

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: How to get text from javascript?

2001-12-21 Thread Scot Robnett

The question seems pretty vague, but I don't see any reason you just
couldn't make the link a HERE document and then print it.

my $link = <<"EOL";
 foo 
EOL
print $link;

Even if you include Javascript in the link, Perl will just happily print it
out. You say all the information is gone when you try to save the document
with Perl, so I'm assuming that you're not doing anything to help Perl know
that there's Javascript coming.

-
Scot Robnett
[EMAIL PROTECTED]




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
LSereb
Sent: Friday, December 21, 2001 2:57 PM
To: [EMAIL PROTECTED]
Subject: How to get text from javascript?


Link is opening information window (java applet).
When I'm trying to copy shortcut from link I get
"javascript:void(0);", but when I copy and paste


URL from the source into address bar, I can open and
save page with needed information.

When I'm saving the same page with perl, all
information is gone.

This is some URLs I can't to save correct:

http://www.dlis.dla.mil/CAGESearch/cagesearch_code.asp?CAGE=78286
http://www.dlis.dla.mil/CAGESearch/cagesearch_code.asp?CAGE=18350
http://www.dlis.dla.mil/CAGESearch/cagesearch_code.asp?CAGE=0YW97

Is it some way to get text in such situation?

Thanks, for any help.

Mark

__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.306 / Virus Database: 166 - Release Date: 12/4/2001

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.306 / Virus Database: 166 - Release Date: 12/4/2001

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: following threads via mail headers

2001-12-07 Thread Scot Robnett

Try Mail::Audit by Simon Cozens.

http://search.cpan.org/doc/SIMON/Mail-Audit-1.11/Audit.pm


Scot Robnett
inSite Internet Solutions
[EMAIL PROTECTED]



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Kuhnibert
Sent: Friday, December 07, 2001 12:35 PM
To: perlwin32
Subject: Re: following threads via mail headers


reposted, apparently there was a list problem ..

>
> hello folks,
>
> both outlook and netscape messanger (and probably many other mail clients)
> have a facility to follow threads, that is, if you send out a mail and
> receive multiple replies on this mail you can see all mails belonging to
> this thread linked to each other. i don't know how this works exacactly,
> there's an item "References:" in the mail-header which appears to be
linked
> to this facility - howevery even when lacking this attribute the client
> still finds mail which are (or better might be) related to each other,
maybe
> by means of the subject! anyway, what i want to do is to fetch mails from
a
> pop3 account vie perl and automagically put mails which belong to each
other
> in a separate folder of their own (i.e. bascially the same analysis the am
> mail clients are performing, just with a different reaction). any perl
> module which dealt with this before?
>
> TIA
> till
>
>

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.303 / Virus Database: 164 - Release Date: 11/24/2001

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.303 / Virus Database: 164 - Release Date: 11/24/2001

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: Writing Large Text Files Quickly

2001-11-30 Thread Scot Robnett

I second the "binmode" suggestion. You can unpack ascii out of a binary file
faster than you can step through a text file and write it.

Scot Robnett
inSite Internet Solutions
[EMAIL PROTECTED]


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Jaime Teng
Sent: Thursday, November 29, 2001 4:02 AM
To: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Re: Writing Large Text Files Quickly


At 08:38 PM 11/19/01 -, [EMAIL PROTECTED] wrote:
>Hi All,
>
>Here's an interesting problem which I'd like your help on. Suppose you've
>opened a huge text file (open INPUT, "input.txt). What is the fastest way
to
>"print" this filehandle to another file (open OUTPUT, ">output.txt).
>
>Having discovered that
>   while() {print OUTPUT $_}
>is significantly slower than
>   print OUTPUT 
>I began thinking about what the best way might be. First I played with
>"undef"ing $/ which improved things. Then I tried using "read" rather than
>the implicit "readline" function which  provides. This was even better.
>But I can't help thinking that I should be writing less code, not more to
>make this faster. Surely there is some internal Perl redirection function
>that'll make this run as fast as my hard disk can go?
>

If you really have to read the file, then I suggest two ways:

FIrST WAY
open SFILE, "filename.1";
@DATA = ;
close SFILE;
open DFILE, ">filename.2";
print DFILE @DATA;
close DFILE;
this is way faster than reading one line at a time. However,
you should have as much memory to hold the data.

SECOND WAY
open $SFILE, "filename.1";
binmode SFILE;
open DFILE, "filename.2";
binmode $SFILE;
while ($SFILE->read($DATA,131072))
{
  print DFILE $DATA;
}
close DFILE;
close $SFILE;
This is faster than your example on account that this takes lesser loop
and loads up 128K of data to memory in one sweep as against loading a
line of text as you did.






>Your suggestions are most welcome.
>
>Alistair
>
>PS Here's my Benchmark output and test code.
>input.txt is a 88,000 line 9MB test file.
>Tech details NT 4, Pentium II 350MHz, running Activestate Perl 5.6.1 build
>630.
>
>D:\>perl timethese.pl
>Benchmark: timing 5 iterations of List_return, List_undef, Scalar_Read,
>Scalar_return, Scalar_undef...
>List_return: 42 wallclock secs (29.29 usr +  3.10 sys = 32.40 CPU) @
0.15/s
>(n=5)
>List_undef: 17 wallclock secs ( 3.09 usr +  5.67 sys =  8.76 CPU) @  0.57/s
>(n=5)
>Scalar_Read: 12 wallclock secs ( 2.99 usr +  1.76 sys =  4.76 CPU) @
1.05/s
>(n=5)
>Scalar_return: 32 wallclock secs (22.33 usr +  3.10 sys = 25.44 CPU) @
>0.20/s (n=5)
>Scalar_undef: 18 wallclock secs ( 2.90 usr +  4.99 sys =  7.89 CPU) @
>0.63/s (n=5)
>
>use Benchmark;
>timethese(5, {
>   Scalar_return   => '&Scalar_Context',
>   Scalar_undef=> '&Scalar_Context_undef_dollar_slash',
>   List_return => '&List_Context',
>   List_undef  => '&List_Context_undef_dollar_slash',
>   Scalar_Read => '&Scalar_Read'
>});
>
>sub Scalar_Context {
>   open I, "input.txt" or die $!;
>   open O, ">output.txt" or die $!;
>   while () {
>   print O $_;
>   }
>   close O;
>   close I;
>}
>
>sub List_Context {
>   open I, "input.txt" or die $!;
>   open O, ">output.txt" or die $!;
>   print O ;
>   close O;
>   close I;
>}
>
>sub List_Context_undef_dollar_slash {
>   my $old_dollar_slash=$/;
>   undef $/;
>   open I, "input.txt" or die $!;
>   open O, ">output.txt" or die $!;
>   print O ;
>   close O;
>   close I;
>   $/=$old_dollar_slash;
>}
>
>sub Scalar_Context_undef_dollar_slash {
>   my $old_dollar_slash=$/;
>   undef $/;
>   open I, "input.txt" or die $!;
>   open O, ">output.txt" or die $!;
>   $_=;
>   print O $_;
>   close O;
>   close I;
>   $/=$old_dollar_slash;
>}
>
>
>sub Scalar_Read {
>   open I, "input.txt" or die $!;
>   open O, ">output.txt" or die $!;
>   while (read  I,$_,1024*1024) {
>   print O $_;
>   }
>   close O;
>   close I;
>}
>
>> --
>> Alistair McGlinchy,   [EMAIL PROTECTED]
>> Sizing and Performance, Central IT,   ext. 5012,   ph +44 20 7268-5012
>> Marks and Spencer, 3 L

RE: Windows NT/2000 File and Directory Copy Question

2001-11-28 Thread Scot Robnett

That was definitely a virus. Fortunately, AVG antivirus caught it on my
system this morning. If you get a 'response' from Sisyphus, do not open it.

Scot Robnett
inSite Internet Solutions
[EMAIL PROTECTED]


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Alvin Lewis
Sent: Wednesday, November 28, 2001 2:24 PM
To: [EMAIL PROTECTED]
Subject: Re: Windows NT/2000 File and Directory Copy Question


Tnanks, $Bill

Al Lewis


> Alvin Lewis wrote:
>
> > Hi, everyone.
> >
> > Strange.  I had a response from 'Sisyphus' in Outlook this morning but I
can't open it ( crashes ) and his response in nowhere to be found here?!
Anyone have any ideas as to what perl can do here or is this a limitation of
the OS?
>
>
> You don't want to open it - it's a virus (I think).  I would get a virus
>
> checker to check your machine.  Hopefully the crash prevented
> you from being compromised.
>
> --
>,-/-  __  _  _ $Bill Luebkert   ICQ=14439852
>   (_/   /  )// //   DBE Collectibles   Mailto:[EMAIL PROTECTED]
>/ ) /--<  o // //  http://dbecoll.tripod.com/ (Free site for Perl)
> -/-' /___/_<_http://www.todbe.com/
>
> ___
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
>

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 11/1/2001

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 11/1/2001

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: unlink(file)

2001-11-28 Thread Scot Robnett

system("del $filename");

-
Scot Robnett
inSite Internet Solutions
[EMAIL PROTECTED]



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Edward G. Orton
Sent: Wednesday, November 28, 2001 2:04 PM
To: Perl-Win32-Users Mailing List
Subject: unlink(file)


I seem to have a problem with deleting files from Perl. I use
unlink('filename') to delete the file, but it does not actually
get deleted until the perl program exits. This is a problem
since I am using a perl program to clean up old files, and put
new ones on a removeable drive. If the drive is full, I remove
the oldest files until there is enough data deleted to add in
the new files. The problem is, until the script exits, the
deleted files aren't deleted.

Any suggestions?
ActivePerl 628 on Windows 2000 server.

ego
Edward G. Orton, GWN Consultants Inc.
Phone: 613-764-3186, Fax: 613-764-1721
email: [EMAIL PROTECTED]

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 11/1/2001

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 11/1/2001

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: Sending HTML mail using Win32::OLE::Const

2001-11-26 Thread Scot Robnett
Title: RE: Sending HTML mail using Win32::OLE::Const



I appreciate the 
feedback and I'll probably take that route from now on, but there must be an 
easy option to simply set this property of the mail object. I was hoping not to 
have to rewrite the entire thing because I don't know the syntax for one line. 
;-)
 
Scot 
Robnett
[EMAIL PROTECTED]
 
 

  -Original Message-From: Mitsuda, Alex 
  [mailto:[EMAIL PROTECTED]]Sent: Monday, November 26, 2001 2:39 
  PMTo: 'Scot Robnett'; 
  [EMAIL PROTECTED]Subject: RE: Sending HTML 
  mail using Win32::OLE::Const
  As per $BILL, it's probably best to use MIME::LITE available 
  via PPM. I'm using it currently and makes sending any 
  text/html or multipart mail very easy... 
  -----Original Message- From: Scot 
  Robnett [mailto:[EMAIL PROTECTED]] Sent: Monday, November 26, 2001 3:29 PM To: 
  [EMAIL PROTECTED] Subject: 
  Sending HTML mail using Win32::OLE::Const 
  Can anyone tell me how to set the BodyFormat option to 0 in 
  order to send mail as MIME type text/html rather than 
  text/plain? I've tried several approaches to setting 
  that option on the mail object but to no avail. 
  The following sends text/plain: 
  ## 
  use Win32::OLE::Const("Microsoft CDO for NTS 1.2 
  Library"); my $subject = "foo"; my $body = <<"END_OF_BODY"; Test 
   Testtesting 1 2 3 
  END_OF_BODY my $to = 
  "foo\@bar.com"; my $from = "bar\@foo.com"; 
  my $objMail = Win32::OLE->new("CDONTS.Newmail"); 
  $objMail->Send($from,$to,$subject,$body,CdoHigh); 
  ## 
  
  Doing any of the following not only does not send HTML mail, 
  but prevents the mail from being sent at all: 
  
  ## 
  $objMail->{BodyFormat} = 0; # doesn't complain 
      
      
      
          # 
  but doesn't send 
  # or 
  $objMail->{'BodyFormat'} = '0'; #doesn't complain 
      
      
      
      
        # but doesn't 
  send 
  # or 
  $objMail->('BodyFormat') = 0; # doesn't complain 
      
      
      
      
      # but doesn't 
  send 
  # or 
  $objMail->("BodyFormat") = 0; # doesn't complain 
      
      
      
      
      # but doesn't 
  send 
  # or 
  $objMail->("CDONTS.BodyFormat") = 0; # doesn't 
  complain     
      
      
      
      
   # but doesn't 
  send 
  #or 
  $objMail->BodyFormat($body) = 0; # produces an error 
  
  ###### 
  
  The MSDN site shows you how to set it this way with VB but 
  (surprise) there is no Perl documentation: 
      myMail.BodyFormat = 
  0; 
  - Scot Robnett inSite Internet Solutions Square West 
  Center 454 West Jackson Street Woodstock, IL 60098 (815)206-2907 office 
  (815)342-6480 mobile [EMAIL PROTECTED] http://www.insiteful.tv 
  --- Outgoing mail is certified Virus 
  Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.295 / Virus Database: 159 - Release Date: 11/1/2001 
  
  ___ 
  Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users 
  
   
  
  This message contains confidential information and is intended 
  only for the individual named.  If you are not the named addressee you 
  should not disseminate, distribute or copy this e-mail.  Please notify 
  the sender immediately by e-mail if you have received this e-mail by mistake 
  and delete this e-mail from your system. 
  E-mail transmission cannot be guaranteed to be secure or 
  error-free.  The sender therefore does not accept liability for any 
  errors or omissions in the contents of this message that arise as a result of 
  e-mail transmission.  This message is provided for informational purposes 
  and should not be construed as a solicitation or offer to buy or sell any 
  securities or related financial instruments. 
  All e-mails at Neuberger Berman are, in accordance with 
  Firm policy, to be used for Neuberger Berman business purposes only.  
  E-mails sent from or to the Firm are subject to being reviewed by the Firm in 
  accordance with the Firm's procedure for the review of 
  correspondence.


Sending HTML mail using Win32::OLE::Const

2001-11-26 Thread Scot Robnett

Can anyone tell me how to set the BodyFormat option to 0 in order to send
mail as MIME type text/html rather than text/plain? I've tried several
approaches to setting that option on the mail object but to no avail.

The following sends text/plain:

##
use Win32::OLE::Const("Microsoft CDO for NTS 1.2 Library");
my $subject = "foo";
my $body = <<"END_OF_BODY";
Test

Testtesting 1 2 3
END_OF_BODY
my $to = "foo\@bar.com";
my $from = "bar\@foo.com";
my $objMail = Win32::OLE->new("CDONTS.Newmail");
$objMail->Send($from,$to,$subject,$body,CdoHigh);
##


Doing any of the following not only does not send HTML mail, but prevents
the mail from being sent at all:

##

$objMail->{BodyFormat} = 0; # doesn't complain
# but doesn't send

# or

$objMail->{'BodyFormat'} = '0'; #doesn't complain
  # but doesn't send

# or

$objMail->('BodyFormat') = 0; # doesn't complain
# but doesn't send

# or

$objMail->("BodyFormat") = 0; # doesn't complain
# but doesn't send

# or

$objMail->("CDONTS.BodyFormat") = 0; # doesn't complain
 # but doesn't send

#or

$objMail->BodyFormat($body) = 0; # produces an error

######


The MSDN site shows you how to set it this way with VB but (surprise) there
is no Perl documentation:

myMail.BodyFormat = 0;


-
Scot Robnett
inSite Internet Solutions
Square West Center
454 West Jackson Street
Woodstock, IL 60098
(815)206-2907 office
(815)342-6480 mobile
[EMAIL PROTECTED]
http://www.insiteful.tv

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 11/1/2001

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users