[17935] in Perl-Users-Digest
Perl-Users Digest, Issue: 95 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 19 00:10:36 2001
Date: Thu, 18 Jan 2001 21:10:13 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <979881013-v10-i95@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 18 Jan 2001 Volume: 10 Number: 95
Today's topics:
Mailing attachments? (Rand Simberg)
Re: Mailing attachments? (Damian James)
Re: Mailing attachments? (Rand Simberg)
Re: Mailing attachments? Lee.Lindley@bigfoot.com
Re: Mailing attachments? (Rand Simberg)
Re: Multiple Substitution (Eric Bohlman)
Re: Need script help - consolidation <ren.maddox@tivoli.com>
Re: Pattern Matching Problem <rick.delaney@home.com>
Re: Perl - sys admin question <rick.delaney@home.com>
Perl 500502 DBI does not work on V4R5 uzaemon@my-deja.com
Re: Perl/IIS and open() (Martin Vorlaender)
Re: Perl/IIS and open() <jew208@psu.edu>
problem about DBI eastking@my-deja.com
Re: problem about DBI <kstep@pepsdesign.com>
Re: Problems splitting a string? <monty@primenet.com>
Re: Problems splitting a string? <wyzelli@yahoo.com>
Re: Question regarding encrypting passwords (Chris Fedde)
Re: Question regarding encrypting passwords <jason@uklinux.net>
Re: Random text script, got one?:-) <mischief@velma.motion.net>
Re: Remote Controll other windows software by Perl (Si Ballenger)
Step #2 <sks@sierra.net>
Re: Step #2 (Damian James)
Re: Step #2 <kstep@pepsdesign.com>
Re: Using perl to update an ASP? <scorkery@my-deja.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 19 Jan 2001 00:21:44 GMT
From: simberg.interglobal@trash.org (Rand Simberg)
Subject: Mailing attachments?
Message-Id: <3a6787d3.106744819@nntp.ix.netcom.com>
I'm doing a CGI script that (in theory) emails a data file
automatically. I was going to use sendmail, but when I looked in the
FAQ and asked how sendmail handles attachments, the simple answer
was--it doesn't.
It recommended something like pine, but when I looked in the pine
manual it wasn't obvious how to run it from a script (I assume that I
can probably play some games with pipes, but I don't have the time to
climb a learning curve right now) and was wondering if there are any
canned routines that do this anywhere.
************************************************************************
simberg.interglobal.org * 310 372-7963 (CA) 307 739-1296 (Jackson Hole)
interglobal space lines * 307 733-1715 (Fax) http://www.interglobal.org
"Extraordinary launch vehicles require extraordinary markets..."
Replace first . with @ and throw out the "@trash." to email me.
Here's my email address for autospammers: postmaster@fbi.gov
------------------------------
Date: 19 Jan 2001 01:22:53 GMT
From: damian@puma.qimr.edu.au (Damian James)
Subject: Re: Mailing attachments?
Message-Id: <slrn96f5oq.6p1.damian@puma.qimr.edu.au>
Thus spake Rand Simberg on Fri, 19 Jan 2001 00:21:44 GMT:
>I'm doing a CGI script that (in theory) emails a data file
>automatically. I was going to use sendmail, but when I looked in the
>FAQ and asked how sendmail handles attachments, the simple answer
>was--it doesn't.
You can probably work out why this is the case yourself, if you think about
exactly what email attachments are (remembering that email is a text-only
medium), and consider that sendmail is an MTA.
>...wondering if there are any
>canned routines...
You should really familiarise yourself with CPAN (http://www.cpan.org), if
you plan to do anything much with Perl. Check the MIME hierarchy, the modules
in there are probably what you're after (look under category 15).
HTH
Cheers,
Damian
------------------------------
Date: Fri, 19 Jan 2001 02:21:09 GMT
From: simberg.interglobal@trash.org (Rand Simberg)
Subject: Re: Mailing attachments?
Message-Id: <3a68a3f5.5775619@nntp.ix.netcom.com>
On 19 Jan 2001 01:22:53 GMT, in a place far, far away,
damian@puma.qimr.edu.au (Damian James) made the phosphor on my monitor
glow in such a way as to indicate that:
>Thus spake Rand Simberg on Fri, 19 Jan 2001 00:21:44 GMT:
>>I'm doing a CGI script that (in theory) emails a data file
>>automatically. I was going to use sendmail, but when I looked in the
>>FAQ and asked how sendmail handles attachments, the simple answer
>>was--it doesn't.
>
>You can probably work out why this is the case yourself, if you think about
>exactly what email attachments are (remembering that email is a text-only
>medium), and consider that sendmail is an MTA.
Well, yes, and in fact the file that I'm sending isn't even a
binary--it's just a tab-delimited data base. But I didn't want to
just embed it in the body of the message, because it would be a PITA
for the recipient to cut and paste it into a file for incorporation
into Access or Excel.
>>...wondering if there are any
>>canned routines...
>
>You should really familiarise yourself with CPAN (http://www.cpan.org), if
>you plan to do anything much with Perl. Check the MIME hierarchy, the modules
>in there are probably what you're after (look under category 15).
OK, I'll go check that out.
Thanx...
************************************************************************
simberg.interglobal.org * 310 372-7963 (CA) 307 739-1296 (Jackson Hole)
interglobal space lines * 307 733-1715 (Fax) http://www.interglobal.org
"Extraordinary launch vehicles require extraordinary markets..."
Replace first . with @ and throw out the "@trash." to email me.
Here's my email address for autospammers: postmaster@fbi.gov
------------------------------
Date: Fri, 19 Jan 2001 02:30:04 GMT
From: Lee.Lindley@bigfoot.com
Subject: Re: Mailing attachments?
Message-Id: <9488r5$d8k$1@nnrp1.deja.com>
In article <slrn96f5oq.6p1.damian@puma.qimr.edu.au>,
damian@puma.qimr.edu.au (Damian James) wrote:
> Thus spake Rand Simberg on Fri, 19 Jan 2001 00:21:44 GMT:
> >I'm doing a CGI script that (in theory) emails a data file
> >automatically. I was going to use sendmail, but when I looked in the
> >FAQ and asked how sendmail handles attachments, the simple answer
> >was--it doesn't.
[snip]
> Check the MIME hierarchy, the modules
> in there are probably what you're after (look under category 15).
>
MIME::Lite is most likely the easiest and most useful to get you
started. The documentation is adequate and has examples.
--
// Lee.Lindley@Bigfoot.com
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Fri, 19 Jan 2001 04:10:02 GMT
From: simberg.interglobal@trash.org (Rand Simberg)
Subject: Re: Mailing attachments?
Message-Id: <3a6abde4.12415745@nntp.ix.netcom.com>
On Fri, 19 Jan 2001 02:30:04 GMT, in a place far, far away,
Lee.Lindley@bigfoot.com made the phosphor on my monitor glow in such a
way as to indicate that:
>> Check the MIME hierarchy, the modules
>> in there are probably what you're after (look under category 15).
>>
>
>MIME::Lite is most likely the easiest and most useful to get you
>started. The documentation is adequate and has examples.
Well, my biggest problem will be, whatever module I find, to convince
my ISP to put it into the library. Unfortunately, I am not the master
of my domain...
************************************************************************
simberg.interglobal.org * 310 372-7963 (CA) 307 739-1296 (Jackson Hole)
interglobal space lines * 307 733-1715 (Fax) http://www.interglobal.org
"Extraordinary launch vehicles require extraordinary markets..."
Replace first . with @ and throw out the "@trash." to email me.
Here's my email address for autospammers: postmaster@fbi.gov
------------------------------
Date: 19 Jan 2001 04:19:30 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Multiple Substitution
Message-Id: <948f8i$2l7$1@bob.news.rcn.net>
Eli the Bearded <elijah@workspot.net> wrote:
> In comp.lang.perl.misc, Ken Chesak <ken.chesak@dhs.state.tx.us> wrote:
>> $data = "HOME & FREE < BORN > FREE ' HELP \"";
>> %encode = ( '&' => '&',
>> '<' => '<',
>> '>' => '>',
>> '"' => '"',
>> '\'' => '&singleq;' );
>>
>> $data =~ s/([&<">])/$::encode{$1}/g;
> ^^^^
> No single quote there.
> You can make this sort of thing flexible enough to deal with changes
> to the %encode with no change to the RE. It will be slightly slower,
> if that is a concern:
> $data =~ s/(.)/defined($encode{$1})?$encode{$1}:$1/eg;
Almost as easy, but without the slowdown:
# after the definition of %encode (which should really be lexical)
my $encode='['.join("",keys %encode).']';
#and change the substitution to:
$data =~ s/($encode)/$encode{$1}/g;
This keeps the keys and the matches in sync automatically.
------------------------------
Date: 18 Jan 2001 16:51:48 -0600
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Need script help - consolidation
Message-Id: <m3g0igmq2j.fsf@dhcp11-177.support.tivoli.com>
Michael Carman <mjcarman@home.com> writes:
> bigdawg wrote:
> > %NETRESOURCE=(LocalName=>"x:",RemoteName=>"\\\\snap1\\backups");
>
> Your hash values are literal strings, so you don't need the
> interpolation of double-qoutes. If you use single quotes you won't have
> to escape the backslashes.
>
> %NETRESOURCE=(LocalName=>'x:',RemoteName=>'\\snap1\backups');
Unfortunately, that isn't quite right. Even inside single quotes, \\
(and \') are special. But any other backslash isn't, so it is only a
problem when you actually *want* two backslashes in a row, as in this
case. In case that isn't clear, here's an example:
print '\blue', "\n";
print '\\blue', "\n";
Notice that these both output "\blue" (that is, just a single
backslash). So, even with single quotes, there still need to be four
backslashes when you want two (but only one when you want one). Of
course, switching to forward slashes as you went on to recommend skips
this problem altogether -- which is a good thing. :)
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Fri, 19 Jan 2001 04:06:46 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Pattern Matching Problem
Message-Id: <3A67C133.B9A65188@home.com>
[posted & mailed]
CM wrote:
>
> My data file appears like this...
>
> <!--2-->
> <data goes here>
> <!--2-->
> <!--5-->
> <data goes here>
> <!--5-->
[snip]
> Now a record is the data that appears between <!--n--> and <!--n-->.
> My algorithm is like this.
>
> $buffer=Entire file contents
Ugh, don't do that. Read in as little as you need to determine when you
have a full record.
> The problem with this algorithm is that it goes thru the entire data
> whereas I need just 4 records .
Right. Set $/ = "-->" and then just read one record at a time, stopping
when you get to the desired number. If "-->" can appear within a record
(and not only at the end) then keep reading chunks into your buffer
until the bracketing numbers match.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Fri, 19 Jan 2001 02:54:33 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Perl - sys admin question
Message-Id: <3A67B053.A82FACDD@home.com>
[posted & mailed]
T wrote:
>
> My 'struct utmp' in my utmp.h file is exactly
> like the Digital Unix example on page 295 of the book. However, the
> author does not give an example for this type of structure. Does anyone
> know what the template should look like for this type of structure?
Did you search deja's archives? I seem to remember seeing such code
posted here before. By gellyfish, I think (where is he, btw?)
> Sent via Deja.com
> http://www.deja.com/
Hmm.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Fri, 19 Jan 2001 02:39:46 GMT
From: uzaemon@my-deja.com
Subject: Perl 500502 DBI does not work on V4R5
Message-Id: <9489di$doc$1@nnrp1.deja.com>
To AS/400 Perl experts:
Following perl script doesn't work on V4R5.
All character fields become blank. It works fine on V4R4...
I posted same question at comp.sys.ibm.as400.misc but got no response.
Any ideas?
(Perl script)-----------------------------------
use DBI;
$dbh = DBI->connect("dbi:DB2:as400_name") or die "connect got error:
$dbh::errstr";
$stmt = 'SELECT * FROM qgpl.qrpglesrc';
$sth = $dbh->prepare($stmt) or die "prepare got error: $dbh::errstr";
$sth->execute() or die "execute got error: $sth::errstr";
$,=",";
$arr = $sth->fetchall_arrayref;
foreach $a (@$arr) {
foreach $ref (@$a) {
print "$ref, ";
}
print "\n";
}
$dbh->disconnect();
1;
(V4R5)----------------------------------
> perl /iptu/chapter3/perl/dbtest.pl
1, 0, ,
2, 0, ,
3, 0, ,
4, 0, ,
~~~~~~SNIP~~~~~~
(V4R4)----------------------------------
> perl /dbtest.pl
1, 0, H DFTNAME(PROOF)
2, 0, FQSYSPRT O F 132 PRINTER
3, 0,
4, 0, D ARRAY S 8 DIM(3)
~~~~~~SNIP~~~~~~
uzaemon@Japan
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Fri, 19 Jan 2001 02:19:11 +0100
From: martin@radiogaga.harz.de (Martin Vorlaender)
Subject: Re: Perl/IIS and open()
Message-Id: <3a67960f.524144494f47414741@radiogaga.harz.de>
John Woltman (jew208@psu.edu) wrote:
: A little bit closer to solving it, perhaps. The script will work if I put
: it in the root directory of the web server, but none of the subdirectories
: (cgi-bin for example). Is there some weird setting I need to change in IIS
: to get this to work? Hmmmmmm.
How about letting your script find its own directory and use that on the
open statement? Like
use FindBin ();
open FILE, "$FindBin::Bin/filename" ...
or
open FILE, "$FindBin::Bin/../anotherdirectory/filename" ...
cu,
Martin
--
One OS to rule them all | Martin Vorlaender | VMS & WNT programmer
One OS to find them | work: mv@pdv-systeme.de
One OS to bring them all | http://www.pdv-systeme.de/users/martinv/
And in the Darkness bind them.| home: martin@radiogaga.harz.de
------------------------------
Date: Fri, 19 Jan 2001 03:54:23 GMT
From: "John Woltman" <jew208@psu.edu>
Subject: Re: Perl/IIS and open()
Message-Id: <PTO96.1608$cN.106430@bgtnsc07-news.ops.worldnet.att.net>
Woooohooo!
I don't know what the hell that code means, but it works! *grins*
I'm just starting out, haven't gotten to "use" statements except for basic
CGI.
Thanks a lot, a billion karma points have been credited to your account.
Now I don't have to hate perl anymore.
- John Woltman
"Martin Vorlaender" <martin@radiogaga.harz.de> wrote in message
news:3a67960f.524144494f47414741@radiogaga.harz.de...
> John Woltman (jew208@psu.edu) wrote:
> : A little bit closer to solving it, perhaps. The script will work if I
put
> : it in the root directory of the web server, but none of the
subdirectories
> : (cgi-bin for example). Is there some weird setting I need to change in
IIS
> : to get this to work? Hmmmmmm.
>
> How about letting your script find its own directory and use that on the
> open statement? Like
>
> use FindBin ();
>
> open FILE, "$FindBin::Bin/filename" ...
>
> or
>
> open FILE, "$FindBin::Bin/../anotherdirectory/filename" ...
>
> cu,
> Martin
> --
> One OS to rule them all | Martin Vorlaender | VMS & WNT programmer
> One OS to find them | work: mv@pdv-systeme.de
> One OS to bring them all |
http://www.pdv-systeme.de/users/martinv/
> And in the Darkness bind them.| home: martin@radiogaga.harz.de
------------------------------
Date: Fri, 19 Jan 2001 01:34:52 GMT
From: eastking@my-deja.com
Subject: problem about DBI
Message-Id: <9485js$agq$1@nnrp1.deja.com>
Hello every one here. I have a question to ask you.
I was using DBI under solaris/Oracle.
following is my script.
$sSQL = qq{ INSERT INTO T_AREA2
(CD,
NM,
I_DATE,
I_ID,
U_DATE,
U_ID,
U_PGID)
values
(?,
?,
SYSDATE,
?,
SYSDATE,
?,
?)};
my $sth = $dbh->prepare( $sSQL);
$nRet = $sth->execute($AR2CD, $AR2NM, $loginID, $loginID, $pronm);
}
when $AR2CD = '1111 ' it will insert into dababase using '1111', it
filter the space. How can I prevent it from doing so.
Thanks in advance.
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Thu, 18 Jan 2001 23:52:13 -0500
From: "Kurt Stephens" <kstep@pepsdesign.com>
Subject: Re: problem about DBI
Message-Id: <948h6q$4lt$1@slb2.atl.mindspring.net>
<eastking@my-deja.com> wrote in message news:9485js$agq$1@nnrp1.deja.com...
> Hello every one here. I have a question to ask you.
>
> I was using DBI under solaris/Oracle.
>
> following is my script.
>
> $sSQL = qq{ INSERT INTO T_AREA2
> (CD,
> NM,
> I_DATE,
> I_ID,
> U_DATE,
> U_ID,
> U_PGID)
> values
> (?,
> ?,
> SYSDATE,
> ?,
> SYSDATE,
> ?,
> ?)};
>
>
> my $sth = $dbh->prepare( $sSQL);
>
> $nRet = $sth->execute($AR2CD, $AR2NM, $loginID, $loginID, $pronm);
> }
>
> when $AR2CD = '1111 ' it will insert into dababase using '1111', it
> filter the space. How can I prevent it from doing so.
>
> Thanks in advance.
You may want to try setting the ChopBlanks attribute on the statement handle
before the execute() call. I pasted the documentation from DBI.pm below.
$sth->{ChopBlanks} = 1;
$nRet = $sth->execute($AR2CD, $AR2NM, $loginID, $loginID, $pronm);
----------------
ChopBlanks (boolean, inherited)
This attribute can be used to control the trimming of trailing space
characters from fixed width character (CHAR) fields. No other field types
are affected, even where field values have trailing spaces.
The default is false (although it is possible that the default may change).
Applications that need specific behavior should set the attribute as needed.
Emulation interfaces should set the attribute to match the behavior of the
interface they are emulating.
Drivers are not required to support this attribute, but any driver which
does not support it must arrange to return undef as the attribute value.
----------------
HTH,
Kurt Stephens
------------------------------
Date: 19 Jan 2001 00:59:55 GMT
From: Jim Monty <monty@primenet.com>
Subject: Re: Problems splitting a string?
Message-Id: <9483ib$bt6$1@nnrp2.phx.gblx.net>
Don <don@lclcan.com> wrote:
> I have a scaler variable that holds the following:
>
> $text = "AACHEN |GERMANY |N|HAMBURG |10|4|TRUCK|";
>
> I wish to break it up into 7 variables so I have coded as such:
>
> my ($port, $country, $suspended, $transPort, $transit, $tranship,
> $disposition);
> ($port, $country, $suspended, $transPort, $transit, $tranship,
> $disposition) = split(/|/, $text);
Escape the vertical bar in the regular expression. Also, you may
want to trim trailing spaces. Consider this:
my $text = "AACHEN |GERMANY |N|HAMBURG |10|4|TRUCK|";
my ($port, $country, $suspended, $transPort, $transit, $tranship,
$disposition) = map { s/\s+$//; $_ } split /\|/, $text;
--
Jim Monty
monty@primenet.com
Tempe, Arizona USA
------------------------------
Date: Fri, 19 Jan 2001 10:53:35 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Problems splitting a string?
Message-Id: <WxM96.10$nu4.2697@vic.nntp.telstra.net>
"Ren Maddox" <ren.maddox@tivoli.com> wrote in message
news:m3ely0rbs0.fsf@dhcp11-177.support.tivoli.com...
> Don <don@lclcan.com> writes:
>
> > $disposition) = split(/|/, $text);
>
> The problem is that "|" is special in a regular expression -- it means
> "OR". So you are splitting on nothing or nothing, which always
> matches, which means you split at every opportunity.
>
Interestingly I posted the split (/|/,$_); as a humorous response to a
request at splitting a string into characters about a week ago.
Wyzelli
--
push@x,$_ for(a..z);push@x,' ';
@z='092018192600131419070417261504171126070002100417'=~/(..)/g;
foreach $y(@z){$_.=$x[$y]}y/jp/JP/;print;
------------------------------
Date: Thu, 18 Jan 2001 23:16:29 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Question regarding encrypting passwords
Message-Id: <hPK96.1096$B9.192884224@news.frii.net>
In article <3A676C1A.743836BF@noaa.gov>,
Donald J. Miller III <donald.j.miller@noaa.gov> wrote:
>-=-=-=-=-=-
>
>Hello,
>
>I would like to use Net::FTP to retrieve some files from a server.
>However, I would prefer not to send the passwords as plaintext. I've
>looked at some of the Crypt:: modules on CPAN, but I am not sure which
>one(s) would be best to use for encrypting a password that would also be
>decryptable by the server.
>
Unfortunately encryption of passwords would be a server side issue.
If you are worried about snooping you can try running your ftp
server inside an SSL wraper using stunnel or a similar wrapper.
But then many of ftp clients out there can't access the server.
--
This space intentionally left blank
------------------------------
Date: Fri, 19 Jan 2001 00:27:02 +0000
From: Jason Clifford <jason@uklinux.net>
Subject: Re: Question regarding encrypting passwords
Message-Id: <Pine.LNX.4.30.0101190026160.17910-100000@ns1>
On Thu, 18 Jan 2001, Donald J. Miller III wrote:
> I would like to use Net::FTP to retrieve some files from a server.
> However, I would prefer not to send the passwords as plaintext. I've
> looked at some of the Crypt:: modules on CPAN, but I am not sure which
> one(s) would be best to use for encrypting a password that would also be
> decryptable by the server.
Depends upon what the server supports. If you control the server why not
look at FTP over SSL which would encrypt the connection?
Jason Clifford
------------------------------
Date: Thu, 18 Jan 2001 23:57:15 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Random text script, got one?:-)
Message-Id: <t6f0mr6r0kns07@corp.supernews.com>
johnstarr2001@my-deja.com wrote:
> Hi I looking for a random text script if someone has already have made.
> Thanks.
By using the search term 'markov' on http://search.cpan.org I found the following:
3 modules found in 2 distributions matching 'markov'
Algorithm-MarkovChain-0.03 by Richard Clamp Released
31st October 2000
Algorithm::MarkovChain - Object oriented Markov chain generator 0.03
Decision-Markov-0.01 by Alan Schwartz Released
24th March 1998
Decision::Markov - Markov models for decision analysis 0.01
Decision::Markov::State - Markov state object for Decision::Markov 0.01
The former seems to be meant for use with Markov text chains, and the latter
for other Markov decision uses (specifically, it contains a biblio reference
to a text on using Markov algorithms in the medical field).
Markov chains are often preferred to purely random text. I saw another post
already about Data::Random / Data:Random:WordList which should be good
for truly random word choices.
Also, if you are really interested in some cool things to do with somewhat
random text, you could look in the Jargon File
( http://www.tuxedo.org/~esr/jargon ) under the entry 'Dissociated Press'.
If you choose, you can go straight to the entry at the URL
http://www.tuxedo.org/~esr/jargon/jargon.html#Dissociated%20Press
instead. ( BTW, ESR does a great job with the Jargon File. ) The DP entry
describes a great algorithm for text that is partially randomized which
should be easy enough to implement in any language - especially Perl.
I have a random set-of-lines script I use to generate my Usenet .sig block.
It acts a little like the standard fortune program found on many Unix
flavors, and is written in Perl. I know I've mentioned it before and may
have posted the source.
I'm just trying to give some ideas, since the OP's spec is a bit vague.
Chris
--
Christopher E. Stith
"Get real! This is a discussion group, not a helpdesk. You post
something, we discuss its implications. If the discussion happens to
answer a question you've asked, that's incidental." -- nobull in clp.misc
------------------------------
Date: Fri, 19 Jan 2001 04:01:58 GMT
From: shb@vnet.net (Si Ballenger)
Subject: Re: Remote Controll other windows software by Perl
Message-Id: <3a67baa7.357121789@166.82.1.9>
Go to the below site and search for winx3241.zip
http://ftpsearch.lycos.com/?form=medium
On Fri, 5 Jan 2001 21:05:56 +0100, "Mösl Roland"
<founder@pege.org> wrote:
>It's enough to know how to
>
>start a program
>maximize
>simulate mouse or key strokes to activate a menu command
>select an input element in a dialog box
>enter key strokes into the dialog box
>
>
>--
>Mösl Roland founder@pege.org
>http://www.pege.org clear targets for a confused civilization
>http://www.BeingFound.com web design starts at the search engine
>
>
------------------------------
Date: Fri, 19 Jan 2001 03:30:07 -0000
From: adam <sks@sierra.net>
Subject: Step #2
Message-Id: <t6fd5vo9sfh232@corp.supernews.com>
I downloaded "Activestate" perl for windows98. I read some of the
documentation, and it realy isn't helping any. I was wondering if someone
would give me a "Hello World" example. For instance, A CGI is called by
refering to it's web address. Would someone show me the code for a simple
(not too simple) "hello World", and explaine how to "call" it from where
It's installed on my windows to an HTML page? perl is installed on
My "E:" drive if that helps.
If you could also explaine Why all the "$" before everything, and answer
how important is spacing and capitalization. Is it just convention?
Thanks again
Adam T.
sks@sierra.net
--
Posted via CNET Help.com
http://www.help.com/
------------------------------
Date: 19 Jan 2001 04:11:04 GMT
From: damian@puma.qimr.edu.au (Damian James)
Subject: Re: Step #2
Message-Id: <slrn96ffk5.a2r.damian@puma.qimr.edu.au>
Thus spake adam on Fri, 19 Jan 2001 03:30:07 -0000:
>... For instance, A CGI is called by
>refering to it's web address. Would someone show me the code for a simple
>(not too simple) "hello World", and explaine how to "call" it from where
>It's installed on my windows to an HTML page?
>
I'm afraid you are confused about what CGI is -- it is a gateway interface
between a web server and executable programs residing on the web server
computer. You need a web server to do CGI.
Perl, on the other hand, is a programming language. There is no particular
connection between Perl and CGI, except that Perl is a popular language for
developing CGI programs.
The good news is, you can download Apache, the most popular webserver
software in the world, for free from http://www.apache.org.
Or you mtght want to try Indigo Perl, which features an integrated Apache
webserver, and can also be downloaded for free from
http://www.indigostar.com/indigoperl.htm.
>If you could also explaine Why all the "$" before everything, and answer
>how important is spacing and capitalization. Is it just convention?
There are many good books and tutorials for Perl. Probably the best thing
for you would be to buy a copy of _Learning Perl on Win32 Systems_, which
is available from http://www.oreilly.com/catalog/lperlwin/.
Also, the documentation included with perl is a good place to start. You
should start at the beginning of the section called "Frequently Asked
Questions".
Good luck, and enjoy Perl :-)
Cheers,
Damian
------------------------------
Date: Thu, 18 Jan 2001 23:41:44 -0500
From: "Kurt Stephens" <kstep@pepsdesign.com>
Subject: Re: Step #2
Message-Id: <948gi5$quk$1@slb1.atl.mindspring.net>
"adam" <sks@sierra.net> wrote in message
news:t6fd5vo9sfh232@corp.supernews.com...
> I downloaded "Activestate" perl for windows98. I read some of the
> documentation, and it realy isn't helping any. I was wondering if someone
> would give me a "Hello World" example. For instance, A CGI is called by
> refering to it's web address. Would someone show me the code for a simple
> (not too simple) "hello World", and explaine how to "call" it from where
> It's installed on my windows to an HTML page? perl is installed on
> My "E:" drive if that helps.
First you need a web server. For development and learning purposes you can
use the Microsoft Personal Web Server that came with Windows 98. For
installation instructions, go to:
http://support.microsoft.com/support/windows/InProductHelp98/pws_install.asp
Once that is installed, it's probably easiest to re-install ActiveState
Perl. If it finds PWS on your machine, it should set up your script
mappings automatically. For instructions on setup including your 'Hello
World!' proigram, go to:
http://support.microsoft.com/support/kb/articles/Q231/9/98.ASP
> If you could also explaine Why all the "$" before everything, and answer
> how important is spacing and capitalization. Is it just convention?
It's called Perl. Assuming that AS Perl is installed on drive E:, point your
web browser to E:\Perl\html\index.html and start reading. Begin with the
links under ActivePerl Documentation - this gets you up and running and
addresses thw Windows-specific issues. Then read the sections under Core
Perl Documentation:
perl
perlsyn
perlvar
perlstyle
perlfaq[1..9]
HTH,
Kurt Stephens
------------------------------
Date: Fri, 19 Jan 2001 03:10:32 GMT
From: duckdba <scorkery@my-deja.com>
Subject: Re: Using perl to update an ASP?
Message-Id: <948b72$f8c$1@nnrp1.deja.com>
In article <3A66742F.7C8E497@catlover.com>,
Ron Grabowski <ronnie@catlover.com> wrote:
> > The webpage is an ASP. Is it possible to write a perl script that
will
> > send my login information to the ASP? And if so, are there any
> > examples out there? (I've looked, but I didn't see any) Or could
some
> > one advise me how to go about writing a script that would accomplish
> > this?
>
> ASP is just another server-side scripting platform. The normal
> LWP::UserAgent, HTTP::Cookies, HTTP::Request::Common, etc. will all
work
> as documented.
>
> - Ron
>
Okay, I wrote the following script, but I'm still having problems.
When I run it, the output I see is the webpage I connect to login, not
the one the says I have successfully "clocked-in".
use HTTP::Request::Common;
use LWP::UserAgent;
# Create a user agent object
$ua = LWP::UserAgent->new;
$ua->agent('Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)');
# Create a request
my $req = POST 'http://www.some.web.address/clocker/default.asp',
[Badge => '0123456',
PinNo => '123',
QB => 'checked',
];
# Pass request to the user agent and get a response back
my $res = $ua->request($req);
# Check the outcome of the response
if ($res->is_success) {
print $res->content;
} else {
print "Error\n";
}
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 95
*************************************