[17012] in Perl-Users-Digest
Perl-Users Digest, Issue: 4424 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 25 14:10:27 2000
Date: Mon, 25 Sep 2000 11:10:15 -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: <969905414-v9-i4424@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 25 Sep 2000 Volume: 9 Number: 4424
Today's topics:
Perl and sendmail <f@m.com>
Re: Perl and sendmail (Abigail)
Re: Perl and sendmail <pilsl@goldfisch.atat.at>
Re: Perl and sendmail <f@m.com>
Re: Perl and sendmail <amonotod@netscape.net>
Perl and SNMP <peredina@progress.com>
Perl script to syncronize dirs with ftp <bgreil@immomovie.ch>
Re: Perl script to syncronize dirs with ftp <amonotod@netscape.net>
Re: Perl Shell on Windows NT <Steve_Alpert@idx.com>
perl5005/perl5.6 + Taintmode espenmyr@linpro.no
Re: Pure perl encrypt/decryption? (Abigail)
Re: push-technology <nospam@david-steuber.com>
Re: Range operator with "... /^$/" ollie_spencer@my-deja.com
Re: Range operator with "... /^$/" ollie_spencer@my-deja.com
Reading XML data from body of a POST? <kmatassa@jetform.com>
Re: Reading XML data from body of a POST? <matt@sergeant.org>
Re: References and local (Daniel Chetlin)
SV: ActivePerl ppm install DB_File on NT <BAF@TT.LUTH.SE>
tekboard.cgi <tigz@ntlworld.com>
Re: use vs. @ISA <OfficerS@aries.tucson.saic.com>
Re: Warning message in Win32::ODBC module <lr@hpl.hp.com>
Win32::API Call Problem <chsieber@yahoo.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 25 Sep 2000 18:13:18 +0200
From: f <f@m.com>
Subject: Perl and sendmail
Message-Id: <39CF799E.2731F91@m.com>
Hi you guys
well, I don't know if this is a perl problem or a sendmail problem.
I'm writing a mailing list. I have an array of ca. 3000 email addresses.
I programmed a foreach which contains a sendmail.
As soon as I start this script foreach starts sendmail several 100 times
with different email addresses. Then sendmail is busy sending
all that mail and after ca. 60 seconds my sricpt times out.
:-((
I have no access to the server's sendmail config.
Is there any option to start sendmail with or to increase the perl
timeout?
Bye
Ralf
------------------------------
Date: 25 Sep 2000 17:18:03 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Perl and sendmail
Message-Id: <slrn8sv23u.lo9.abigail@alexandra.foad.org>
f (f@m.com) wrote on MMDLXXXII September MCMXCIII in
<URL:news:39CF799E.2731F91@m.com>:
?? Hi you guys
??
?? well, I don't know if this is a perl problem or a sendmail problem.
??
?? I'm writing a mailing list. I have an array of ca. 3000 email addresses.
Why not take advantage of the many mailings that are already out there?
?? I programmed a foreach which contains a sendmail.
Oh boy. sendmail is process with a heavy startup time, as it needs to
parse its config file. sendmail is written to be a *daemon*: configure
once, listen to a port, and fork() on incoming connections. fork() is
fast on modern Unices; much, much faster than reparsing the config file
over and over and over again.
?? As soon as I start this script foreach starts sendmail several 100 times
??
?? with different email addresses. Then sendmail is busy sending
?? all that mail and after ca. 60 seconds my sricpt times out.
Of course. You're hitting a limit. Be it the number of processes, be it
the memory. It's much better to connect to the port sendmail is listening
on, and most of all, to make use of the fact you can give sendmail more
than one address to deliver mail to.
?? Is there any option to start sendmail with or to increase the perl
?? timeout?
The solution to "my eye hurts when drinking a cup of tea" is not to take
a painkiller, but the remove the spoon from the cup.
Abigail
--
BEGIN {my $x = "Knuth heals rare project\n";
$^H {integer} = sub {my $y = shift; $_ = substr $x => $y & 0x1F, 1;
$y > 32 ? uc : lc}; $^H = hex join "" => 2, 1, 1, 0, 0}
print 52,2,10,23,16,8,1,19,3,6,15,12,5,49,21,14,9,11,36,13,22,32,7,18,24;
------------------------------
Date: Mon, 25 Sep 2000 17:25:26 GMT
From: peter pilsl <pilsl@goldfisch.atat.at>
Subject: Re: Perl and sendmail
Message-Id: <MPG.1439a94d472e87449898a4@news.chello.at>
In article <39CF799E.2731F91@m.com>, f@m.com says...
> Hi you guys
>
> well, I don't know if this is a perl problem or a sendmail problem.
>
> I'm writing a mailing list. I have an array of ca. 3000 email addresses.
>
> I programmed a foreach which contains a sendmail.
>
> As soon as I start this script foreach starts sendmail several 100 times
>
> with different email addresses. Then sendmail is busy sending
> all that mail and after ca. 60 seconds my sricpt times out.
>
> :-((
>
> I have no access to the server's sendmail config.
>
> Is there any option to start sendmail with or to increase the perl
> timeout?
>
You dont want us to help to write spam-tools, dont you ? ;)
Why not cause perl to wait every 50 emails until the mailq is empty again?
peter
--
pilsl@
goldfisch.at
------------------------------
Date: Mon, 25 Sep 2000 19:51:39 +0200
From: f <f@m.com>
Subject: Re: Perl and sendmail
Message-Id: <39CF90AB.8BE242ED@m.com>
Hi Peter
peter pilsl wrote:
>You dont want us to help to write spam-tools, dont you ? ;)
Certainly not.
I write only to adresses who requested to receive mail and every
mail has a link to unsubscribe. See, no spam.
As you can see, I'm under the category "stupid, not crazy" :-)
>Why not cause perl to wait every 50 emails until the mailq is empty again?
I had this idea myself, I just don't know how to tell
perl to "wait" and how I find out if the mailq is empty again.
Thanks
Ralf
> In article <39CF799E.2731F91@m.com>, f@m.com says...
> > Hi you guys
> >
> > well, I don't know if this is a perl problem or a sendmail problem.
> >
> > I'm writing a mailing list. I have an array of ca. 3000 email addresses.
> >
> > I programmed a foreach which contains a sendmail.
> >
> > As soon as I start this script foreach starts sendmail several 100 times
> >
> > with different email addresses. Then sendmail is busy sending
> > all that mail and after ca. 60 seconds my sricpt times out.
> >
> > :-((
> >
> > I have no access to the server's sendmail config.
> >
> > Is there any option to start sendmail with or to increase the perl
> > timeout?
> >
>
> You dont want us to help to write spam-tools, dont you ? ;)
>
> Why not cause perl to wait every 50 emails until the mailq is empty again?
>
> peter
>
> --
> pilsl@
> goldfisch.at
------------------------------
Date: Mon, 25 Sep 2000 17:53:10 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: Perl and sendmail
Message-Id: <8qo3dr$1bc$1@nnrp1.deja.com>
In article <39CF799E.2731F91@m.com>,
f <f@m.com> wrote:
> I programmed a foreach which contains a sendmail.
<snip>
> all that mail and after ca. 60 seconds my sricpt times out.
<snip>
> Is there any option to start sendmail with or to increase the perl
> timeout?
Your script times out? I have never had a script timeout. In fact, I
recently had to combine 6 logfiles into a single properly sorted file,
totally over 250MB. Then I parsed that logfile, using Perl, and got
back a bunch of stats. The entire process took over 7 hours, on an
eight-way SS1000 with 768MB RAM. Scripts do not timeout.
I'll tell you what... I have a script, like yours, that accesses the
database, pulls out a bunch of email addresses, and then mails each
address, using a separate file as the body of the message. While I do
not have near so many addresses (about 650), it is still a sizable task.
Email me and ask for it.
Also, for your sendmail concerns, you may want to check out this link to
previous sendmail and perl related questions:
http://www.deja.com/dnquery.xp?ST=QS&DBS=2&groups=comp.lang.perl.misc&QR
Y=sendmail&svcclass=dncurrent
in addition to:
http://www.deja.com/topics_md.xp?group=comp.mail.sendmail&search=topic
HTH,
amonotod
--
`\|||/ amonotod@
(@@) netscape.net
ooO_(_)_Ooo________________________________
_____|_____|_____|_____|_____|_____|_____|_____|
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 25 Sep 2000 13:29:35 -0400
From: peredina <peredina@progress.com>
Subject: Perl and SNMP
Message-Id: <39CF8B7F.BEDE4CEA@progress.com>
Anyone point me to some good starter docs re: Perl and SNMP.
Ive looked in a few places, and there's not much out there.
Thanks,
Curt
------------------------------
Date: Mon, 25 Sep 2000 18:55:15 +0200
From: Balts Greil <bgreil@immomovie.ch>
Subject: Perl script to syncronize dirs with ftp
Message-Id: <B5F55013.DF8%bgreil@immomovie.ch>
Dear List Readers
Does anybody know of a perl script (with or without web interface) or other
applications that will synchronize directories on two different OS X boxes
with ftp enabled.
Any help is very much appreciated
Best regards,
--
B. Greil
Immomovie AG
------------------------------
Date: Mon, 25 Sep 2000 17:34:45 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: Perl script to syncronize dirs with ftp
Message-Id: <8qo2bk$vsq$1@nnrp1.deja.com>
In article <B5F55013.DF8%bgreil@immomovie.ch>,
Balts Greil <bgreil@immomovie.ch> wrote:
> Dear List Readers
>
> Does anybody know of a perl script (with or without web interface) or
other
> applications that will synchronize directories on two different OS X
boxes
> with ftp enabled.
>
> Any help is very much appreciated
>
> Best regards,
>
> --
> B. Greil
> Immomovie AG
>
>
http://www.deja.com/dnquery.xp?ST=QS&DBS=2&groups=comp.lang.perl.misc&QR
Y=ftp+script&svcclass=dncurrent
and/or
http://www.perl.com/CPAN-local/modules/by-authors/Graham_Barr/ftp_eg.rea
dme
HTH,
amonotod
--
`\|||/ amonotod@
(@@) netscape.net
ooO_(_)_Ooo________________________________
_____|_____|_____|_____|_____|_____|_____|_____|
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 25 Sep 2000 11:58:46 -0400
From: Steve Alpert <Steve_Alpert@idx.com>
Subject: Re: Perl Shell on Windows NT
Message-Id: <5iuusscl7jdhodrl64bn6454omkmivonro@4ax.com>
Jonathan Stowe <gellyfish@gellyfish.com> wrote:
>On Wed, 20 Sep 2000 14:54:16 GMT charlie.bursell@healthcare.com wrote:
>> I'm not much on Windows, but have recently been forced into it.
>>
>> On Windows NT, it seems that perl runs in a sub-shell and not in the
>> active shell window. I note that I cannot redirect the standard output
>> of my perl scripts via ">" or "|".
>>
...[stuff deleted]...
One more piece. If you set the environment variable to include .PL, you don't
even have to type that!
PATHEXT = .PL;.COM;.EXE;.BAT;.CMD
steve
Steve Alpert (Steve_Alpert @ i d x . c o m)
IDX Systems Corp. Boston, Massachusetts
------------------------------
Date: Mon, 25 Sep 2000 19:53:47 +0200
From: espenmyr@linpro.no
Subject: perl5005/perl5.6 + Taintmode
Message-Id: <39CF912B.76BAF844@linpro.no>
I have the script hmm.pl
#!/local/bin/perl5.6.0 -wT
## This is file hmm.pl##
$ARGV[0] =~ /(.*)/;
$ARGV[0] = $1; #untaint tainted input.
dill($ARGV[0]);
sub dill{
$_[0] =~ /\GBilde/gcs;
print "**pos: ", pos($_[0]) , "\n";
}
__END__
If I run /hmm.pl "Bilde balde blopp" in Taintmode with perl5.6
pos($_[0]) dont get set . It affects perl 5.005 ,5.6, (not .004) and
just in
taintmode. What am I doing wrong?
--
regards,
espen
------------------------------
Date: 25 Sep 2000 16:45:33 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Pure perl encrypt/decryption?
Message-Id: <slrn8sv071.lo9.abigail@alexandra.foad.org>
Bart Lateur (bart.lateur@skynet.be) wrote on MMDLXXXII September MCMXCIII
in <URL:news:fqbussgp0oq1a5rvmnheuu265grhohod5f@4ax.com>:
)) Abigail wrote:
))
)) >That entirely depends on your firewall configuration. For a webserver,
)) >why should a firewall let any package through bound for a port other
)) >than 80, regardless who initiated the connection?
))
)) Because 8080 is a pretty common port number, for example for a proxy?
Why would you want to run a proxy on your webserver?
Abigail
--
print v74.117.115.116.32;
print v97.110.111.116.104.101.114.32;
print v80.101.114.108.32;
print v72.97.99.107.101.114.10;
------------------------------
Date: Mon, 25 Sep 2000 15:18:26 GMT
From: David Steuber <nospam@david-steuber.com>
Subject: Re: push-technology
Message-Id: <m3g0mo5wl9.fsf@solo.david-steuber.com>
I agree with Abigail. However, the technology you are looking for is
Java. A Java applet can open a socket back to the host the page was
downloaded from and listen for events. It can also use UDP and poll
for events, I think. As a rule, Java applets are not allowed to act
as servers, so I think you are stuck with TCP.
--
David Steuber | Perl apprentice, Apache/mod_perl user, and
NRA Member | general Internet web wannabe.
ICQ# 91465842 (Using Micq 0.4.6 under Linux)
It's time to be free: http://www.harrybrowne2000.org
------------------------------
Date: Mon, 25 Sep 2000 15:28:13 GMT
From: ollie_spencer@my-deja.com
Subject: Re: Range operator with "... /^$/"
Message-Id: <8qnqtg$mgn$1@nnrp1.deja.com>
I see that now. After 62 years, sometimes just being told doesn't
work - you just have to puzzle it out! I guess my confusion came in not
understanding what happens when binmode() isn't included ( and seems
someone said you couldn't go wrong by including binmode() ).
ollie spencer(signing off this thread)
In article <m3ya0h9uvh.fsf@dhcp11-177.support.tivoli.com>,
Ren Maddox <ren.maddox@tivoli.com> wrote:
> ollie_spencer@my-deja.com writes:
>
> >In article <m31yygw6j1.fsf@dhcp11-177.support.tivoli.com>,
> > Ren Maddox <ren.maddox@tivoli.com> wrote:
> > > BTW, I didn't see anyone mention this, and you probably already
know
> > > it, but if you ftp the file in binary mode, then the \x0d
characters
> > > will not be added (nor the \x1a at the end).
> >
> > The System Administrator does the ftp-ing. I just pick the file up
from
> > a designated directory. Maybe I should ask her, though-
> >
> > After experimentation and re-re-reading the documentation ( doesn't
perl
> > have wonderful documentation? I must read it sometime!) I found
that my
> > major problem was *INCLUDING* binmode() in the first place.
*WITHOUT*
> > binmode(), my ASCII file has \x0d\x0a replaced with \x0a as it is
> > read-in and I can process it just like the books say( meaning I can
> > forget those \x0d's). When I save, newlines convert back to
> > CRLF(\x0d\x0a)and the file is printable from a Windows platform.
> >
> > I can even save it unaltered it I choose to binmode() the output
file.
> >
> > It seems so obvious now that I am sorry to have stirred up such an
> > extensive discussion. OR- maybe others are as confused as I?
>
> Possibly others are, but this *is* what I and others were attempting
> to point out. Every time we mentioned binmode we were referring to
> the fact that it looked like you *were* using it when you shouldn't.
> I'm glad that you've got it straight now. :)
>
> --
> Ren Maddox
> ren@tivoli.com
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 25 Sep 2000 15:32:35 GMT
From: ollie_spencer@my-deja.com
Subject: Re: Range operator with "... /^$/"
Message-Id: <8qnr6j$ms4$1@nnrp1.deja.com>
Thanks for the reply. See my response to Ren Maddox.
Sorry to have created a firestorm over a triviality.
But I end up better understanding perl and it's workings!
ollie spencer(signing off this thread!)
In article <bgpuss437akog3mpj8u60kjisefmvtc4dr@4ax.com>,
Bart Lateur <bart.lateur@skynet.be> wrote:
> ollie_spencer@my-deja.com wrote:
>
> >Yep, I did all the standard things, including using binmode(). See
some
>
> That's just it.
>
> >of my earlier replies for my solution(finally!). Seems that chomp()
> >only trimmed the \x0a from the end of my NT-stored data, leaving an
> >\x0d. Evey line had \x0d in it, even those that appeared empty.
>
> You SHOULD NOT have done binmode(). Binmode *prevents* conversion of
> CRLF to "\n" (=LF), so you keep "\r" (=CR) characters in there were
they
> are not wanted.
>
> You *want* to trat this as a text file.
>
> --
> Bart.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 25 Sep 2000 11:43:06 -0400
From: "Kevin Matassa" <kmatassa@jetform.com>
Subject: Reading XML data from body of a POST?
Message-Id: <ssusm3o0esd5bf@corp.supernews.com>
What's the best way to do this within a mod-perl based CGI? CGI.pm is
based on reading name/value pairs. My POST body is an xml string.
Thanks,
-Kevin
------------------------------
Date: Mon, 25 Sep 2000 18:46:55 +0100
From: Matt Sergeant <matt@sergeant.org>
Subject: Re: Reading XML data from body of a POST?
Message-Id: <39CF8F8F.6020804@sergeant.org>
Kevin Matassa wrote:
> What's the best way to do this within a mod-perl based CGI? CGI.pm is
> based on reading name/value pairs. My POST body is an xml string.
The body of POST comes in on STDIN in CGI, so you simply need to read
that directly into XML::Parser:
my $parser = XML::Parser->new( <params> );
$parser->setHandlers( <handlers> );
eval {
$parser->parse(*STDIN);
};
if ($@) {
# handle errors
)
------------------------------
Date: 25 Sep 2000 15:55:39 GMT
From: daniel@chetlin.com (Daniel Chetlin)
Subject: Re: References and local
Message-Id: <8qnshr02bs@news1.newsguy.com>
On Mon, 25 Sep 2000 02:27:57 GMT,
Martien Verbruggen <mgjv@verbruggen.comdyn.com.au> wrote:
>On 24 Sep 2000 19:21:03 GMT,
> Daniel Chetlin <daniel@chetlin.com> wrote:
>> Here's my understanding of how this works.
>[snip]
>> And from the above diagrams, we see why it prints `foo' rather
>> than `baz'.
>
>Ok, that's how it works. But that doesn't mean that that is how it
>_should_ work, or how it was _meant_ to work. All it says is that in
>the one implementation of the language, they implemented it that way.
>and that implementation might be wrong.
[snip]
>It doesn't make sense from the documentation point of view. The
>documentation states that the _values_ are saved, and nothing else. It
>doesn't state that a new variable will be created, and I don't believe
>it intended to do that.
I just spent an hour reading through every mention of
`local(?!(?:(?:tim)?e)|/)' in the docs. Pretty much everywhere, it does
say that it gives a temporary value to a global. This is, at best,
_highly_ misleading, and at worst, quite wrong.
If one thinks of the variable as the entry in the symbol table, and the
`value' as the reference to the actual incarnation of that variable,
then in a way, local _is_ creating a temporary value by pointing the
symbol table entry to the new location. But as I said above, if this is
what's actually intended, it's evilly misleading.
What I imagine is the truth: when writing the docs, going into that much
detail about the way local _really_ works didn't seem sensible. The way
the docs describe it suffice to explain 95% of all uses of local,
especially for the average Perl programmer. Thus, they didn't bother
mentioning what really happens, which is that the symbol table entry is
modified to point to a different variable for the remainder of the
enclosing block.
I do think that's how it should and was meant to work, though. For one
thing, actually changing the value of the incarnation of the variable
and then swapping the old value back in later would be, I imagine, a
lot slower. For another, there are at least two ways to create
references that _do_ follow along with locals. There isn't,
unfortunately, any way that I can think of to simulate the "alternative
behavior" of local that we're discussing. Having local be able to
operate on lexical variables has been talked about for a while, and I
imagine the implementation of that could also be made to work for
C<local \$var> or something like that.
But consider what would happen if local currently behaved the
"alternative" way -- i.e. it overwrote the value of the variable pointed
to by the symbol table entry, and created a new variable which contained
the old value, so it could be retrieved later. There wouldn't be any way
to get to that old value. The way things are now, if you want to have
access to the old value, you use a hard reference, like Abigail did. If
you want to follow along with whatever the symbol table does and any
local calls that are made, you either use a soft reference or a typeglob
manipulation. That, in my mind, is the right kind of flexibility. It
would be nice to increase the flexibility by having local _able_ to
produce the alternate behavior, but I don't think it's necessary.
So, my arguments for why it's as it should be and as it's meant to be
aside, the documentation certainly needs to be fixed. I'd be happy to do
it if no one else wants it.
-dlc
------------------------------
Date: Mon, 25 Sep 2000 18:02:29 +0200
From: "Bengt-Arne Fjellner" <BAF@TT.LUTH.SE>
Subject: SV: ActivePerl ppm install DB_File on NT
Message-Id: <8qnt1g$26u$1@news.luth.se>
See Active state documentation for ppm
file:///C:/Perl/html/faq/ActivePerl-faq2.html (with your path to perl)
section firewall
1.. Set Environment Vars
Up to three environment variables need to be set.
Under Windows NT
Right click on "My Computer", click on "properties", select the
"environment" tab. These are your environment settings. Make the following
changes:
1.. Add the setting HTTP_proxy, with your proxy name as the value (you
must include "http://" ), followed by a colon and the proxy port, if
applicable; e.g., "http://proxy:8080"
2.. If you require a user name and/or password to access your proxy, add
the settings HTTP_proxy_user and HTTP_proxy_pass, with your user name and
password as the respective values
3..
<acunet3278@my-deja.com> skrev i meddelandet
news:8qnlth$g28$1@nnrp1.deja.com...
> Activestate perl is running on NT. We want to install DB_File to run a
> perl website search engine from kscripts.com.
>
> The people at kscript, suggested installing 'DB_File' by using this
> command: "ppm install DB_File"
>
> C:\Perl>ppm install DB_File
> Retrieving package 'DB_File'...
> HTTP POST failed: 500 (Can't connect to www.activestate.com:80 (Bad
> hostname 'ww
> w.activestate.com')), in SOAP method call. Content of response:
> at C:/Perl/site/lib/PPM/SOAPClient.pm line 222
>
> The machine where this command is run is behind a firewall. Could that
> be why the workstation cannot conenct to www.activestate.com
....
> http://www.pucho.com
> Call me at Keen.com, Your Live Answer Community.
> http://www.keen.com/acunet3278?ref=1
>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Mon, 25 Sep 2000 17:17:32 +0100
From: "Tigz" <tigz@ntlworld.com>
Subject: tekboard.cgi
Message-Id: <SUKz5.10857$He3.203646@news2-win.server.ntlworld.com>
I have just downloaded tekboard.cgi, in the demonstration found here
http://www.hail.icestorm.com/metertek/cgi-bin/scripts/tekboard.cgi if its a
new message it displays a diffrent gif/gpg, how can i do this?
Thanks
Mick
------------------------------
Date: Mon, 25 Sep 2000 10:11:45 -0700
From: Sarah Officer <OfficerS@aries.tucson.saic.com>
Subject: Re: use vs. @ISA
Message-Id: <39CF8751.17D1CF8D@aries.tucson.saic.com>
So, if you use ISA, are deriving your current object form the ISA's
object?
package Foo;
@ISA = qw( Bar );
Is this similar to C++ derivation, and if a method isn't defined in
Foo, then Bar's method of the same name would be called?
Sarah, another newbie to ISA
Bart Lateur wrote:
>
> bdesany@my-deja.com wrote:
>
> >What's the difference? Is it that subroutines in packages that are
> >being "used" are not accessible as object methods, and those in
> >packages in @ISA are?
>
> Wrong comparison. even wit hOO modules, you still need to "use" the
> module (or require it) that you reference in @ISA. "use base MODULE"
> will do both.
>
> What is remarkable about "use", is that it imports the exported
> functions from the used module into the namescpace where you call it
> from. For example:
>
> package Foo;
> use Cwd;
>
> The function cwd() exported from Cwd, will be imported into package Foo
> and thus is available as Foo::cwd.
>
> OO modules usually do not depend on this import mechanism. The class
> name or object reference from which the method is called, will tell perl
> were to search for it. And here another difference between OO and
> procedural modules chimes in: the @ISA hash tells perl where to search
> for any methods that you call, but that it didn't find in the class
> (module) you explicitely called. That would never work in procedural
> function calls.
>
> --
> Bart.
------------------------------
Date: Mon, 25 Sep 2000 10:56:18 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Warning message in Win32::ODBC module
Message-Id: <MPG.143931a0efc201c998adbd@nntp.hpl.hp.com>
In article <39cf1bea.2597835@news.grnet.gr> on Mon, 25 Sep 2000 09:40:37
GMT, Philip Lees <pjlees@ics.forthcomingevents.gr> says...
...
> Thanks for the help, Henry. That killed one of the warnings. However,
> I'm still getting the warning (three times) on the line:
>
> >> s/ +$//; # HACK
...
> Anyway, as I said originally, the program works OK - it's just a bit
> annoying getting those messages every time.
foreach (@Results) {
next unless defined;
s/ +$//; # HACK
...
or, equivalently:
foreach (grep defined, @Results) {
s/ +$//; # HACK
...
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 25 Sep 2000 15:27:19 GMT
From: Cornelia Sieber <chsieber@yahoo.com>
Subject: Win32::API Call Problem
Message-Id: <8qnqrr$mg4$1@nnrp1.deja.com>
Hi,
I'm a newbie to perl and tried to write a Perl script using the
Win32::API module to extract printer properties on WinNT 4.0.
It runs, however, the variable which is supposed to contain the string
for further processing ($pprinter) is as it was before - no information
there. The return values from OpenPrinter/GetPrinter/ClosePrinter calls
are all 0.
Has anybody an idea where the problem is?
Thanks a lot
Conny
############### Perl script ###############################
use Win32::API;
$OpenPrinter = new Win32::API("Winspool.drv","OpenPrinter",[p,p,p],n);
$GetPrinter = new Win32::API("Winspool.drv","GetPrinter",[p,n,p,n,p],n);
$ClosePrinter = new Win32::API("Winspool.drv","ClosePrinter",[p],n);
defined ($OpenPrinter) or die "OpenPrinter nicht definiert\n";
defined ($GetPrinter) or die "GetPrinter nicht definiert\n";
defined ($ClosePrinter) or die "ClosePrinter nicht definiert\n";
$defaults = "";
$lpstr = "MyPrinter";
$lphandle = pack "s", "";
$level = 1;
$pprinter = pack "s200", "";
$cbbuf = 200;
$pcbneeded = pack "s", "";
$rt = $OpenPrinter->Call($lpstr,$lphandle,$defaults) or die "OpenPrinter
didnt work";
print "Return from OpenPrinter: $rt \n";
print "Handle: $lphandle \n";
$rt = $GetPrinter->Call($lphandle,$level,$pprinter,"200",$pcbneeded);
print "Return von GetPrinter: $rt\n";
$rt = $ClosePrinter->Call($lphandle);
print "Return von ClosePrinter: $rt\n";
#######################################################################
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
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 4424
**************************************