[9943] in Perl-Users-Digest
Perl-Users Digest, Issue: 3536 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 25 12:07:32 1998
Date: Tue, 25 Aug 98 09:00:18 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 25 Aug 1998 Volume: 8 Number: 3536
Today's topics:
"bind" Problems with Internet Server Program robertrose@my-dejanews.com
ado, setup, asp David@iqtexas.com
DBI file <Debra.Ruch@gov.edmonton.ab.ca>
Experience using HTML::TreeBuilder for wysiwyg doc conv <christian.jaeger_NOSPAM@rektorat.ethz.ch>
Re: Is there a size limit on $ vars? (Tad McClellan)
Re: Perl compiler huntersean@hotmail.com
Re: Perl compiler <lily@tigr.org>
Re: Perl compiler <upsetter@ziplink.net>
Re: Perl documentation (Norman UNsoliciteds)
Re: Perl documentation huntersean@hotmail.com
Re: Perl documentation (I R A Aggie)
Re: Perl documentation <dan@fearsome.net>
Problem with "bind" statement in web server app robertrose@my-dejanews.com
probs building on NT, yes I've read the manual! <j8flynn@hursley.ibm.com>
Regex question - removing HTML tags.... iada@hplb.hpl.hp.com
Taint checking in NT <johnc@interactive.ibm.com>
Re: Using LWP to connect from different local addresses <aas@sn.no>
Re: Y2K Date Support (I R A Aggie)
Re: Y2K Date Support (I R A Aggie)
Re: Y2K Date Support <dgris@rand.dimensional.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 25 Aug 1998 15:06:50 GMT
From: robertrose@my-dejanews.com
Subject: "bind" Problems with Internet Server Program
Message-Id: <6rujua$4pi$1@nnrp1.dejanews.com>
I've written a perl program (below) to make a server-side internet connection
on a unix platform.
I've executed it in a unix shell without any problems. However, when I try to
execute it as a cgi script, it always fails at the bind statement. Any ideas
as to why this is happening?
(The subroutine "tprint" is used to print out program status in html so that
it shows up on the web page.)
Thanks in advance,
Robert
===============================================================================
$proto = getprotobyname('tcp');
$printtext = "before socket \n";
&tprint;
socket(INFILE, PF_INET,SOCK_STREAM, $proto) || die "Can't open a
socket!!!!\n";
$printtext = "before bind \n";
&tprint;
$printtext = "died in binding \n";
$temp = bind(INFILE, sockaddr_in(10200,INADDR_ANY)) || die &tprint;
$printtext = "bind value = $temp \n\n";
&tprint;
$length = 1; # number of characters to be read
$printtext = "before listen \n";
&tprint;
listen(INFILE, $length);
$printtext = "before accept \n";
&tprint;
accept(INF,INFILE);
==============================================================================
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 25 Aug 1998 15:40:39 GMT
From: David@iqtexas.com
Subject: ado, setup, asp
Message-Id: <6rultn$7lp$1@nnrp1.dejanews.com>
I am new to ADO and need some guidance on setting it up.
I've included my global.asa and my .asp code.
For those who don't know perlscript, you should be able to get the syntax if
you are familiar with ASP.
How do I know if a connection is made?
The dsn is correct. The database has 24 rows and the user has the
permissions.
Thanks for any help,
David
.ASP
-----
<%
$Rec=$Conn->Execute("select * from users order by name");
$Rec->MoveLast();
$Rec->MoveFirst();
%>[<%=$Rec->BOF()%>]<br><%
%>[<%=$Rec->EOF()%>]<br><%
%>[<%=$Rec->RecordCount()%>]<br>
output
-------
[0]
[0]
[-1]
Note: result is same even if I don't declare the rec object in global.asa.
GLOBAL.ASA
-----------
<OBJECT RUNAT=Server SCOPE=Session ID=Conn PROGID="ADODB.Connection"></OBJECT>
<OBJECT RUNAT=Server SCOPE=Session ID=Rec PROGID="ADODB.Recordset"></OBJECT>
<SCRIPT LANGUAGE=PerlScript RUNAT=Server>
sub Session_onStart{ $Conn->Open("DSN=x;UID=x"); }
sub Session_onEnd{ $Conn->Close(); }
</SCRIPT>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 25 Aug 1998 09:24:12 -0600
From: "Debra Ruch" <Debra.Ruch@gov.edmonton.ab.ca>
Subject: DBI file
Message-Id: <35e27363.0@champ>
I've gone thru several FAQ's but I can't find how the DBI file is created.
Should it have been included in the install? We're running oracle on an NT
server.
thanks
------------------------------
Date: Tue, 25 Aug 1998 17:34:29 +0200
From: jaeger <christian.jaeger_NOSPAM@rektorat.ethz.ch>
Subject: Experience using HTML::TreeBuilder for wysiwyg doc conv.?
Message-Id: <35E2D985.C13C5D60@rektorat.ethz.ch>
Hello!
I'm looking for a system for publishing a medium size site (~100
documents), and that is suitable for this purpose: I want to write html
source documents in a wysiwyg editor with only very few formatting
(+-only functional formatting), and then convert these raw documents to
the ones on the Web. The raw docs should be entertainable by people who
don't know anything about the layout (except to give perhaps some
directives like writing "{tabletype=list}" above a table to give the
converter information about the kind of table, or writing "{arrow}"
which should be replaced by a gif with an arrow ...).
Does anybody have experience in using HTML::TreeBuilder for such
conversions? Or alternatives? Or additional tools?
Thanks!
Chris Jaeger
------------------------------
Date: Tue, 25 Aug 1998 10:37:23 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Is there a size limit on $ vars?
Message-Id: <jnlur6.hqg.ln@metronet.com>
YabbaDoo (send.spam.only@this.address) wrote:
: The line of code in question is;
: $ls = `ls $file`;
: $file="*.*" and this is a command to list all matching files into the $ls
: variable.
Do you know what files will match that glob?
Only those that have a dot in the filename.
If you want all (except for initial dot) files in Unix, you use
just an asterisk alone.
: It has been working fine until I added some files to be listed into $ls. There
: are now approximately 3400 files. Each file name is 13 chrs.
: Is there a limit as to the size of the $ls variable?
No.
There is (often) a limit based on what shell is used.
(backticks invoke a shell)
Best to avoid the shell and do it all from within perl:
@files = <*.*>; # see 'glob' in the perlfunc man page
or
@files = glob($file);
: I have found 2 sets of online doco but no indication of *size limits* on any
: vars of any type. If you know of better doco please point me at it.
That is because it is not a limitation in Perl, it is in the shell.
I expect that shell docs mention it.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 25 Aug 1998 15:19:37 GMT
From: huntersean@hotmail.com
Subject: Re: Perl compiler
Message-Id: <6rukm9$5tk$1@nnrp1.dejanews.com>
In article <35E29639.59E84CCC@dead.end.com>,
no.uce@dead.mailbox.com wrote:
> Tom Christiansen wrote:
> .
> >
> > You lose karma points by withholding. You gain prestige not by what
> > you sell nor by what you buy, but rather ......
> [snip]
>
> For general information:
> Firstly Karma isn't measured by points
> Secondly just giving sets up the return for karma at a very basic level.
>
> Your every action, thought and word throught your every existence creates
> enormous ripples on your karma and if you're basic motivations are other than
> that of being the best person you can, you will find yourself on the receiving
> end of the bad karma that you yourself have generated until you no longer
> generate it. This is what is meant by the "Transmigration of the souls".
> Things which undo the creation of good karma are:
>
> complacency
> intollerance
> not respecting the sacred nature of life
> narrow mindedness
> stubborness
> insicerity
>
> Of which insincerity is a pretty major one.
>
What about pomposity, poor sense of humour, cold pizza, runny scrambled egg,
lumpy custard ... or posting loads of pseudo-religious drivel to clpm that has
no relevance to perl (unless a dont_respect_the_sacred_nature_of_life function
has been added to the language while I wasn't looking).
Executing perl -d shows me that $karma is actually a reference to an anonymous
hash, and it is actually measured in "points" and "prizes".
Starting afresh...
DB<1> x $karma
0 HASH(0x1d3290)
'points' => 100
'prizes' => ''
When I call dont_respect_the_sacred_nature_of_life, my $karma->{points}
decrease by one. Thusly...
DB<3> x $karma
0 HASH(0x1d3290)
'points' => 99
'prizes' => ''
When I call the little documented eat_pizza function, however a strange and
wonderful thing happens...
DB<5> x $karma
0 HASH(0x1d3290)
'points' => 100
'prizes' => 'full and rotund belly'
These results attained using perl 5.002 running on solaris 5.5.1
YMMV
Sean Hunter
PS what happens to $karma when instead of hiding behind a silly pseudonym you
contribute massively to the development of a language, and free software in
general, write excellent and helpful reference documentation, and spend all
your time and effort helping people is left as an exercise for the reader.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 25 Aug 1998 11:28:31 -0400
From: "Lily Y. Fu" <lily@tigr.org>
Subject: Re: Perl compiler
Message-Id: <35E2D81F.4702@tigr.org>
I'd like to thank everyone replied my seeking for help email!
But, I still need furthur help. Here is my situation:
We have a webserver running on a host outside the firewall
Host IN || Host OUT
||
||
||
||
||
================> ftp from IN to OUT
||
||
||
users: A, B, C || user: webuser
||
/home/A || /some/dir/users/A
/home/B || /some/dir/users/B
/home/C || /some/dir/users/C
|| /other/important/directories/
We want to give all staff A, B, C a homepage
on the host outside the firewall,
and those webfiles are kept at OUT:/some/dir/users/A, B, C
but there is no account for each individual users,
only a genetic user account, say "webuser", on the OUT host.
I wrote a program pushweb, which will upload the homepages
for a user from host IN to host OUT using NET::FTP module
(and NET::Telnet module)
Below is the code segment:
chdir ($homedir) || die "can't chdir to $homedir:$!\n";
$ftp = Net::FTP->new("out.tigr.org");
$ftp->login("webuser", 'webuser_passwd');
$ftp->cwd("/somedir/users/A");
$ftp->type ("binary");
$ftp->put("$file");
$ftp->quit;
$t = new Net::Telnet (Timeout =>60);
$t->open("out.tigr.org");
$t->login("webuser", 'webuser_passwd');
$t->cmd("cd /somedir/users/A");
$t->cmd ("do something");
$t->close;
the passwd is in clear text.
Here is the requirement:
1. I want user A, B, C be able to run the program themselves,
so, they need read and execute permission
I tried to make it only readable, but perl complains
"Permission defined", I guess perl is an
interpreted language,
it needs the read permission to read it
2. But I don't want user A, B, C to know the webuser/passwd
information on the OUT host, because there are other
important staff on the machine, people may login
to the host and so something harmful,
so, I can't encrypt the passwd and ask user to type in
the passwd for webuser
3. so, I am thinking, if I can convert the perl
program into binary,
it's safer so that users can't see the
passwd in clear text
4. The program users are not highly sophisticated,
and this password is not the top secret,
but, I do not want every user just look at the
program to know the password.
Some people suggested to use a wrapper with 755 permission
calling the program with password set 700 permission,
but I got permission denied (the 700 doesn't give read
permission)
userpush.pl owner lily, permission 755, wrapper, call pushweb
pushweb owner lily, permission 700 <== has the passwd info
How can I make pushweb executable by everyone
but can't be read by everyone?
Use the setuid? but I don't know how to implement it.
Can you give me an example?
Thanks,
Lily
=================
------------------------------
Date: Tue, 25 Aug 1998 15:51:15 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Perl compiler
Message-Id: <T3BE1.88$Ed2.1235853@shore>
Honza Pazdziora <adelton@fi.muni.cz> wrote:
: On Tue, 25 Aug 1998 10:21:40 -0400, Lily Y. Fu <lily@tigr.org> wrote:
:> Thank you Tom, after being on this news group one day,
:> I got nothing but a taste of your personnality.
:> That is plenty.
: Not true. You got very reasonable answer, saying that if your only
: reason for compiling scripts is hiding a plaintext password in the
: binary (on Un*x, we have strings command), do not do that.
What might have been reasonable would have been to point her in the
direction of some resources regarding ways to safely accomplish her
objective ("perldoc perlsec | grep password" yields nothing). Someone who
truly wished to help might have helped her to understand whether the
security she seeks is even possible, and what the different possibilities
are. On the other hand, someone who just gets off by parading his
intellectual superiority would simply insult her for being ignorant
(there's no evidence she's stupid or lazy -- just new at this).
--Art
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: Wed, 26 Aug 1998 00:09:39 +0900
From: No.unsoiliciteds@dead.end (Norman UNsoliciteds)
Subject: Re: Perl documentation
Message-Id: <No.unsoiliciteds-2608980009390001@cs11k39.ppp.infoweb.or.jp>
In article <904039530.26381.0.nnrp-10.c2deb1c5@news.demon.co.uk>, "Daniel
Adams" <dan@fearsome.net> wrote:
> Russ Allbery wrote in message ...
> >Could you define "deluged" for me? I'm extremely curious. I get, on the
> >average, about 10-20 spam messages a week, which is so far below the event
> >horizon for the amount of mail that I get that I don't even notice it, and
> >I'm curious how much of that is due to our local spam blocking and due to
> >the fact that I'm using a .edu address.
Well how much do you reckon to make it worth my time to conect up to my
mail account and hand delete the dross ? Please note not everybody has
access to a unix shell account, I'm perfectly capable of creating a mail
filter but I have to download the mail from my ISP first, at my expense,
to then filter it locally on my machine.
--
The Dinosaurs were so stupid, they couldn't
even devise the means of thier own extinction,
they had to wait for Nature to do it for them.
------------------------------
Date: Tue, 25 Aug 1998 14:55:21 GMT
From: huntersean@hotmail.com
Subject: Re: Perl documentation
Message-Id: <6ruj8q$3mp$1@nnrp1.dejanews.com>
> I can't see (in particular Tom C's) people's problem with people munging
> their address in usenet posts - how the hell does it affect you - if you
> want to reply to them, do so in the same medium as their original message,
> following convention, and post a usenet response. You all champion spam
> filters, but I find them to be of very limited use - unless you have the
> email address of every single spammer in a database, every filtering effort
> will fall short, because it is _impossible_ to differentiate between a real
> message and a carefully-disguised spam.
>
> Dan Adams
> dan@fearsome.net
>
>
As you well know, the vast majority of spam isn't disguised at all. I've yet
to have one slip through my current procmail setup. The headers of almost
all spam mails are nothing like the real thing. It's not Tom Christiansen's
fault if you can't set up your .procmailrc worth a damn. Now, if you can't
filter your mail at source, you have more of a problem. On this account,
since I can't use procmail, I just let people spam me, and spend +-5 mins per
day forwarding spam on to abuse.net. I average 5 or 6 spam accounts shut
down a week, and I consider it a service to the wider net.
Sean Hunter
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 25 Aug 1998 11:33:24 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Perl documentation
Message-Id: <fl_aggie-2508981133240001@aggie.coaps.fsu.edu>
In article <904039530.26381.0.nnrp-10.c2deb1c5@news.demon.co.uk>, "Daniel
Adams" <dan@fearsome.net> wrote:
+ Try about 10-20 each day, and that's _after_ the spam filters and killfiles
+ etc ad infinitum. And there is a definite correlation to how many posts I
+ have been making on Usenet, and to which groups - some groups are just
+ killers, and its normally the ones you would least expect - alt.atheism for
+ example seems to have a veritable horde of spammers trawling it for
+ addresses. Go figure.
No, its quite simple. alt.atheism has to be near the very top of any given
spammer's trawl list. And they may want to avoid comp.* groups because
they may fear retribution from people who *can* track them down.
+ email address - however, when I post my URL I get spam at every single one
+ of my email addresses that is listed on the URL or pages linked to by the
+ URL -
There are web spiders specifically tuned for retrieving mailto: links.
I've heard one solution is to add a %20 (space), so that you have:
<a href="mailto:%20dontspamme@die.spammmer.die">Mail Me!</a>
The browsers handle it ok (bug? feature?), but some of the 'bots ignore
it.
+ If someone wishes to post anonymously to avoid this, let them.
Let them do it *correctly*, then. Flooding an innocent third party
with bounces from all *your* spam is unacceptable and is the same thing
as what spammers do: shift the cost to someone else.
+ You all champion spam
+ filters, but I find them to be of very limited use - unless you have the
+ email address of every single spammer in a database, every filtering effort
+ will fall short, because it is _impossible_ to differentiate between a real
+ message and a carefully-disguised spam.
Most spam ISN'T CAREFULY disguised. IT COMES WITH CERTAIN BUZZ WORDS,
like MAKE MONEY or $$$$CASH$$$$$ or SEXXX! Someone was working on a
scheme to score incoming email with regard to these certain buzzwords,
and was getting some good results. I haven't heard anything of late
about that.
You may want to check out the latest-greatest sendmail, and its spam fighting
features. One of them includes a database of KnownLazySpammers.
James
------------------------------
Date: Tue, 25 Aug 1998 16:45:38 +0100
From: "Daniel Adams" <dan@fearsome.net>
Subject: Re: Perl documentation
Message-Id: <904059997.26219.0.nnrp-09.c2deb1c5@news.demon.co.uk>
huntersean@hotmail.com wrote in message <6ruj8q$3mp$1@nnrp1.dejanews.com>...
>As you well know, the vast majority of spam isn't disguised at all. I've
yet
>to have one slip through my current procmail setup. The headers of almost
>all spam mails are nothing like the real thing.
I think you might well have a point, and I'm not sure just how thoroughly
stupid it proves me to be that I hadn't thought about this before - I'm
filtering using procmail, but I'm only filtering based on domain and subject
line - in other words I haven't set it up to take a look at all that other
fun stuff in mail headers - is it even possible? Surely there aren't many
other header lines you can use for filtering becasue different mail
apps./servers include (IME) different header lines, right?
> It's not Tom Christiansen's
>fault if you can't set up your .procmailrc worth a damn.
No, its my fault. I never laid any claim to knowing anything about
procmail - I only know the smattering I had to learn to set the thing up and
build a few simple filters. Perhaps instead of attacking me for that, you
(or somebody else) might paste into their next message the procmail filters
THEY use, because obviously they work better than mine. That way we'll all
be spam-proof AND be able to start talking about Perl again.
[snip]
--
Dan Adams
dan@fearsome.net
------------------------------
Date: Tue, 25 Aug 1998 15:19:30 GMT
From: robertrose@my-dejanews.com
Subject: Problem with "bind" statement in web server app
Message-Id: <6rukm3$5tg$1@nnrp1.dejanews.com>
I've got a server program (see below) that performs a socket connection. It
runs on a unix platform. However, it always fails at the "bind" statement
when executed as a web-page cgi script.
Any ideas why?
Thanks, in advance, for your help.
Robert
P.S. The subroutine, "tprint", just prints out the execution status to the
web page.
==============================================================================
$proto = getprotobyname('tcp');
$printtext = "before socket \n";
&tprint;
socket(INFILE, PF_INET,SOCK_STREAM, $proto) || die "Can't open a
socket!!!!\n";
$printtext = "before bind \n";
&tprint;
$printtext = "died in binding \n";
==> $temp = bind(INFILE, sockaddr_in(10200,INADDR_ANY)) || die &tprint;
$printtext = "bind value = $temp \n\n";
&tprint;
$length = 1; # number of characters to be read
$printtext = "before listen \n";
&tprint;
listen(INFILE, $length);
$printtext = "before accept \n";
&tprint;
accept(INF,INFILE);
===============================================================================
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 25 Aug 1998 17:06:22 +0100
From: James O Flynn <j8flynn@hursley.ibm.com>
Subject: probs building on NT, yes I've read the manual!
Message-Id: <35E2E0FD.9C523F@hursley.ibm.com>
New both to perl and NT. Been trying to write a module
to do the same as:
fork()
{
setuid();
setgid();
exec();
}
and I'm having lots of fun.
Anyway, took the libwin32 source and cloned the Process
directory to make a ProcessWithProfile dir.
Proceeded to bastardize all the stuff to do CreateWithProfile
which is a painful way of doing CreateProcessAsUser, which
involves: LookupAccountName(), SetSecurityDescriptorOwner(),
DuplicateTokenEx() and finally CreateProcessAsUser().
It took me a little longer than 5 minutes to kind of work out
what I think NT does. I'm still not too sure about it but...
going into the libwin32 dir, running perl Makefile.PL generates
a Makefile which NMAKE then barfs on, I have VC++5.
Moans about not having an equal sign in a macro for doing what
looks like ld. This is all NMAKE stuff and perl, which looks between
semi-familiar to very weird to me.
I would be very grateful for some helpful suggestions, or better, a
shrink wrapped module someones already done:-)
Cheers,
James.
--
4920616d206e6f742061206e756d62657221
------------------------------
Date: Tue, 25 Aug 1998 14:46:28 GMT
From: iada@hplb.hpl.hp.com
Subject: Regex question - removing HTML tags....
Message-Id: <6ruio4$2gi$1@nnrp1.dejanews.com>
Hi,
I'm very new to perl and haven't got my head around the joys of regular
expressions -> I came across this example for removing the HTML tags from a
string and can't work out how it works:
$value=~s/<([^>]|\n)*>//g
from what I understand it strips the < > pair and anything inbetween, the []
being a character class, the parenthesis being a group and the * being one or
more tokens to match (the g being global replace?)
However....I'm confused by the caret - not the beginning of a string in this
context? and the | in the character class...
I've tried consulting the man pages as well as all the tutorials I could find,
and am still stuck :-(
Can anyone tell me how this works and/or point me in the direction of an
idiots guide to Regular expressions?
Thanks
Ian
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 25 Aug 1998 11:25:40 -0400
From: "John Call" <johnc@interactive.ibm.com>
Subject: Taint checking in NT
Message-Id: <6rul33$22cq$1@ausnews.austin.ibm.com>
I like to develop on Unix but have been asked to develop my current project
on NT. I want to enable taint checking. I left in the the shebang line as
follows:
#!/usr/bin/perl -w -T
Perl seems to be performing as asked. My question, is this the proper way to
turn on warnings and taint checking on NT systems or is there a more proper
way that is preferred by Perl?
Just trying to get it right.
--
John Call
IBM Interactive Media
------------------------------
Date: 25 Aug 1998 12:23:01 +0200
From: Gisle Aas <aas@sn.no>
Subject: Re: Using LWP to connect from different local addresses
Message-Id: <m3btp92we2.fsf@furu.g.aas.no>
Michiel van Leening <mivale@dds.nl> writes:
> I'm testing a local app for which I have to connect to my server from
> different IP addresses. I have multiple addresses set up locally, but
> how do I go about setting the LocalAddr to one of those addresses. I've
> located the creation of the socket (believe it's in http.pm) but I'm not
> gonna alter that file :-)
>
> LWP default connects from localhost...(I think at least)...but I want to
> use one of my other addresses. I also want to maintain the default
> LWP::UserAgent structure in my scripts.
This feature has been requested before. The simplest solution is to
add a variable that holds any additional parameters that should be
passed to the IO::Socket::INET constructor. For instance:
@LWP::Protocol::http::EXTRA_SOCK_ARGS = (LocalAddr => "some.other.name");
A more general idea would be to be able to influence the class name
that is used when instantiating new sockets. This could either just
be a simple variable:
$LWP::Protocol::http::SOCK_CLASS = "MySock";
package MySock; use base 'IO::Socket::INET';
sub new {
my $class = shift;
return $class->SUPER::new(@_, LocalAddr => "some.other.name");
}
or perhaps have some object factory somewhere. I have not been very
comfortable with any of these interfaces, and that's the main reason
there is no way to do this yet.
--
Gisle Aas
------------------------------
Date: Tue, 25 Aug 1998 10:53:34 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Y2K Date Support
Message-Id: <fl_aggie-2508981053350001@aggie.coaps.fsu.edu>
In article <6rtu9s$cci$1@nnrp1.dejanews.com>, dave@mag-sol.com wrote:
+ It only goes to 1999 because there is a bug in your program.
No, not true...
+ > ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
+ > $date = "$days[$wday], $months[$mon] $mday, 19$year at
In the year 2000, this program would have reported the year as:
19100
+ Reread the docs for localtime and see if you can spot it.
Indeed...
James
------------------------------
Date: Tue, 25 Aug 1998 11:05:56 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Y2K Date Support
Message-Id: <fl_aggie-2508981105560001@aggie.coaps.fsu.edu>
In article <35E21BF4.6B46@arrowweb.com>, mhanson@arrowweb.com wrote:
Oh, this is so ugly...and inefficient...
+ if ($hour < 10) { $hour = "0$hour"; }
+ if ($min < 10) { $min = "0$min"; }
+ if ($sec < 10) { $sec = "0$sec"; }
+ $date = "$days[$wday], $months[$mon] $mday, 19$year at
+ $hour\:$min\:$sec";
$hour = sprintf("%02d",$hour);
$min = sprintf("%02d",$min);
$sec = sprintf("%02d",$sec);
Or just:
$date = sprintf("%s, %s %d, %d at %02d:%02d:%02d",
$days[$wday],$months[$mon],$mday,$year,$hour,$min,$sec);
James
------------------------------
Date: Tue, 25 Aug 1998 15:13:51 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: Y2K Date Support
Message-Id: <6rujil$8vg$1@rand.dimensional.com>
[posted to comp.lang.perl.misc and mailed to the cited author]
In article <fl_aggie-2508981053350001@aggie.coaps.fsu.edu>
fl_aggie@thepentagon.com (I R A Aggie) wrote:
>In article <6rtu9s$cci$1@nnrp1.dejanews.com>, dave@mag-sol.com wrote:
>
>+ It only goes to 1999 because there is a bug in your program.
>
>No, not true...
Hmmmm.....
>+ > ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
>+ > $date = "$days[$wday], $months[$mon] $mday, 19$year at
>
>In the year 2000, this program would have reported the year as:
>
>19100
In the year 2000 it will report the wrong result, that sure sounds
like a bug to me.
dgris
--
Daniel Grisinger dgris@perrin.dimensional.com
"No kings, no presidents, just a rough consensus and
running code."
Dave Clark
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 3536
**************************************