[16322] in Perl-Users-Digest
Perl-Users Digest, Issue: 3734 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 18 11:28:22 2000
Date: Tue, 18 Jul 2000 08:28:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <963934090-v9-i3734@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 18 Jul 2000 Volume: 9 Number: 3734
Today's topics:
using perl to automate multiform submission (Shao Zhang)
Re: using perl to automate multiform submission (Matthew Zimmerman)
Re: using perl to automate multiform submission (Shao Zhang)
Re: using perl to automate multiform submission (jason)
very dumb DBI question ()
Re: very dumb DBI question (Prasanth A. Kumar)
Viewing HTTP headers (Guy)
RE: Viewing HTTP headers (Nivel33)
Re: Viewing HTTP headers (Guy)
warn not working after re-opening STDERR ()
Re: warn not working after re-opening STDERR (jason)
Re: warn not working after re-opening STDERR ()
Warnings in taint check ()
watch out for the mod operator! (Chest Rockwell)
Re: watch out for the mod operator! <stephenk@cc.gatech.edu>
Re: watch out for the mod operator! <bill.kemp@wire2.com>
Weird behavior when using foreach loop and references (Hervé Masson)
Re: Weird behavior when using foreach loop and referenc (Tad McClellan)
WHERE is libnet????? (kj0)
Re: WHERE is libnet????? (Thomas Rassmann)
Re: WHERE is libnet????? (Jonathan Stowe)
Re: Why $|++ instead of $|=1 ? (Abigail)
Re: Windmail/NT CGI script not sending mail ()
Re: write to 2 dbm files simultaneously? (lounge lizard)
Yet another string manipulation question - (Vinod K. Menon)
Re: Yet another string manipulation question - (jason)
Re: Yet another string manipulation question - (Vinod K. Menon)
Re: Yet another string manipulation question - (Vinod K. Menon)
Re: Yet another string manipulation question - (jason)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 17 Jul 2000 02:40:14 GMT
From: shao@linux.cia.com.au.bbs@openbazaar.net (Shao Zhang)
Subject: using perl to automate multiform submission
Message-Id: <3bQiWF$WXq@openbazaar.net>
Hi,
Does anyone know how to use perl to automate multipart form submissions?
For example, some site needs you to press a "I ACCEPT" button to enter
to the next form.
In this case, how should I do this using perl to automate this?
Thanks.
Shao.
--
____________________________________________________________________________
Shao Zhang - Running Debian 2.1 ___ _ _____
Department of Communications / __| |_ __ _ ___ |_ / |_ __ _ _ _ __ _
University of New South Wales \__ \ ' \/ _` / _ \ / /| ' \/ _` | ' \/ _` |
Sydney, Australia |___/_||_\__,_\___/ /___|_||_\__,_|_||_\__, |
Email: shao@cia.com.au |___/
_____________________________________________________________________________
------------------------------
Date: 17 Jul 2000 03:30:05 GMT
From: mdz4c@node7.unix.Virginia.EDU.bbs@openbazaar.net (Matthew Zimmerman)
Subject: Re: using perl to automate multiform submission
Message-Id: <3bQjkT$XPW@openbazaar.net>
In article <3972709d@news>, Shao Zhang <shao@linux.cia.com.au> wrote:
>Hi,
> Does anyone know how to use perl to automate multipart form submissions?
> For example, some site needs you to press a "I ACCEPT" button to enter
> to the next form.
>
> In this case, how should I do this using perl to automate this?
The LWP module may do what you need. Check out
perldoc LWP
perldoc lwpcook
(I don't know if this is part of the standard distribution or not. You may
have to grab this from CPAN.)
HTH!
Matt
--
--
|Matthew Zimmerman http://www.people.virginia.edu/~mdz4c |
|Interdisciplinary Biophysics Program |"I AM serious. |
|University of Virginia | And stop calling me Shirley."|
------------------------------
Date: 17 Jul 2000 06:30:01 GMT
From: shao@linux.cia.com.au.bbs@openbazaar.net (Shao Zhang)
Subject: Re: using perl to automate multiform submission
Message-Id: <3bR2VO$V1m@openbazaar.net>
In article <8ktufo$pvd$1@murdoch.acc.Virginia.EDU>, Matthew Zimmerman wrote:
> In article <3972709d@news>, Shao Zhang <shao@linux.cia.com.au> wrote:
> >Hi,
> > Does anyone know how to use perl to automate multipart form submissions?
> > For example, some site needs you to press a "I ACCEPT" button to enter
> > to the next form.
> >
> > In this case, how should I do this using perl to automate this?
>
> The LWP module may do what you need. Check out
>
> perldoc LWP
> perldoc lwpcook
Hi,
Actually, I have asked this question in the past. The two answers
that I got was either LWP or CGI.pm.
I am also on the LWP mailing list, and I have asked them the same
question before, but with no response...
shao.
--
____________________________________________________________________________
Shao Zhang - Running Debian 2.1 ___ _ _____
Department of Communications / __| |_ __ _ ___ |_ / |_ __ _ _ _ __ _
University of New South Wales \__ \ ' \/ _` / _ \ / /| ' \/ _` | ' \/ _` |
Sydney, Australia |___/_||_\__,_\___/ /___|_||_\__,_|_||_\__, |
Email: shao@cia.com.au |___/
_____________________________________________________________________________
------------------------------
Date: 17 Jul 2000 06:40:02 GMT
From: elephant@squirrelgroup.com.bbs@openbazaar.net (jason)
Subject: Re: using perl to automate multiform submission
Message-Id: <3bR2i2$UKT@openbazaar.net>
Shao Zhang wrote ..
>In article <8ktufo$pvd$1@murdoch.acc.Virginia.EDU>, Matthew Zimmerman wrote:
>> In article <3972709d@news>, Shao Zhang <shao@linux.cia.com.au> wrote:
>> >Hi,
>> > Does anyone know how to use perl to automate multipart form submissions?
>> > For example, some site needs you to press a "I ACCEPT" button to enter
>> > to the next form.
>> >
>> > In this case, how should I do this using perl to automate this?
>>
>> The LWP module may do what you need. Check out
>>
>> perldoc LWP
>> perldoc lwpcook
>
>Hi,
> Actually, I have asked this question in the past. The two answers
> that I got was either LWP or CGI.pm.
>
> I am also on the LWP mailing list, and I have asked them the same
> question before, but with no response...
doesn't the example in the LWP documentation help ? .. it basically
shows you exactly how to submit a form via POST using LWP
perldoc LWP
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 18 Jul 2000 01:10:01 GMT
From: jblatz2@my-deja.com.bbs@openbazaar.net ()
Subject: very dumb DBI question
Message-Id: <3bRVdP$V0K@openbazaar.net>
I want to access my Informix database from my perl script. I downloaded
the DBD driver and the README file says that I need DBI ver 1.13 or
later. I have absolutely no idea where to get the DBI software. I'm on
a Unix platform. Is DBI something I download? buy from Informix? buy
from our hardware vendor??
Help!
While I'm at it - where should I install DBD? I'm sure it goes in the
directory with the perl software, but exactly where? In lib?
Thanks - sorry to sound so dumb. It's actually pretty embarrassing!
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 18 Jul 2000 02:30:03 GMT
From: kumar1@home.com.bbs@openbazaar.net (Prasanth A. Kumar)
Subject: Re: very dumb DBI question
Message-Id: <3bRXhR$UqP@openbazaar.net>
jblatz2@my-deja.com writes:
> I want to access my Informix database from my perl script. I downloaded
> the DBD driver and the README file says that I need DBI ver 1.13 or
> later. I have absolutely no idea where to get the DBI software. I'm on
> a Unix platform. Is DBI something I download? buy from Informix? buy
> from our hardware vendor??
DBI is the database independent part while DBD is the database
dependent or specific part. You can get DBI from the Perl website.
>
> Help!
>
> While I'm at it - where should I install DBD? I'm sure it goes in the
> directory with the perl software, but exactly where? In lib?
There should be a make/install script in there.
>
> Thanks - sorry to sound so dumb. It's actually pretty embarrassing!
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
--
Prasanth Kumar
kumar1@home.com
------------------------------
Date: 17 Jul 2000 16:30:03 GMT
From: guymal@hotmail.com.bbs@openbazaar.net (Guy)
Subject: Viewing HTTP headers
Message-Id: <3bRIDT$UOG@openbazaar.net>
How can I view everything that is passed to a script including all the http
headers?
I would like to submit a form to a certain url (lets say: test.pl on my web
server) and have the Perl script print all the http headers and parameters
that were passed to it. (I know how to view all parameters, but I don't know
how to view the http headers).
The reason I need this is that I have a hard coded html form that is used to
login to a web site (like the Hotmail login screen) and I wrote a Perl
script to do this automatically. The only problem is that although the
automatic authentication works, I see weird characters on the screen
(whereas with the html form everything works great). I would like to see
everything that the hard-coded html form passes to the server, and match it
to my automatic script, in order to see where the problem is.
Thanks,
Guy
------------------------------
Date: 17 Jul 2000 18:10:02 GMT
From: nivel33@hotmail.com.bbs@openbazaar.net (Nivel33)
Subject: RE: Viewing HTTP headers
Message-Id: <3bRKgR$Xjf@openbazaar.net>
i think that a solution is a telnet conexion to port 80 (Net:Telnet) and
you`'ll receive the HTTP Headers
send :
>telnet www.perl.com:80
>GET /index.html HTTP/1.0
>
receive :
HTTP/1.1 403 Forbidden
Date: Mon, 17 Jul 2000 18:03:52 GMT
Server: Apache/1.3.9 (Unix)
Connection: close
Content-Type: text/html
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
...
------------------------------
Date: 18 Jul 2000 07:10:04 GMT
From: guymal@hotmail.com.bbs@openbazaar.net (Guy)
Subject: Re: Viewing HTTP headers
Message-Id: <3bRf9R$UiL@openbazaar.net>
I don't want to see what http headers the server returns ( I know how to do
that). I want to see what http headers the web server RECEIVES from the html
form that is submitted to it.
Thanks,
Guy
Nivel33 <nivel33@hotmail.com> wrote in message
news:8kvi75$6ps$1@diana.bcn.ttd.net...
> i think that a solution is a telnet conexion to port 80 (Net:Telnet) and
> you`'ll receive the HTTP Headers
>
> send :
> >telnet www.perl.com:80
> >GET /index.html HTTP/1.0
> >
>
>
> receive :
>
> HTTP/1.1 403 Forbidden
> Date: Mon, 17 Jul 2000 18:03:52 GMT
> Server: Apache/1.3.9 (Unix)
> Connection: close
> Content-Type: text/html
>
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> ...
>
------------------------------
Date: 18 Jul 2000 02:40:02 GMT
From: scottbeck@my-deja.com.bbs@openbazaar.net ()
Subject: warn not working after re-opening STDERR
Message-Id: <3bRY82$VS3@openbazaar.net>
#!/usr/bin/perl -w
open STDSAVE, ">&STDOUT";
open ERRSAVE, ">&STDERR";
close STDOUT;
close STDERR;
print "This should not show up!\n";
open STDOUT, ">&STDSAVE";
open STDERR, ">&ERRSAVE";
print "This is stdout and you should see this!\n";
warn "This is a warn and you should see it!\n";
print STDERR "I am printing to STDERR!\n";
The warn line does not produce output to STDERR
but the print to STDERR does. Is this a bug or
a dumb mistake?
Thanks,
Scott
--
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 18 Jul 2000 02:40:03 GMT
From: elephant@squirrelgroup.com.bbs@openbazaar.net (jason)
Subject: Re: warn not working after re-opening STDERR
Message-Id: <3bRY84$Va5@openbazaar.net>
scottbeck@my-deja.com wrote ..
>#!/usr/bin/perl -w
>open STDSAVE, ">&STDOUT";
>open ERRSAVE, ">&STDERR";
>close STDOUT;
>close STDERR;
>print "This should not show up!\n";
>
>open STDOUT, ">&STDSAVE";
>open STDERR, ">&ERRSAVE";
>print "This is stdout and you should see this!\n";
>warn "This is a warn and you should see it!\n";
>print STDERR "I am printing to STDERR!\n";
>
>
>The warn line does not produce output to STDERR
>but the print to STDERR does. Is this a bug or
>a dumb mistake?
works for me as expected with Perl 5.005_03 on WinNT .. all three lines
produce output to the console
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 18 Jul 2000 06:50:02 GMT
From: scottbeck@my-deja.com.bbs@openbazaar.net ()
Subject: Re: warn not working after re-opening STDERR
Message-Id: <3bReWQ$Xbb@openbazaar.net>
In article <MPG.13de62c553bf1db89896e1@news>,
elephant@squirrelgroup.com (jason) wrote:
> scottbeck@my-deja.com wrote ..
> >#!/usr/bin/perl -w
> >open STDSAVE, ">&STDOUT";
> >open ERRSAVE, ">&STDERR";
> >close STDOUT;
> >close STDERR;
> >print "This should not show up!\n";
> >
> >open STDOUT, ">&STDSAVE";
> >open STDERR, ">&ERRSAVE";
> >print "This is stdout and you should see this!\n";
> >warn "This is a warn and you should see it!\n";
> >print STDERR "I am printing to STDERR!\n";
> >
> >
> >The warn line does not produce output to STDERR
> >but the print to STDERR does. Is this a bug or
> >a dumb mistake?
>
> works for me as expected with Perl 5.005_03 on WinNT .. all three
lines
> produce output to the console
>
> --
> jason -- elephant@squirrelgroup.com --
>
Sorry, but I forgot to mention this does work on windows but not unixish
systems. I did try it on Win2k and WinNT and it does work.
The warn does not happen on the linux systems I tried it on.
RedHat 6.0, Mandrake 7.0, and Mandrake 7.1.
Thanks,
Scott
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 17 Jul 2000 13:40:00 GMT
From: miko@idocs.com.bbs@openbazaar.net ()
Subject: Warnings in taint check
Message-Id: <3bRDf0$Tbb@openbazaar.net>
I'm getting some warnings when I check for taintedness. I haven't seen
anyone else mention this issue and I'm wondering if I'm doing someting
wrong, and/or if my workaround is acceptable.
Basically, when I use the standard taint checking subroutine, I get two
warnings every time:
Useless use of join in void context at test.pl line 26.
Useless use of join in void context at test.pl line 26.
Here's the entire script that generates the warning:
#!/usr/bin/perl -wT
use strict;
use CGI;
my ($query, $testvar);
$query = CGI->new;
$testvar = $query->param('testvar');
# CGI header
print $query->header();
# display tainted info
print "\$testvar is ";
if (is_tainted($testvar))
{print "tainted<P>"}
else
{print "not tainted<P>"}
# perl version
print "Perl version: $]\n";
sub is_tainted
{
return ! eval
{
join('',@_), kill 0;
1;
};
}
This happens in Perl version: 5.00404.
Now, the error actually makes sense. The join IS happening in a void
context and it's Perl's duty to report such mischief. So my kludge is
to remove the void context by assigning the results to a variable like
this:
sub is_tainted
{
my ($junk);
return ! eval
{
$junk=join('',@_), kill 0;
1;
};
}
It seems like a good solution to me, but, in the words Bart Mancuso in
The Hunt for Red October, "I'd better phone this one in". What's the
feeling here on this solution?
-miko
--
Miko O'Sullivan
Author of The Mikodocs Guide to HTML
http://www.mikodocs.com/tags/
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 18 Jul 2000 10:18:57 GMT
From: haaaajo@removethis.dds.nl (Chest Rockwell)
Subject: watch out for the mod operator!
Message-Id: <39742c25.960909781@news.wirehub.nl>
Hi there,
I'm writing a decrypting tool in perl. ActivePerl 5.005_03 to be
exact. When I use the mod operator with big numbers, the outcome is no
longer predictable. An example :
my $blah = 996634191231 % 35;
returns 24, where 21 is the one and only correct answer.
What the hell is causing this?! For the time being I use the following
statement:
my $blah = 996634191231 - 35 * int(996634191231 / 35)
Ciao.
Chest
------------------------------
Date: Tue, 18 Jul 2000 07:07:54 -0400
From: Stephen Kloder <stephenk@cc.gatech.edu>
Subject: Re: watch out for the mod operator!
Message-Id: <39743A89.3102F772@cc.gatech.edu>
Chest Rockwell wrote:
> Hi there,
>
> I'm writing a decrypting tool in perl. ActivePerl 5.005_03 to be
> exact. When I use the mod operator with big numbers, the outcome is no
> longer predictable. An example :
>
> my $blah = 996634191231 % 35;
>
> returns 24, where 21 is the one and only correct answer.
>
> What the hell is causing this?! For the time being I use the following
> statement:
>
> my $blah = 996634191231 - 35 * int(996634191231 / 35)
>
> Ciao.
>
> Chest
Your number may be too large to be corectly handled as an integer in some
perl functions. Try using Math::BigInt:
>perl -e "print 996634191231%35"
24
>perl -e "use Math::BigInt; print Math::BigInt->new(996634191231)%35"
+21
--
Stephen Kloder | "I say what it occurs to me to say.
stephenk@cc.gatech.edu | More I cannot say."
Phone 404-874-6584 | -- The Man in the Shack
ICQ #65153895 | be :- think.
------------------------------
Date: Tue, 18 Jul 2000 12:34:43 +0100
From: "W Kemp" <bill.kemp@wire2.com>
Subject: Re: watch out for the mod operator!
Message-Id: <963920230.21750.0.nnrp-02.c3ad6973@news.demon.co.uk>
<snip>
>Your number may be too large to be corectly handled as an integer in some
>perl functions. Try using Math::BigInt:
the number is over 2**40 !
>
>>perl -e "print 996634191231%35"
>24
>>perl -e "use Math::BigInt; print Math::BigInt->new(996634191231)%35"
>+21
>
Gets stranger- with perl -e "print 996634191231%35"
Redhat 6.2 perl 5.005_03 answer =10
Win NT perl 5.6 answer =21
------------------------------
Date: 12 Jul 2000 00:10:02 GMT
From: herve-news@mindstep.com.bbs@openbazaar.net (Hervé Masson)
Subject: Weird behavior when using foreach loop and references
Message-Id: <3bMjCQ$YSR@openbazaar.net>
Hi,
(Perl version: 5.005_03, reproduced as well on v5.6.0)
I experienced really strange behavior when using a foreach loop,
going through a list, known by its reference. When I change
the loop-variable value inside the loop, it also change the item
inside the list ! That's not what I expected at all, because I
thought I was the only "owner" of my local variable '$item',
and I can safety put any value I want without affecting external
data, even if my variable used to refer them via a foreach loop.
Is there any reason for that ?
Misterious interpreter optimization ?
Did I completely miss to understand perl ?
I would be really interested to know more about that...
Thanks in advance.
Herve
-[The sample code]---------------------------------------------------
use strict;
use Data::Dumper;
my($item,$list);
$list=
[
[ 'A', 1 ],
[ 'B', 2 ],
[ 'C', 3 ],
];
printf("Before loop : %s",Dumper($list));
foreach $item (@$list)
{
$item=0;
}
printf("After loop : %s",Dumper($list));
-[The result]---------------------------------------------------------
Before loop : $VAR1 = [
[
'A',
1
],
[
'B',
2
],
[
'C',
3
]
];
After loop : $VAR1 = [
'0',
'0',
'0'
];
I did not expect that code to change the original array '$list'...
------------------------------
Date: 12 Jul 2000 05:30:01 GMT
From: tadmc@metronet.com.bbs@openbazaar.net (Tad McClellan)
Subject: Re: Weird behavior when using foreach loop and references
Message-Id: <3bN5SQ$Wns@openbazaar.net>
On Tue, 11 Jul 2000 20:11:48 -0700, Hervé Masson <herve-news@mindstep.com> wrote:
>
>
>(Perl version: 5.005_03, reproduced as well on v5.6.0)
>
>I experienced really strange behavior when using a foreach loop,
^^^^^^^^^^^^^^^^
s/strange/as documented/; # :-)
>going through a list, known by its reference.
You cannot have a reference to a list.
You have a reference to an (anonymous) array there (in $list).
>When I change
>the loop-variable value inside the loop, it also change the item
>inside the list ! That's not what I expected at all, because I
^^^^^^^^^^^^^^^^^^^
You should not sign contracts without reading them first.
Read about foreach() if you want to know what to expect from foreach().
>thought I was the only "owner" of my local variable '$item',
^^ ^^^^^ ^^^^^
You misunderstand multiple things, I think.
You are starting to confuse me too.
Let's start from the beginning:
Perl has 2 kinds of variables:
Perl FAQ, part 7:
"What's the difference between dynamic and lexical (static) scoping?
Between local() and my()?"
local() -> dynamic variable
my() -> lexical variable
So, your $item below is NOT a "local variable".
It is a "lexical variable".
$item is "in scope" within the foreach() body, so it can
be changed in the body.
>and I can safety put any value I want without affecting external
>data, even if my variable used to refer them via a foreach loop.
^^^^^^^^^^^^
So naturally you have already read the "Foreach Loops" section
in perlsyn.pod then, right?
>Is there any reason for that ?
I guess you missed where it talks about "alias" then.
>Misterious interpreter optimization ?
>Did I completely miss to understand perl ?
>
>I would be really interested to know more about that...
errr, OK.
Let's just quote perlsyn here then:
--------------------------------
The C<foreach> loop iterates over a normal list value and sets the
variable VAR to be each element of the list in turn. If the variable
is preceded with the keyword C<my>, then it is lexically scoped, and
is therefore visible only within the loop. Otherwise, the variable is
implicitly local to the loop and regains its former value upon exiting
the loop. If the variable was previously declared with C<my>, it uses
that variable instead of the global one, but it's still localized to
the loop.
The C<foreach> keyword is actually a synonym for the C<for> keyword, so
you can use C<foreach> for readability or C<for> for brevity. (Or because
the Bourne shell is more familiar to you than I<csh>, so writing C<for>
comes more naturally.) If VAR is omitted, C<$_> is set to each value.
If any element of LIST is an lvalue, you can modify it by modifying VAR
inside the loop. That's because the C<foreach> loop index variable is
an implicit alias for each item in the list that you're looping over.
--------------------------------
Note the last sentence there.
>-[The sample code]---------------------------------------------------
>
>use strict;
>use Data::Dumper;
>
>my($item,$list);
>$list=
> [
> [ 'A', 1 ],
> [ 'B', 2 ],
> [ 'C', 3 ],
> ];
>
>printf("Before loop : %s",Dumper($list));
>foreach $item (@$list)
>{
> $item=0;
>}
>printf("After loop : %s",Dumper($list));
>I did not expect that code to change the original array '$list'...
Bad things can happen when you sign without reading.
Don't do that :-)
Use the docs, Luke.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 17 Jul 2000 13:50:03 GMT
From: kj0@mailcity.com.bbs@openbazaar.net (kj0)
Subject: WHERE is libnet?????
Message-Id: <3bRE5R$UuQ@openbazaar.net>
I've been searching CPAN for 1 hour trying and failing to find libnet.
Can anybody tell me where it is and/or why searching CPAN for it
fails?
Thanks,
kj
------------------------------
Date: 17 Jul 2000 14:20:01 GMT
From: Thomas.Rassmann@sdm.de.bbs@openbazaar.net (Thomas Rassmann)
Subject: Re: WHERE is libnet?????
Message-Id: <3bREh1$UuU@openbazaar.net>
kj0 schrieb:
>
> I've been searching CPAN for 1 hour trying and failing to find libnet.
> Can anybody tell me where it is and/or why searching CPAN for it
> fails?
>
> Thanks,
>
> kj
Search for 'libnet' in http://www.cpan.org/modules/01modules.index.html.
(it's a 'Net'-Module...: Net GBARR libnet-1.0703.tar.gz 63k 23 Mar
2000)
Tom
--
Thomas Rassmann mailto:Thomas.Rassmann@sdm.de
sd&m AG http://www.sdm.de
software design & management
Thomas-Dehler-Str. 27, D-81737 Muenchen, Germany
Tel +49 89 63812-346 Fax -410
------------------------------
Date: 17 Jul 2000 14:20:01 GMT
From: gellyfish@gellyfish.com.bbs@openbazaar.net (Jonathan Stowe)
Subject: Re: WHERE is libnet?????
Message-Id: <3bREh2$UyV@openbazaar.net>
On 17 Jul 2000 09:54:22 -0400, kj0 Wrote:
>
> I've been searching CPAN for 1 hour trying and failing to find libnet.
> Can anybody tell me where it is and/or why searching CPAN for it
> fails?
I dont know why it fails for you but it works for me :
<http://search.cpan.org/search?mode=module&query=libnet>
/J\
------------------------------
Date: 17 Jul 2000 19:20:03 GMT
From: abigail@delanet.com.bbs@openbazaar.net (Abigail)
Subject: Re: Why $|++ instead of $|=1 ?
Message-Id: <3bRMY3$Tvg@openbazaar.net>
M.J.T. Guy (mjtg@cus.cam.ac.uk) wrote on MMDVIII September MCMXCIII in
<URL:news:8kkmk2$bfh$1@pegasus.csx.cam.ac.uk>:
[] Abigail <abigail@delanet.com> wrote:
[] >
[] >That's what local is for. Your subs will fail to do the right thing
[] >if $| happens to be -1. Or imagine that some_sub has a fatal error in
[] >it, which is caught by an eval{}. Your entire $| ++ and $| -- will be
[] >hosed.
[]
[] Nope. $| is magical, and can only ever take values 0 or 1. Which
[] means the subroutine is nonsense for other reasons.
[]
[] And that also shows that $|++ is exactly the same as $|=1, so entirely
[] respectable if a little eccentric.
I could just imagine that some time in the past, $| was made magical
because the use of $|++ caused problems....
Abigail
--
$_ = "\x3C\x3C\x45\x4F\x54"; s/<<EOT/<<EOT/e; print;
Just another Perl Hacker
EOT
------------------------------
Date: 14 Jul 2000 14:20:01 GMT
From: tallisyn@my-deja.com.bbs@openbazaar.net ()
Subject: Re: Windmail/NT CGI script not sending mail
Message-Id: <3bOkJ3$Wrr@openbazaar.net>
Dan,
Have you considered using SMTP to send your
email? We have an NT perl script that sends mail
using SMTP. The advantage is that your script
isn't bound to a mailer on the same machine --
you can use any open SMTP gateway to send it.
You may be able to find an SMTP mailer in perl on
the web somewhere. If not, I can email you the
one we use -- it's freeware.
Tim
In article <396E28E1.B30633@ucalgary.ca>,
Dan Woods <dwoods@ucalgary.ca> wrote:
> I have written a Perl script to work on NT (I
hate NT). It is
> supposed to read a data file (list of articles)
and create the
> HTML page using a template. The user then
selects a list of
> articles they want to receive, and provide user
info with
> email address. After submit, the script should
send an email
> to the user with the requested files *attached*
to the email,
> and the admin receives an email with the user
info.
>
> I am testing on my NT workstation with Apache
and Windmail
> 3.05 eval, and the script works. However, I
then tried to
> install it on a hosting site where they use IIS
and Windmail.
> I only modified the local path of the
template/data file.
> The list of articles is created, but after
selection my script
> reports success, meaning no error from
> open(MAIL, "|windmail -t") || &error("Could not
open mail program");
> but no email is ever sent.
> Since this is on a hosting company, debugging
is very difficult
> and I am restricted on what we can use, so
using blat.exe is not ok
> (i also had blat working locally).
>
> This has been frustrating me for two weeks now.
> I am not likely to volunteer to do another NT
script anytime soon,
> however I still have to solve this problem :(
>
> Thanks...Dan.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 18 Jul 2000 07:20:12 GMT
From: milosk@flashcom.net.bbs@openbazaar.net (lounge lizard)
Subject: Re: write to 2 dbm files simultaneously?
Message-Id: <3bRfMD$Tfc@openbazaar.net>
Thanks for the info Bob - I"ve found the problem occurs when just one dbm file
is open also - running it from the command line it says no write permission to
the ndbm file - but I just created it on the same server with another program,
hours ago - how do I creat the file as gdbm or change it to gdbm?
Sorry if this is a stupid q - I'm somewhat new to Perl - thanks
Bob Walton wrote:
> lounge lizard wrote:
> >
> > Can I write to 2 open dbm files at the same time or do I have to close
> > one first - relevant code is:
> >
> > dbmopen (%DATA, $keyIDfile, 0666) || die "can't open file\n";
> > dbmopen (%MAIN, $keyMainfile, 0666) || die "can't open file\n";
> > $DATA{$i} = $member_array[3];
> > $MAIN{$member_array[3]} = $newline;
> > dbmclose (%MAIN);
> > dbmclose (%DATA);
> >
> > I'm getting that I have no write permissoin for MAIN - DATA was created
> > by this program MAIN by another of my programs that I have had no
> > trouble writing to before - anyone help? Thanks
>
> You should have no trouble writing to two or more DBM-type files
> simultaneously as long as you are not using either DBM or NDBM (I am
> running a program with 11 simultaneous dbmopen's open for write as I
> type this). You need to be sure your system supports whatever DBM-type
> (like DBM, NDBM, GDMB, SDMB, DB_File, etc) your dbmopen uses. Note that
> if you use Windoze with a FAT or FAT32 file system, SDBM won't work (it
> will seem like it does, but it will drop a significant fraction of the
> keys as the file size gets larger than trivial). Note that SDBM was the
> default type used by most Windoze versions of Perl prior to Perl version
> 5.6 (it looks like the default is now DB_File, which will work with
> FAT/FAT32 filesystems). Question: was the "main" data file written
> using the same DBM-type? If it was on another computer, maybe it
> wasn't. Also, there may be a possibility the implementation of a given
> DBM-type may differ between different operating systems, so it may be
> that a file written on one system might not be usable on a different
> system.
> --
> Bob Walton
------------------------------
Date: 18 Jul 2000 02:30:02 GMT
From: anuragmenon@my-deja.com.bbs@openbazaar.net (Vinod K. Menon)
Subject: Yet another string manipulation question -
Message-Id: <3bRXhQ$UmQ@openbazaar.net>
Ok..here it is... there is an input string $String1
the string is actually a code string..in the sense that there are a few
conditions about what character should come after which one.
For example, a can be followed by b or c
but, if in the input string a is not followed by b or c, I want an X
inserted between them.
Let me give an example:
One Rule says 'a' can be followed by 'b'or 'e'
Another Rule says 'c' can be followed only by 'd'
Yet another Rule is 'e' can be followed only by 'k' or 'l'
Considering those rules, if the input string is abcd, things are fine
But if the input string ad, I want the string to be made aXd
and if the input string is aece, the string should be made aeXcXe
and so on...
is there an easy function whatever in perl that can be used to achieve
this. I can do a series of "if"s to do this..but is that the best way?
any suggestions?
I hope I am somewhat clear with that problem..
do let me know..I appreciate all your help...I have to do this in perl
and am a newbie with very little time..thanks for all ur patience..
Vinod.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 18 Jul 2000 02:40:03 GMT
From: elephant@squirrelgroup.com.bbs@openbazaar.net (jason)
Subject: Re: Yet another string manipulation question -
Message-Id: <3bRY83$VW2@openbazaar.net>
Vinod K. Menon wrote ..
>Ok..here it is... there is an input string $String1
>
>the string is actually a code string..in the sense that there are a few
>conditions about what character should come after which one.
>
>For example, a can be followed by b or c
>but, if in the input string a is not followed by b or c, I want an X
>inserted between them.
>
>Let me give an example:
>
>One Rule says 'a' can be followed by 'b'or 'e'
>Another Rule says 'c' can be followed only by 'd'
>Yet another Rule is 'e' can be followed only by 'k' or 'l'
my %rules = ( a => 'be', c => 'd', e => 'kl' );
my $char = 'X';
for my $key (keys %rules)
{
$String1 =~ s/$key([^$rules{$key}])/$key$char$1/g;
}
>is there an easy function whatever in perl that can be used to achieve
>this. I can do a series of "if"s to do this..but is that the best way?
>any suggestions?
a reasonably simple regex will handle those sorts of rules .. basically
the above will work with any number of those types of rules
what we're using here is a negative character class .. for the first
rule - the above regex becomes
$String1 =~ s/a([^be])/aX$1/g;
so the [^be] matches any character other than 'b' or 'e' .. and the
substitution is made .. we put capturing parens so that we can use $1 in
the substitution to put whatever character back in place
the hash is just an easy way of storing those rules - and iterating
through them
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 18 Jul 2000 05:10:03 GMT
From: anuragmenon@my-deja.com.bbs@openbazaar.net (Vinod K. Menon)
Subject: Re: Yet another string manipulation question -
Message-Id: <3bRc3Q$WXu@openbazaar.net>
In article <MPG.13de6209e7a8d3e79896e0@news>,
elephant@squirrelgroup.com (jason) wrote:
> Vinod K. Menon wrote ..
> >Ok..here it is... there is an input string $String1
> >
Thanks for that code...but would it be too rude to say I am not
understanding it? I understand the rules being stored in the hash (I
think I do)...but what is the scalar variable $key and what is the
initialization etc? I am totally lost...please help..
Vinod.
> >Let me give an example:
> >
> >One Rule says 'a' can be followed by 'b'or 'e'
> >Another Rule says 'c' can be followed only by 'd'
> >Yet another Rule is 'e' can be followed only by 'k' or 'l'
>
> my %rules = ( a => 'be', c => 'd', e => 'kl' );
> my $char = 'X';
>
> for my $key (keys %rules)
> {
> $String1 =~ s/$key([^$rules{$key}])/$key$char$1/g;
> }
>
> >is there an easy function whatever in perl that can be used to
achieve
> >this. I can do a series of "if"s to do this..but is that the best
way?
> >any suggestions?
>
> a reasonably simple regex will handle those sorts of rules ..
basically
> the above will work with any number of those types of rules
>
> what we're using here is a negative character class .. for the first
> rule - the above regex becomes
>
> $String1 =~ s/a([^be])/aX$1/g;
>
> so the [^be] matches any character other than 'b' or 'e' .. and the
> substitution is made .. we put capturing parens so that we can use $1
in
> the substitution to put whatever character back in place
>
> the hash is just an easy way of storing those rules - and iterating
> through them
>
> --
> jason -- elephant@squirrelgroup.com --
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 18 Jul 2000 06:00:04 GMT
From: anuragmenon@my-deja.com.bbs@openbazaar.net (Vinod K. Menon)
Subject: Re: Yet another string manipulation question -
Message-Id: <3bRdI5$Vq9@openbazaar.net>
Ok..I did understand how it works and thanks a lot ..I really really
appreciate it!!
Vinod
>
> > >Let me give an example:
> > >
> > >One Rule says 'a' can be followed by 'b'or 'e'
> > >Another Rule says 'c' can be followed only by 'd'
> > >Yet another Rule is 'e' can be followed only by 'k' or 'l'
> >
> > my %rules = ( a => 'be', c => 'd', e => 'kl' );
> > my $char = 'X';
> >
> > for my $key (keys %rules)
> > {
> > $String1 =~ s/$key([^$rules{$key}])/$key$char$1/g;
> > }
> >
> > >is there an easy function whatever in perl that can be used to
> achieve
> > >this. I can do a series of "if"s to do this..but is that the best
> way?
> > >any suggestions?
> >
> > a reasonably simple regex will handle those sorts of rules ..
> basically
> > the above will work with any number of those types of rules
> >
> > what we're using here is a negative character class .. for the first
> > rule - the above regex becomes
> >
> > $String1 =~ s/a([^be])/aX$1/g;
> >
> > so the [^be] matches any character other than 'b' or 'e' .. and the
> > substitution is made .. we put capturing parens so that we can use
$1
> in
> > the substitution to put whatever character back in place
> >
> > the hash is just an easy way of storing those rules - and iterating
> > through them
> >
> > --
> > jason -- elephant@squirrelgroup.com --
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 18 Jul 2000 05:20:04 GMT
From: elephant@squirrelgroup.com.bbs@openbazaar.net (jason)
Subject: Re: Yet another string manipulation question -
Message-Id: <3bRcG4$UXu@openbazaar.net>
Vinod K. Menon wrote ..
>In article <MPG.13de6209e7a8d3e79896e0@news>,
> elephant@squirrelgroup.com (jason) wrote:
>> my %rules = ( a => 'be', c => 'd', e => 'kl' );
>> my $char = 'X';
>>
>> for my $key (keys %rules)
>> {
>> $String1 =~ s/$key([^$rules{$key}])/$key$char$1/g;
>> }
>
>Thanks for that code...but would it be too rude to say I am not
>understanding it? I understand the rules being stored in the hash (I
>think I do)...but what is the scalar variable $key and what is the
>initialization etc? I am totally lost...please help..
ok .. line by line with documentation references in parens
>> my %rules = ( a => 'be', c => 'd', e => 'kl' );
create a new hash %rules with three keys 'a', 'c' and 'e' which have
three values - respectively 'be', 'd' and 'kl' (perldata) .. using the
=> operator for clear distinction between key/value pairs (perlop)
>> my $char = 'X';
hopefully that line needs no explanation .. I only did it so that it's
easy to change the separator character
>> for my $key (keys %rules)
for every key in %rules set $key to the key and loop (perlsyn)
>> {
>> $String1 =~ s/$key([^$rules{$key}])/$key$char$1/g;
the =~ operator tells Perl to perform this substitution on the $String1
scalar (perlop)
after the variable interpolation - the three substitutions will be
s/a([^be])/aX$1/g
s/c([^d])/cX$1/g
s/e([^kl])/eX$1/g
the [^be] means any character OTHER THAN 'b' or 'e' and the parens do
the $1 magic (perlre)
>> }
now .. if that's still not clear then start reading some documentation
.. take any of the words in parens above and feed it through perldoc
from the command line .. eg.
perldoc perlop
then read the doco
--
jason -- elephant@squirrelgroup.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 V9 Issue 3734
**************************************