[13686] in Perl-Users-Digest
Perl-Users Digest, Issue: 1096 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 16 20:05:28 1999
Date: Sat, 16 Oct 1999 17:05:08 -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: <940118707-v9-i1096@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 16 Oct 1999 Volume: 9 Number: 1096
Today's topics:
Re: "Protecting" Perl source code <code@ync.net>
Re: Adding modules from the resource kit <rootbeer@redcat.com>
Re: another pointless debate was[Re: and versus &&] <rootbeer@redcat.com>
Re: Assistance required, please help... (David Efflandt)
can i make a cgi run it self <yhm@inter.net.il>
Re: can i make a cgi run it self <flavell@mail.cern.ch>
Re: can i make a cgi run it self <rootbeer@redcat.com>
Re: Convert time-date string to epox seconds, <marcel.grunauer@lovely.net>
Re: Determining the connection speed to the Internet <flavell@mail.cern.ch>
Re: Determining the connection speed to the Internet (Abigail)
Re: Determining the connection speed to the Internet (Abigail)
Re: Displaying 2 digits in time (David Efflandt)
Re: encryption and crypt() ? <dan@tuatha.sidhe.org>
Re: encryption and crypt() ? <rootbeer@redcat.com>
Re: Grabbing image size? <syeates@manuka.cs.waikato.ac.nz>
Re: Help with extracting a portion of a string (Abigail)
Re: How can return a dir listing from a foreign FTP sit <rootbeer@redcat.com>
Re: How to inquire, position and click the mouse in PER (Eric Bohlman)
How to install GD.PM <me@toao.net>
Re: How to socket (David Efflandt)
Re: list last five messages (Tad McClellan)
Re: LWP and IP spoofing <rootbeer@redcat.com>
Re: LWP and IP spoofing (Martien Verbruggen)
Re: Need a next/previous routine for a Web CGI script (Eric Bohlman)
Re: please help the telnet program (David Efflandt)
Re: rand generator limitatoins - request expert advice <rootbeer@redcat.com>
Re: Trouble with perl debug mode and FreeBSD 3.3! <rootbeer@redcat.com>
Re: Where can I find the module GD for Windows servers? (John Armsby)
Re: Working on separate records in a file (Tad McClellan)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 16 Oct 1999 17:04:46 -0500
From: "Code" <code@ync.net>
Subject: Re: "Protecting" Perl source code
Message-Id: <UG6O3.10647$E_1.542128@typ11.nn.bcandid.com>
If you make the script air tight, then there should be almost no way for
them to get in, at least no simple way. It sounds like you have functions
which are vulnerable, but you are counting on the fact that no one will see
your code and realize those exploits. Microsoft seemed to do this as well,
and now we have the saying "Security through Obscurity, is really no
security", or something along those lines. It's best to do testing on it,
make it air tight, and then hopefully no matter what people see of the raw
code, it won't matter. The best way to learn security is to see how others
do it, and then try it yourself. "Hacking" your own system isn't a crime,
and it can show you some ways that people might get into your script.
-Code
code@ync.net
Come visit ProjectPerl for all your custom PERL script needs!
http://projectperl.digitalsea.net
We also have a variety of Free PERL Scripts for download!
----------------------------------------------------------------------------
-------------
Craig Vincent wrote in message <9BKN3.252$cF.192@198.235.216.4>...
>I'm looking at distributing various commercial perl scripts I've developed.
>Obviously once I start distributing it more than likely it will be passed
>around in the underworld webmaster market (assuming people like what I've
>done :D).
>
>My question to you gurus is this:
>
>Do you have any ideas or suggestions for protection features I could
>put into place to help minimize the damage done by people pirating my
>scripts?
>
>Obviously if the script falls into the hands of someone who knows a decent
>amount
>of perl no amount of security I place will stop he/she from usurping the
>services of my scripts
>however if I can at least protect myself against those who know little or
no
>perl it would
>be very beneficial.
>
>Sincerely,
>
>Craig Vincent
>
>
------------------------------
Date: Sat, 16 Oct 1999 14:28:38 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Adding modules from the resource kit
Message-Id: <Pine.GSO.4.10.9910161426210.25558-100000@user2.teleport.com>
On Sat, 16 Oct 1999, Robert Young wrote:
> I have the version of Perl for SCO as destributed on their Skunkware
> CD. I have loaded 'gcc' from it and loaded the 'DateCalc' code from
> theResource Kit. I was able to compile the DateCalc code and it seemed
> to install OK.
"seemed to"? Did you run 'make test' to find out whether it was compiled
correctly? Just because it didn't complain during compilation doesn't mean
that all is well!
> When I try to run a short test script. I get a core dump.
Yes. Well, that's a sign that you should go back and try 'make test'. If
you built perl yourself, be sure to do 'make test' on that as well.
Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 16 Oct 1999 15:05:30 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: another pointless debate was[Re: and versus &&]
Message-Id: <Pine.GSO.4.10.9910161457150.25558-100000@user2.teleport.com>
On 16 Oct 1999, lt lindley wrote:
> I can't think of any situation where or/and is required. Are there
> really any places where you cannot control the precedence with parens?
No, you can always parenthesize. (If you couldn't use parens somewhere, it
would be better to fix that (wouldn't it?) than to add a new operator.)
> Is there really any argument for them other than taste and style?
> (Not that taste and style aren't perfectly good arguments.)
When writing "open... or die", it's more difficult to make a precedence
error. Not impossible, mind you. You still have to pay attention to
precedence. But when version 5 relaxed the rules on parens around the args
to open(), the word-or operator made it easier to write correct
statements.
Using 'and' instead of '&&', 'or' instead of '||' and 'not' instead of '!'
are just One More Way to Do It. We don't _need_ to be able to write 0377,
0xff, and 0b11111111 either, of course. 255.000000 works just as well.
It's like the old ads for Almond Joy and Mounds said: Sometimes you feel
like a not, and sometimes you !
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 16 Oct 1999 22:32:01 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Assistance required, please help...
Message-Id: <slrn80hv7t.311.efflandt@efflandt.xnet.com>
On 15 Oct 1999 22:28:50 -0500, Abigail <abigail@delanet.com> wrote:
>Hobbes (hobbes@MailAndNews.com) wrote on MMCCXXXVII September MCMXCIII in
><URL:news:3808F338@MailAndNews.com>:
>..
>.. I am having trouble with checkboxes. Can someone please help me? Email me
>.. and
>.. I will give you the details of my problem.
>
>
>Tk problems are best discussed in comp.lang.perl.tk.
>
>But be sure to describe your problem there.
>
>
>Abigail
Abigail, what are we going to do with you? The original poster is most
likely a CGI newbie who has not discovered the proper *.cgi newsgroup
nor the Perl CGI module. They might find much insight by typing: perldoc CGI
They also need to install the ever illusive ESP::Transmit module, so we
can use the ESP::Receive module to get more complete details. ;-)
--
David Efflandt efflandt@xnet.com http://www.xnet.com/~efflandt/
http://www.de-srv.com http://cgi-help.virtualave.net/
http://thunder.prohosting.com/~cv-elgin/
------------------------------
Date: Sat, 16 Oct 1999 21:10:20 +0200
From: "Yuval Hamberg" <yhm@inter.net.il>
Subject: can i make a cgi run it self
Message-Id: <7uaiu9$666$1@news2.inter.net.il>
Can I make a CGI script run let say at 11:55PM every night automatically?
thanks
------------------------------
Date: Sun, 17 Oct 1999 00:49:58 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: can i make a cgi run it self
Message-Id: <Pine.HPP.3.95a.991017004657.15941A-100000@hpplus01.cern.ch>
On Sat, 16 Oct 1999, Yuval Hamberg wrote:
> Can I make a CGI script run let say at 11:55PM every night automatically?
CGI is a programming interface between a web server and your program.
CGI scripts neither run themselves, nor start at fixed points in time:
they are started by a web server, which in turn is provoked by a
WWW access.
What you're looking for is not a CGI script, it's a cron script.
And those don't run themself either; they are started by cron. How
to set that up depends on what OS you run; it isn't a Perl language
question either.
------------------------------
Date: Sat, 16 Oct 1999 16:18:01 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: can i make a cgi run it self
Message-Id: <Pine.GSO.4.10.9910161614310.25558-100000@user2.teleport.com>
On Sat, 16 Oct 1999, Yuval Hamberg wrote:
> Can I make a CGI script run let say at 11:55PM every night
> automatically?
I don't think so, or you wouldn't be asking here. :-)
But it sounds as if you want to use cron (or your system's equivalent) to
automatically run a program for you. Ask your local expert whether cron is
available for you. If you don't have a Unix-like system, you may need to
ask again in a newsgroup about your system.
Note that there's nothing Perl-specific here: The answer is the same
whether you're using Perl or not. Follow-ups set, in case there's any
Perl-specific followup.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 16 Oct 1999 23:56:53 GMT
From: Marcel Grunauer <marcel.grunauer@lovely.net>
Subject: Re: Convert time-date string to epox seconds,
Message-Id: <bx4JOLcj5VJdUqBJrfs4KhAgm+jG@4ax.com>
On Sat, 16 Oct 1999 08:41:45 -0700, lr@hpl.hp.com (Larry Rosler)
wrote:
> In article <6nEIOHWcK3SOh=xUg1VUFRasKPat@4ax.com> on Sat, 16 Oct 1999
> 11:40:34 GMT, Marcel Grunauer <marcel.grunauer@lovely.net> says...
>
> > print timelocal($sec,$min,$hour,$day,$month,$year);
>
> Oops.
>
> print timelocal($sec, $min, $hour, $day, $month - 1, $year - 1900);
>
> A good way to test this is to feed the result back to scalar
> localtime(). Too bad you didn't do that.
>
> Surprisingly, it still works with '1999' instead of '99', which must be
> due to some juju in the timelocal() module. It is specified to take the
> same arguments as the first six elements of the list of values that
> localtime() produces.
Yes. Sorry. I just compared localtime() with the output of the above
print statement, and didn't see too much difference. I'll be more
thorough next time.
--
Marcel, Perl Padawan
sub AUTOLOAD{$_=$AUTOLOAD;s;.*::;;;y;_; ;;print}&Just_Another_Perl_Hacker;
------------------------------
Date: Sat, 16 Oct 1999 23:23:10 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Determining the connection speed to the Internet
Message-Id: <Pine.HPP.3.95a.991016230640.6256P-100000@hpplus01.cern.ch>
On Sun, 17 Oct 1999, Henry Penninkilampi wrote:
> IMHO Ping is almost completely *useless* for this sort of thing.
I don't think it's as totally useless as you would have us believe.
N.B this is just an in-principle comment - I'm not pretending to know
whether this is of practical use in the questioner's situation.
> No
> offense, but why anyone would think that sending a series of 56-Byte
> packets from server to client would, in any way, reflect the rate at which
> the client can pull 7KB pages (and 10KB GIFs, and 30KB JPEGs) from the
> server is beyond me.
Well, that pretty much only measures the RTT for small packets. A
comparison with the RTT for large packets might be instructive though.
Well, you might find some interesting tie-ups by starting at
http://www-spires.slac.stanford.edu/comp/net/wan-mon/tutorial.html
and looking at their correlations of throughput with other measureables.
> To the best of my knowledge, there is no way to ascertain the default
> route's interface speed on the clients computer.
Even if it meant anything in terms of overall throughput...
> Anyway, the closest you can get is to measure *throughput* in the *right*
> direction with *real-world* data streams.
But if you want, for example, to advise your user how long their
download is going to take (30 seconds or 30 minutes can make a
significant difference!) you need to do it before they actually try it.
> The simplest way to do this is
> to simply *time* how long it takes the visitor to *download* your page
Sure, but by then it's too late to do anything about it.
------------------------------
Date: 16 Oct 1999 18:36:14 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Determining the connection speed to the Internet
Message-Id: <slrn80i2ur.q8s.abigail@alexandra.delanet.com>
Bob Tate (btate@primary.net) wrote on MMCCXXXVII September MCMXCIII in
<URL:news:pd3O3.1194$SU1.123965@news1.primary.net>:
``
`` While I am still reading a few books and searching the web I am trying to
`` develop code in Perl that will be able to determine the internet connection
`` speed of people as they visit my website. This would be useful in
`` determining what type of page to display to them.
You cannot, and you should not. The best you would be able to achieve is
a estimate of the roundtrip time to the last proxy in the chain; but this
is outdated as soon as you determine it. Furthermore, why should *you*
decide whether the fancy page is worth waiting for or not?
`` I believe that using
`` "Ping" is the way to go for starters, but not sure.
No, ping is not a good idea. Ping uses a different protocol (ICMP)
than HTTP (TCP/IP), which might different priorities in the various
routers and switches. Furthermore, due to its small packet size, ping
gives more an estimate about latency than about bandwidth. A long fat
pipe and a long thin pipe will give you the same result, and so will a
short fat pipe and a short thin pipe.
`` Any one have any ideas
`` as to were to look or what to read?
Yes. The HTTP RFC, and pay attention to the Accept header.
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 16 Oct 1999 18:40:48 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Determining the connection speed to the Internet
Message-Id: <slrn80i37d.q8s.abigail@alexandra.delanet.com>
Alan J. Flavell (flavell@mail.cern.ch) wrote on MMCCXXXVII September
MCMXCIII in <URL:news:Pine.HPP.3.95a.991016230640.6256P-100000@hpplus01.cern.ch>:
&&
&& But if you want, for example, to advise your user how long their
&& download is going to take (30 seconds or 30 minutes can make a
&& significant difference!) you need to do it before they actually try it.
Since you cannot know it, as you cannot even *know* the destination
(sure you have heard of proxies? ;-)), this "timing information" is
best left to the client. Tell the client how large it is, and the
client can give estimates how long it will take to finish loading it,
adjusting the estimate as the download progresses. If the user things
it's going to take to long - the user can abort the download.
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 16 Oct 1999 23:03:33 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Displaying 2 digits in time
Message-Id: <slrn80i132.311.efflandt@efflandt.xnet.com>
On Thu, 14 Oct 1999 09:21:35 +0100, Russell Parker <r@asd.com> wrote:
>I am trying to print time & date to a file when an event occurs.
>
>I have got the correct formatting for all other parameters, such as
>correct name for the day and month and 4 digit year.
>
>For the time I get something like 14:1. This should be 14:01.
>I suspect that I will have the same for the hours in the morning,
>although this is not too much of a problem.
>
>How do I correct this?
>
>
>use Time::localtime;
>use Time::gmtime;
>use Time::tm;
>$hour1=localtime->hour();
>$min1=localtime->min();
>$year1=localtime->year()+1900;
>$gm = gmtime();
>$gm2=gmtime();
>$weekday1=(qw(Sunday Monday Tuesday Wednesday Thursday Friday Saturday
>Sunday))[ $gm->wday()];
>$month1=(qw(Jan Feb Mar Apr May Jun Jul Aug Sept Oct Nov Dec))[$gm2-
>>mon()];
>$date1=localtime->mday();
>print("$hour1:"."$min1 "."$weekday1 "."$date1"." $month1". " $year1");
Your first mistake is mixing localtime and gmtime which could give you an
incorrect date at anywhere near midnight (depending upon local time zone).
You need to match time zone for date and time. If you must do it the long
way, then the minute can be fixed with:
$min1 = "0$min1" if $min1 < 10;
But on a Unix system it would be much easier to do this:
use POSIX qw(strftime);
$ltime = strftime "%H:%M %A %d %b %G",localtime;
$gtime = strftime "%H:%M %A %d %b %G",gmtime;
print "Localtime: $ltime\nUTC time: $gtime\n";
--
David Efflandt efflandt@xnet.com http://www.xnet.com/~efflandt/
http://www.de-srv.com http://cgi-help.virtualave.net/
http://thunder.prohosting.com/~cv-elgin/
------------------------------
Date: Sat, 16 Oct 1999 23:56:11 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: encryption and crypt() ?
Message-Id: <vg8O3.1303$IZ5.20700@news.rdc1.ct.home.com>
Martin Vorlaender <martin@radiogaga.harz.de> wrote:
> Tom Phoenix (rootbeer@redcat.com) wrote:
> : Dan Baker wrote:
> : > Is the perl source for crypt() available as an "extra"
> : > somewhere on CPAN that I missed it?
> ...
> : I don't know why
> : this hasn't already been made into a proper module and put onto CPAN.
> I had the same reservations against it that speak from the message
> `The crypt() function is unimplemented due to excessive paranoia.'.
> I thought it was illegal to make encryption source code available
> for export in the U.S.. Could someone comment on that, please?
It is excessive paranoia. The crypt function doesn't actually
encrypt anything. It's a one-way, lossy hash function. Those aren't
covered by US export law, though there's been enough saber-rattling
that caution's certainly understandable.
crypt's source should be fully exportable, and it's not like you
can't find the source in one version or other of Crack. Now, if
you could *de*crypt what'd been crypted, then it'd be a different
story, as you'd actually have an encryption function, and possibly
covered by US export laws.
Dan
------------------------------
Date: Sat, 16 Oct 1999 15:35:26 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: encryption and crypt() ?
Message-Id: <Pine.GSO.4.10.9910161520310.25558-100000@user2.teleport.com>
On Sat, 16 Oct 1999, Martin Vorlaender wrote:
> : I don't know why
> : this hasn't already been made into a proper module and put onto CPAN.
>
> I had the same reservations against it that speak from the message
> `The crypt() function is unimplemented due to excessive paranoia.'.
> I thought it was illegal to make encryption source code available
> for export in the U.S.. Could someone comment on that, please?
(Here we go again... :-) IANAL, but I think it should be safe to do this
with crypt(). It's not strong encryption, and the code is available
worldwide. I have trouble seeing how someone could make a case that CPAN
sites in the US (which mirror the master site in Finland) are doing
anything wrong by re-exporting the code. On the other hand, as an
American, I don't want to tempt fate by uploading the code to Finland
_myself_. :-)
> OK. Should it be Crypt::UnixCrypt?
Fine by me. It should probably use a prototype of ($$) and do some
parameter checking, so as to be more compatible with the built-in. And it
should not export crypt() if the built-in is there (except maybe as a
special debugging option). The docs need a touch of tidying, and we ought
to have a test suite and Makefile.pm and all. I'd do this all myself, you
understand.... :-)
Thanks!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 16 Oct 1999 22:31:17 GMT
From: Stuart Yeates <syeates@manuka.cs.waikato.ac.nz>
Subject: Re: Grabbing image size?
Message-Id: <940113076.545189@clint.waikato.ac.nz>
Tom Phoenix <rootbeer@redcat.com> wrote:
: On Fri, 15 Oct 1999 fharris@xmission.com wrote:
:> I'm interested in being able to grab the image dimensions from a .GIF
:> or .JPG picture using Perl. Anyone know how to do this?
: If there's a module which does what you want, it should be listed in
: the module list on CPAN. If you don't find one to your liking, you're
: welcome and encouraged to submit one! :-) Hope this helps!
: http://www.cpan.org/
try the gimp package. it's an interface to the complete
functionality of the Gnu Image Manipulation Program. It
can do almost anything with images
stuart
-- stuart yeates <s.yeates@cs.waikato.ac.nz> aka `loam'
let that day be lost to us on which we did not dance once!---nietzsche
X-no-archive:yes
------------------------------
Date: 16 Oct 1999 18:06:58 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Help with extracting a portion of a string
Message-Id: <slrn80i17v.q8s.abigail@alexandra.delanet.com>
Brandon (pooka@cygnus.ucdavis.edu) wrote on MMCCXXXVII September MCMXCIII
in <URL:news:3808361B.3A94C195@cygnus.ucdavis.edu>:
%%
%% I'm not _parsing_ anything; I'm merely extracting the comments. My
%% solution relies on pattern matching instead of trying to parse a grammer
%% (HTML in this case). The rest of the HTML can be eliminated or ignored,
<img src = "get_a_clue.gif" alt = "<!--">
No, it cannot be ignored.
<img src = "get_a_clue.gif" alt = "-->">
Abigail
--
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sat, 16 Oct 1999 15:17:49 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: How can return a dir listing from a foreign FTP site?
Message-Id: <Pine.GSO.4.10.9910161513430.25558-100000@user2.teleport.com>
On Sat, 16 Oct 1999, John wrote:
> Newsgroups: comp.lang.perl.misc, comp.lang.perl.tk,
> no.it.programmering.perl, perl.porters-gw, tw.bbs.comp.lang.perl
This is not a Tk issue, and neither is it an issue for the Perl Porters.
It sounds like a modules question. I don't know why you're including
Taiwanese and Norwegian newsgroups - did you just hunt for anything with
"perl" in the name? I've adjusted the newsgroup list and set followups.
> I need a directory listing, and the ability to delete and
> upload/download, to this FTP site.
> I know their are some modules, but is their a built in PERL 5 function
> to simply grep a dir structure.
Not like (I think) you mean. Get a module like Net::FTP from CPAN. Please
don't tell us that you can't use modules.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 16 Oct 1999 22:09:13 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: How to inquire, position and click the mouse in PERL?
Message-Id: <7uat29$53q$1@nntp3.atl.mindspring.net>
Nim Chu (nimchu@hal-pc.org) wrote:
: I am using Windows 98. I think there may exists a PERL module to
: inquire the current position of the mouse (which can be anywhere on
: the screen), set it to a new position, and right click the mouse, all
: under PERL script control. Can anyone give me some directions where to
: look. Thanks.
You'll need to either use Win32::API to call the GetCursorPos (to find
the cursor position) and mouse_event (to simulate mouse movements and
clicks) Win32 API functions, or else write an XS sub to call those functions.
------------------------------
Date: Sat, 16 Oct 1999 23:09:50 GMT
From: Graham W. Boyes <me@toao.net>
Subject: How to install GD.PM
Message-Id: <7ub0jp$upd$1@nnrp1.deja.com>
Hello,
I want to create a gif image from some other images. These images will
be bundled together side by side. I have been trying to use the GD.PM
module, but am having trouble installing it, even the demos won't
work. I am using Hypermart, if that is any help.
Any help would be much appreciated,
Graham W. Boyes
--
"The One and Only"
me AT toao DOT net ~ http://www.toao.net
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 16 Oct 1999 23:26:42 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: How to socket
Message-Id: <slrn80i2ee.311.efflandt@efflandt.xnet.com>
On Sat, 16 Oct 1999 11:21:18 +0900, choigo7@hitel.net <choigo7@hitel.net> wrote:
>
>l'd like to check whether daomon port is alive.
>So, l read from Socket , but I don't wirte to Socket.
>
>How do I write socket descripter?
If you say you are not writing to the socket, why do you try to print
"quit\n" to it. What results or error do you get when you delete that
print line? Just read from the socket and close it. Works fine for me.
>I have sample code for socket.
>Please, I need your help.
>
>#!/usr/bin/perl -w
> use strict;
> use Socket;
> my ($remote,$port, $iaddr, $paddr, $proto, $line);
>
> $remote = shift || 'localhost';
> $port = shift || 25; # random port
> if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') }
> die "No port" unless $port;
> $iaddr = inet_aton($remote) || die "no host: $remote";
> $paddr = sockaddr_in($port, $iaddr);
>
> $proto = getprotobyname('tcp');
> socket(SOCK, PF_INET, SOCK_STREAM, $proto) || die "socket: $!";
> connect(SOCK, $paddr) || die "connect: $!";
> while (defined($line = <SOCK>)) {
> print $line;
> }
>#############################################################
># print SOCK ("quit\n"); <------ It's wrong
>
>Please, Fill in correct code.
This exact script works for me without the above print statement. What
makes you think that you need it? Maybe it fails for you because you do
not have sendmail running on localhost.
>
>#############################################################
> close (SOCK) || die "close: $!";
> exit;
--
David Efflandt efflandt@xnet.com http://www.xnet.com/~efflandt/
http://www.de-srv.com http://cgi-help.virtualave.net/
http://thunder.prohosting.com/~cv-elgin/
------------------------------
Date: Sat, 16 Oct 1999 15:01:20 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: list last five messages
Message-Id: <02iau7.u97.ln@magna.metronet.com>
sbarros6592@my-deja.com wrote:
: I have a WWWBoard Matts Wright.
That's too bad.
: Please,anybody
: can help me?
Yes.
Delete that piece of CRAP.
( Matt's scripts are buggy, have y2k problems and create security
holes. It is worth even less than you paid for it.
)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 16 Oct 1999 14:54:10 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: LWP and IP spoofing
Message-Id: <Pine.GSO.4.10.9910161434030.25558-100000@user2.teleport.com>
On Sat, 16 Oct 1999, David Stack wrote:
> Does anyone know a way to use LWP and have your IP address changed
> each time a call is made? (ie, IP spoofing)
>
> I would be willing to pay money for a working solution.
I have my doubts about the purity of your heart. If you want to make a
packet seem to come from another machine which you own, you could simply
make such a packet from that machine. If you want to make a packet seem to
come from a machine which you do not own, can you please explain in what
way you are not an evil cracker?
But consider: The reply to a spoofed packet goes to the correct
destination, not to the spoofer. It would not be hard to generate spoofed
packets in principle, but it would be hard to do anything that is both
useful and reasonable that way.
But if you're serious about doing this, see this URL.
http://www.packetfactory.net/libnet/
Be sure to use your powers only for good!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 16 Oct 1999 23:48:28 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: LWP and IP spoofing
Message-Id: <slrn80i3mv.s7e.mgjv@wobbie.heliotrope.home>
On Sat, 16 Oct 1999 17:20:19 GMT,
David Stack <musicstack@hotmail.com> wrote:
> Does anyone know a way to use LWP and have your IP address changed
> each time a call is made? (ie, IP spoofing)
IP spoofing is bad. I doubt very much that you'll find anyone here
willing to help. Besides that, IP spoofing happens at a much lower
level than LWP operates, and LWP will not work while you're spoofing
your IP, since it needs and answer.
I think you don't know what IP spoofing is.
Maybe you should first go to a tcpip group, and humbly ask there what
it is, not mentioning that you're planning to do it. Once you get an
answer that you can understand,, you will realise that your question
above is meaningless.
Martien
--
Martien Verbruggen |
Interactive Media Division | I took an IQ test and the results were
Commercial Dynamics Pty. Ltd. | negative.
NSW, Australia |
------------------------------
Date: 16 Oct 1999 22:35:28 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Need a next/previous routine for a Web CGI script
Message-Id: <7uaujg$53q$2@nntp3.atl.mindspring.net>
Will Harmon (wharmon@oregon.uoregon.edu) wrote:
: I have a PERL CGI script about ready to go, but I am hoping to add the ability
: to scroll through 10 or so items at a time depending on what my search routine
: brings up. Wondering if anyone has a next/previous routine they would share,
: an idea where to find an example, or a description on how it should be done.
Randal Schwartz has written a couple WebTechniques columns about this
sort of thing: check out
<URL:http://www.stonehenge.com/merlyn/WebTechniques>.
------------------------------
Date: 16 Oct 1999 23:54:17 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: please help the telnet program
Message-Id: <slrn80i425.311.efflandt@efflandt.xnet.com>
On Sat, 16 Oct 1999 11:49:26 GMT, gator@apl.jhu.edu <sp1d3rjd@yahoo.com> wrote:
>I have been trying to use the telnet.pm module but with some problems,
>here is the code ....
Correction, you are using the Net::Telnet module in your own telnet.pl
script.
>I ran the program and it gave me no output except for the input and
>dump logs.....then i logged in my self using the usual telnet method
>and performed a last gator|more and it showed that it did log in but
>did not perform the $command like it was supposed to....I am wondering
>why I did not see the output for the ps command on my screen(when the
>program was ran) and why it did not show up when i checked it using
>the regular telnet 128.220.101.100 method. Can any one tell me why i
>did not see the ps command give its output....Does this have anything
>to do with setting the cmd_remove_mode value.
It could have to do with the fact that you define:
my $command = '/usr/bin/who > who_log';
my $com1='/usr/bin/ps';
The $command dumps its output to who_log, so you would not see that.
You never use $com1, so what makes you think that you would see output
from that command? Oops! 8-)
>Thanks for your help....
>
>JD Durick
>AT&T Information Security Center
>Columbia, MD
--
David Efflandt efflandt@xnet.com http://www.xnet.com/~efflandt/
http://www.de-srv.com http://cgi-help.virtualave.net/
http://thunder.prohosting.com/~cv-elgin/
------------------------------
Date: Sat, 16 Oct 1999 16:10:35 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: rand generator limitatoins - request expert advice
Message-Id: <Pine.GSO.4.10.9910161536210.25558-100000@user2.teleport.com>
On Sat, 16 Oct 1999, Mike wrote:
> The machine I'm programming on only allows 15 bits per random number
> generation,
> I want to know how I can get a random number between 0 and 4e10(or
> even 4e20),
Easy enough with Perl. This isn't perfect, but it may be close to what you
want.
sub rand_4e20 () {
join '', map sprintf "%03d", rand 400,
rand 1000, rand 1000, rand 1000,
rand 1000, rand 1000, rand 1000;
}
Of course, it may well be that your underlying system rand() has fewer
than 4e20 possible internal states. That is, after calling this function
32768 times (or even fewer!) it may begin to repeat itself. :-(
One solution may be to use a "shuffling" algorithm such as that given by
Knuth in Seminumerical Algorithms, 3.2.2, Algorithm B. Maybe something
like this (untested) code. (I'll let you combine these two tricks to
generate numbers in the range to 4e20.)
BEGIN {
my @v_table = map int rand 1000, 0..999;
my $y = int rand 1000;
sub shuffled_rand_1000 () {
($v_table[$y], $y) = (int rand 1000, $v_table[$y]);
$y;
}
}
> Your responses are appreciated, and please cc them to mike@cardosa.com
> so i don't have to check back. It kills my system resources to load my
> news reader over and over again.
That's a shame. But if you want replies to go to an email address,
couldn't you at least put that address in the headers so that we can
simply reply to your message? Oh well!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 16 Oct 1999 14:17:37 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Trouble with perl debug mode and FreeBSD 3.3!
Message-Id: <Pine.GSO.4.10.9910161407000.25558-100000@user2.teleport.com>
On Fri, 15 Oct 1999, Hans-Joachim Leidinger wrote:
> sorry for my poor english!
If you're more comfortable in another language than English, please feel
free to use that language here and ask your question again.
> ######### Forked, but do not know how to change a TTY. #########
This is the debugger. Somehow, you've forked a second process, but the
debugger doesn't know what to do to let you debug the second one as well
as the first one. Another under-documented feature of the debugger! :-)
But the rest of the message should give you an idea of what to do - if you
must debug after forking, of course.
If that's not your problem, please try asking again. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 16 Oct 1999 23:27:25 GMT
From: jaws@mindspring.com (John Armsby)
Subject: Re: Where can I find the module GD for Windows servers?
Message-Id: <38090994.1606119@news.mindspring.com>
Been there. Done that. GD and GIFgraph install great. They won't
work because you need to install version 1.19 which supports GIF
files. I have tried everything I can think of. No luck.
Any help would be appreciated.
John
On 12 Oct 1999 16:18:52 +0100, Jonathan Stowe
<gellyfish@gellyfish.com> wrote:
>Craig <craig@free-inter.net> wrote:
>> Anyone know where I could find GD for Win32?
>>
>
>If you have Activestate perl then you can just do :
>
>PPM install GD
>
>At the command prompt.
>
>/J\
>--
>"Tony Blair is reported to be detained indefinitely under plans unveiled
>by the Home Secretary" - Corrupt Teletext Page
------------------------------
Date: Sat, 16 Oct 1999 14:49:41 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Working on separate records in a file
Message-Id: <5chau7.p47.ln@magna.metronet.com>
Pfash1 (pfash1@aol.com) wrote:
: records are email messages, each with the same format (ie; second word on the
: first line is the name of the recipient
Rather than counting words, can't you identify the recipient
as the string that follows these four characters "To: " ?
: and the message always begins after the third word on the third line ...but the
: length of the message varies for each record.)
: I want to isolate and work with the name of the recipient, the sender and the
: message for each of the records.
: I am thinking the way to do this is to first use
: $/ = "-----------------------"; to put each record into its own field in an
: array. (see code below)
You might want to include the newline in the input record separator.
: Now, when I want to take each of those fields and split the contents on the
: blank spaces (so that I can count the words and find each component I want to
: work on), I am running into trouble.
: How should I do this? Is there a way to split each email record on the blank
: spaces when I put it into its own field in an array..and would this be an array
: of arrays? How would that look?
But then you would have to remember which index corresponds
to which field.
An array of hashes would be better.
: #!perl -w
: my @eachrecord;
: open (FH, 'file_of_emails.db') || die "$0: open file_of_emails.db: $!";
: while (<FH>)
: {
: $/ = "-----------------------";
You should always local()ize changes to Perl's special variables.
You should use single quotes unless you intend to use one of
the "extra" things that double quotes give you over single
quotes (variable interpolation and/or backslash escapes).
: ##########################
: Here is the file of emails:
[snip]
: To: steve
^
[snip]
: To: frank
^
[snip]
: to: pete
^
^ case doesn't matter here I guess
-----------------------------------------------------------------------
#!/usr/bin/perl -w
use strict;
my @array_of_emails;
{ local $/ = "-----------------------\n";
while (<DATA>) {
chomp;
if ( s/^[tT]o: (.*)\n+Sender's Name: (.*)\n// ) {
push @array_of_emails, {to => $1, from => $2, msg => $_};
}
else
{ warn "no match\n" }
}
}
foreach (@array_of_emails) {
print "To: $_->{to}\n";
print "From: $_->{from}\n";
print $_->{msg};
print "############\n";
}
__DATA__
To: steve
Sender's Name: petesender
Hello, Steve: here is my message.
-----------------------
To: frank
Sender's Name: frankssender
Hello, frank:: here is my message
-----------------------
to: pete
Sender's Name: petessender
Hello, pete::here is my message blah, blah, blah,
blah, blah, blah,
-----------------------------------------------------------------------
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
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 1096
**************************************