[13682] in Perl-Users-Digest
Perl-Users Digest, Issue: 1092 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 16 06:05:25 1999
Date: Sat, 16 Oct 1999 03:05:09 -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: <940068309-v9-i1092@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 16 Oct 1999 Volume: 9 Number: 1092
Today's topics:
Re: and versus && (R. McGillis)
Re: drop it!! (was "tr// question") (Michael Budash)
Re: encryption <ehpoole@ingress.com>
GD module <troja2977@my-deja.com>
Re: GD module <sjohns17@uic.edu>
Re: GD-1.22 Windows build? <marcel.grunauer@lovely.net>
Re: Help with extracting a portion of a string <pooka@cygnus.ucdavis.edu>
Re: Help with extracting a portion of a string (Christopher R. Maden)
Help! I'm writing simple translation script <choijinh@hitel.net>
How can I step by step to debug my perl program in emac <codeboy@163.net>
Re: How can I step by step to debug my perl program in <codeboy@163.net>
Re: How can I step by step to debug my perl program in <marcel.grunauer@lovely.net>
Re: How to resize a web browser <aaron@aaronpropst.com>
Re: Learn Perl Language (Abigail)
Re: Modul-Initialisation Problem (Martien Verbruggen)
Re: Perl Programmer Wanted <ehpoole@ingress.com>
Re: Perl <u2orange@bigfoot.com>
question on FORMAT <dvoon@my-deja.com>
Re: rand() problem. Please help. <rootbeer@redcat.com>
Reading Web pages with Perl <michael@forward.demon.co.uk>
Re: Reading Web pages with Perl (Michael Budash)
Re: recursive delete (Abigail)
retrieve url from hypertext <hxshxs@my-deja.com>
Re: Running Perl script locally on a win98 machine <u2orange@bigfoot.com>
Re: tr// question <pooka@cygnus.ucdavis.edu>
Trouble with perl debug mode and FreeBSD 3.3! <"Hans-Joachim Leidinger <jojo"@buchonline.net>>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 15 Oct 1999 23:52:39 -0700
From: rmcgilli@popmail.ucsd.edu (R. McGillis)
Subject: Re: and versus &&
Message-Id: <rmcgilli-1510992352390001@rmcgilli.extern.ucsd.edu>
Thanks folks. You have all been very helpful with the exception of
Abigail, whose standard answer to every question on the newsgroup seems to
be a variant of "have you read such and such a thing? If not you are a
moron and screw you"
Anyway, the rest of you have been very helpful; thank you for taking your
time to post a response to my question.
-R.M.
In article <7u8mgd$21p$1@rguxd.viasystems.com>, lee.lindley@bigfoot.com wrote:
> R. McGillis <rmcgilli@popmail.ucsd.edu> wrote:
> :>I was taught that "and" is just a short cut for "&&" to improve
> :>readability, but otherwise interchangable.
>
> Close enough for horseshoes, but not quite for a syntax.
>
> :> A colleague of mine just told
> :>me that there is a subtle difference, but could not remember what it was.
> :>What's the scoop? Is there any difference between them in how they work?
>
> precedence.
>
> If you use enough parens, you may never need to learn all of the
> precedence rules. :-) But if you want to understand the difference
> between '&&' and 'and', you will need to study the `perldoc perlop`
> manual page.
>
> The standard example is:
>
> open(FH,"somefile") || die "failed open somefile: $!";
> open FH, "somefile" or die "failed open somefile: $!";
>
> Look in the table for the precedence of "," vs "||" vs "or", and then
> you may get a clue about why the parens are required in the first
> example, but not required in the second.
>
> Frankly, I think it is one of those times where "there are too
> many ways to do it." TATMWTDOI cannot be original. Please tell
> me that this has been been beaten to death somewhere. A search
> on deja does not turn up anything to disabuse me of my smugness.
>
> Surely there is a clpm denizen somewhere who can tell me that they
> have seen that knock on Perl before. Otherwise, I may have to
> slap a copyleft on it. ;->
------------------------------
Date: Sat, 16 Oct 1999 02:01:05 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: drop it!! (was "tr// question")
Message-Id: <mbudash-1610990201050001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>
ok guys - enough, already... let's move on to more constructive discussion...
--
Michael Budash ~~~~~~~~~~ mbudash@sonic.net
------------------------------
Date: Sat, 16 Oct 1999 02:27:39 -0400
From: "Ethan H. Poole" <ehpoole@ingress.com>
Subject: Re: encryption
Message-Id: <38081ADB.2112FB38@ingress.com>
Mike Heller wrote:
>
> I'm writing an application that stores users in a database. I have a
> table that stores the user passwords. Right now, I'm using the crypt()
> function to encrypt the passwords before I store them. I would like to
> add the option to mail the user his or her password, but the crypt()
> function is only one way. Does anyone know of any good encryption
> routines for perl (or possibly where I can find one)?
What you are proposing will already eliminate much of the value of
encrypting (hashing) the password to begin with (if you use a reversible
encryption method then the key to decrypt the data will be contained in
the same code that writes the data you are trying to protect... what
happens when someone gets their hands on the code? Answer: your entire
database becomes readily decryptable). In which case you might just as
well go ahead and store the passwords in plaintext.
Have you considered simply generating a new password for the forgetful
user? This method still permits a level of risk, but at least you are
much less likely to hand over the user's originally chosen password to a
malicious third party. It is not uncommon for many users to use the same
password on multiple accounts, so if you give it away for one you have
potentially opened the door for attacks on other accounts belonging to
that user.
--
Ethan H. Poole **** BUSINESS ****
ehpoole@ingress.com ==Interact2Day, Inc.==
(personal) http://www.interact2day.com/
------------------------------
Date: Sat, 16 Oct 1999 08:07:31 GMT
From: Ron Seifenberger <troja2977@my-deja.com>
Subject: GD module
Message-Id: <7u9bo1$v9v$1@nnrp1.deja.com>
Hello,
is it possible to read the image information (like the size of a
gif-file) with the GD module?
And can I convert a image into another size?
Or are there are other more practical modules available?
Thanks
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 16 Oct 1999 04:19:37 -0500
From: Seth David Johnson <sjohns17@uic.edu>
Subject: Re: GD module
Message-Id: <Pine.A41.4.10.9910160407100.558946-100000@tigger.cc.uic.edu>
On Sat, 16 Oct 1999, Ron Seifenberger wrote:
> Hello,
>
> is it possible to read the image information (like the size of a
> gif-file) with the GD module?
Yes, there are methods for this as well as for extracting rgb values of
pixles (which you will need). I can't name the methods off the top of my
head, but they're in the pod ( do a "perldoc pod" ).
> And can I convert a image into another size?
Yes. To enlarge, simply take the rgb value of each pixel and make a
larger "block" of pixels with that value (I don't know any smoothing
algorithms off-hand). The algorithm to shrink an image is basically the
same as the "mosaic" (tiling) algorithm. You take the image
block-by-block (the smaller you want the resulting image to be, the larger
the block size), calculate an average red, green, and blue for each block.
Then make a pixel (rather than a block, which is the case with the mosaic
algorithm) with the resulting values.
> Or are there are other more practical modules available?
There may be scripts available for this already. Unfortunately, I lost
the ones I wrote...
-Seth
www.pdamusic.com
------------------------------
Date: Sat, 16 Oct 1999 09:36:48 GMT
From: Marcel Grunauer <marcel.grunauer@lovely.net>
Subject: Re: GD-1.22 Windows build?
Message-Id: <7FQIOCXb2KCdayLBKcnNSqV4t3PL@4ax.com>
On Sat, 16 Oct 1999 05:57:11 GMT, stevesny@ibm.net (Steve Siegel)
wrote:
> Does anyone know of a GD-1.22 (with True Type fonts) complete windows build?
The only binary I'm aware comes from the ActiveState site (via ppm)
and is 1.19. But I haven't checked in some time, so maybe there is a
newer version there now.
--
Marcel, Perl Padawan
sub AUTOLOAD{$_=$AUTOLOAD;s;.*::;;;y;_; ;;print}&Just_Another_Perl_Hacker;
------------------------------
Date: Sat, 16 Oct 1999 09:00:57 GMT
From: Brandon <pooka@cygnus.ucdavis.edu>
Subject: Re: Help with extracting a portion of a string
Message-Id: <3807CE0E.6C0EC131@cygnus.ucdavis.edu>
Sam Holden wrote:
>
> On Sat, 16 Oct 1999 03:16:45 GMT, Brandon <pooka@cygnus.ucdavis.edu> wrote:
> Of course all regular languages are context free, of course you can convert
> a DFA into a CFG. You can not however convert a CFG into a DFA.
>
> Maybe a specific CFG can be turned into a DFA, however there is no
> algorithm for turning an arbitrary CFG into a DFA.
>
> If you read the sentence you quoted in any way other than asking a
> professor to explain how to parse and arbitrary CFG with a regex then you
> should read some CS texts. The intent of the statement was obvious to everyone
> else.
>
I don't need to convert an _arbitrary_ CFG into a DFA, just the one that
describes the language of HTML comments. That language seems to adhere
to the pumping lemma, so it is my belief that it is regular. I'll even
offer a quick proof:
Define S as a set containing whitespace and newlines, and we'll make .
match newlines too.
Define x as (<!(?=--))
Define y as (--.*?--S+)
Define z as (>)
For each i>=0, xy^iz is in the language. Actually, i=0 is special, but
easily accounted for, so we can assume that i>=1. So for each i>=1,
xy^iz is in the language. Certainly |y|>0. For any pumping length p, it
is not too hard to see that |xy| < p. Probably always |xy| = p-1;
And the DFA would look something like:
_y_
x \ / z
->(q1)--->(q2)--->((q3))
Since i can't really be 0 (but we can exclude that case) the language is
not regular in the strictest sense, but regular for i>=1, and it's
regular enough so that regular expressions can be used...
------------------------------
Date: Sat, 16 Oct 1999 02:33:56 -0700
From: crism@exemplary.net (Christopher R. Maden)
Subject: Re: Help with extracting a portion of a string
Message-Id: <crism-1610990233560001@pm3b-5.meer.net>
In article <9mFN3.24505$m4.89682581@news.magma.ca>, "Samuel Kilchenmann"
<skilchen@swissonline.ch> wrote:
> Abigail <abigail@delanet.com> wrote in:
> news:slrn80dspo.q8s.abigail@alexandra.delanet.com...
> > Samuel Kilchenmann (skilchen@swissonline.ch) wrote on MMCCXXXVI
> > MCMXCIII in <URL:news:RPBN3.24458$m4.89592549@news.magma.ca>:
> > && Abigail <abigail@delanet.com> wrote in:
> > && news:slrn80dgmg.q8s.abigail@alexandra.delanet.com...
> > && >
> > && > <!-- This is a comment --
> > && > -- This is another comment --
> > && > --> Look. Still a comment! <!--
> > && > >
> > && This is a malformed (invalid) HTML comment.
No, 'tisn't.
> > && From
> > && http://www.w3.org/TR/1998/REC-html40-19980424
> > &&
> > && 3.2.4 Comments
As Abigail indicated, that quote is incomplete. The section Samuel quotes
is non-normative ("A complete discussion of SGML is left to the standard
(see [ISO8879]).") and clearly a bit sloppy ("Information... between
comments" should clearly be "Information... between comment delimiters" or
"Information... inside comments"). That normative reference to [ISO8879]
indicates that, unless explicitly subsetted, the ISO 8879 definitions
hold. (The full ISO 8879 formal grammar can be found at
<URL:http://www.oreilly.com/people/staff/crism/sgmldefs.html>, though for
copyright reasons, explanatory prose is not present.) Additionally, full
SGML comments were explicitly legal in HTML 2.0, and eliminating some of
them in HTML 4.0 doesn't make sense.
> Thanks a lot for the very interesting followup. But how do you know that
> the cited description is incomplete? Isn't this more restrictive
> definition of the allowed HTML comment syntax intended, because "nobody"
> cared to implement the full SGML comments definition in the past?
A more restrictive definition would be legal; a particular SGML
application can be a subset of full SGML. But HTML does not restrict
comments; it describes a subset of legal comments in a non-normative
section.
> An even more restrictive syntax for comments was defined (proposed?) for
> XML, see http://www.w3.org/TR/REC-xml:
>
> What would you say about an XML processoe implementing this definition
> instead of the full SGML comments definition? Luser?
I'd call it conforming. But HTML has no similar definition.
-Chris
--
Christopher R. Maden, Solutions Architect
Exemplary Technologies
One Embarcadero Center, Ste. 2405
San Francisco, CA 94111
------------------------------
Date: Sat, 16 Oct 1999 17:06:22 +0900
From: Choi Jin-Ho <choijinh@hitel.net>
Subject: Help! I'm writing simple translation script
Message-Id: <380831FE.723AB105@hitel.net>
To perl gurus ..
I'm writing very simple english-korean medical translation
engine to introduce english medical resource to korean
people.
the concept is like this :
1) get english HTML file
(I use LWP library)
2) convert HTML text to word blocks, separated by
HTML tags or spaces.
like this :
<p>This is <a href="somesite.htm">heart failure</a>
==>
$html = ('<p>', 'This', 'is', '<a href="somesite.htm">',
'heart', 'failure', '</a>);
(I use this script :
$html = get "$url";
@html = split (/[\r\n]|[\r]|[\n]/, $html);
print "Content-type: text/html\n\n";
foreach (@html) {
$line= $_;
push @line, $1 while $line =~ /([^\t
<>]+|<(?:[^">]+|"[^"]+")*>)/g;
$retval = &line_check (@line);
print "$retval\n";
}
)
3) convert medical english words to medical korean words.
there are some compound words (consist of more than
two words), so I'll try max to 4 words.
$html = ('<p>', 'This', 'is', '<a href="somesite.htm">',
'heart', 'failure', '</a>);
==>
$korean_html = ('<p>', 'This', 'is', '<a
href="somesite.htm">',
'SIM-BU-JEON', '</a>);
(SIM-BU-JEON means 'heart failure' in korean)
4) output is korean-converted HTML
<p>This is <a href="somesite.htm">SIM-BU-JEON</a>
once more, translation example :
The mortality of <b>heart failure</b> is still high, but
recently, <a href="somesite.htm">ACE inhibitor</a>
was introduced and considered as first choice-drug.
==>
The SA_MANG-YUL of <b>SIM-BU-JEON</b> is still high, but
recently, <a href="somesite.htm">ACE-EUK-JE-JE</a>
was introduced and GO-RYO-DUEN-DA as U-SEN-SEUN-TAK-JE.
I succeed at step 1) and 2) with help of net friends,
but step 3 is not easy to me.
I have english-korean medical glossary, so at first I thought
this would not difficult. But soon I found most of medical term
is consisted with more than two words, so I got trouble.
Can anyone provide me knowhow to process more than two
words ?
Thanks in advance.
Choi Jin-Ho
webmaster of http://heartkorea.com
------------------------------
Date: Sat, 16 Oct 1999 14:44:04 +0800
From: "code" <codeboy@163.net>
Subject: How can I step by step to debug my perl program in emacs?
Message-Id: <7u96r8$976$1@info.bta.net.cn>
Hi,
Sorry if the question has been asked many times.But
I really has spent much time to do it by myself ,now
I need your help.I want to debug my perl program in
emacs.But I don't know what should i do after typing
ESC-x perldb <RET> ,if I input '~\program\per\test4.pl -e 0 ',
it go ahead than waitting I inputing the more command
like s to debug it.
How can I step by step to debug my perl program?
Thanks your help.
Liao
------------------------------
Date: Sat, 16 Oct 1999 16:00:18 +0800
From: "code" <codeboy@163.net>
Subject: Re: How can I step by step to debug my perl program in emacs?
Message-Id: <7u9b6m$7uh$1@info.bta.net.cn>
Sorry,this is a stupid question.I don't know
why i can do it now.
Thanks
------------------------------
Date: Sat, 16 Oct 1999 09:48:23 GMT
From: Marcel Grunauer <marcel.grunauer@lovely.net>
Subject: Re: How can I step by step to debug my perl program in emacs?
Message-Id: <e1UIOIS7Dt9KbFgpFVX68TSu7Mh1@4ax.com>
On Sat, 16 Oct 1999 14:44:04 +0800, "code" <codeboy@163.net> wrote:
> Sorry if the question has been asked many times.But
> I really has spent much time to do it by myself ,now
> I need your help.I want to debug my perl program in
> emacs.But I don't know what should i do after typing
> ESC-x perldb <RET> ,if I input '~\program\per\test4.pl -e 0 ',
> it go ahead than waitting I inputing the more command
> like s to debug it.
It seems your question has more to do with cperl-mode than Perl, and
although cperl-mode is found on CPAN, you might get a better response
asking in an Emacs-related newsgroup. Of course, Ilya Zakharevich, the
author of cperl-mode, posts to this group as well, but there may be
other Emacs-users having the same problem. Hope this helps!
--
Marcel, Perl Padawan
sub AUTOLOAD{$_=$AUTOLOAD;s;.*::;;;y;_; ;;print}&Just_Another_Perl_Hacker;
------------------------------
Date: Sat, 16 Oct 1999 01:03:06 -0600
From: "Aaron Propst" <aaron@aaronpropst.com>
Subject: Re: How to resize a web browser
Message-Id: <7u97u2$1oom@yuma.ACNS.ColoState.EDU>
I don't think anyone in this thread did that... and this lame ass argument
was stupid to begin with.
this whole thing began w/ me suggesting the use of javascript to resize a
browser window... I was by no means suggesting that javascript and perl are
interchangable... or that we should start up a damn thread in clpm about
friggin javascript.. I only wanted to point Mu Shan In the right direction.
(clj)
let's consider this thread finished.. shall we?
Aaron
> For sure it is easy to get confused about what language or protocol is
> involved in doing a task or solving an error, I have done it many
> times. But helping the person differentiate where the solution resides
> is part of the learning process. It is no favor to a newbie to
> encourage them to think that Perl and Javascript are interchangeable and
> that it is arbitrary which one is used to solve a particular problem.
> Nor is it a favor to a newbie to encourage them to think they can get
> their javascript problems solved in clpm.
>
> --
> Jeff
------------------------------
Date: 16 Oct 1999 01:05:26 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Learn Perl Language
Message-Id: <slrn80g5ck.q8s.abigail@alexandra.delanet.com>
Internet Explorer (12345@unbounded.com) wrote on MMCCXXXVII September
MCMXCIII in <URL:news:38080665$0$203@nntp1.ba.best.com>:
,, any web site good for me to learn perl language?
I wouldn't go to a web site. If you decide to learn Perl without books,
use the manual that comes with Perl.
And don't forget to experiment.
Abigail
--
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi
-----------== 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 06:51:01 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: Modul-Initialisation Problem
Message-Id: <slrn80g84q.qsv.mgjv@wobbie.heliotrope.home>
On Fri, 15 Oct 1999 17:08:11 +0200,
A Zielke <azielke@hotmail.com> wrote:
>
> > You shouldn't be able to. Not while %InternHash is lexically scoped to
> > the file that has the qConfig package. If you want %InternHash to be
> > available outside of the file, make it a package variable, and don't
> > scope it lexically
> >
>
> I have subs in qConfig, that access the config-hash, but they fail, too.
Maybe. But the code that you submitted shows one file with a my scoped
hash, that you try to access in another file. That won't work.
All I did was point out that you cannot use lexical scoping that way.
And that the code you were using cannot work because of the lexical
scoping.
If that is not your problem, then maybe you should submit some code
that doesn't work for another reason.
It doesn't help if you submit code that has problems in more than one
place. Try to narrow it down.
Martien
--
Martien Verbruggen |
Interactive Media Division | You can't have everything, where would you
Commercial Dynamics Pty. Ltd. | put it?
NSW, Australia |
------------------------------
Date: Sat, 16 Oct 1999 02:37:11 -0400
From: "Ethan H. Poole" <ehpoole@ingress.com>
Subject: Re: Perl Programmer Wanted
Message-Id: <38081D17.E875A98@ingress.com>
A(ll)I(s)S(h**) wrote:
>
> Perl Programmer Wanted
>
> You will work at an hourly rate, or by the project and be paid directly
> by A.I.S. or our client. The hourly rate is flexible. You will need the
> following skills:
>
> 1) Profound knowledge of Perl and PHP.
> 2) Database Integration (SQL and text-based mainly).
> 3) E-Commerce Integration.
> 4) UNIX and Sun servers.
> 5) Basic HTML and page layout.
>
> A.I.S. is a start-up Internet Design Company, all members will be
> expected to work hard and put free time into the exposure and promotion
> of the company. You’ll also be expected to do some free programming for
> the company web site.
You actually have the nerve to demand "free time and promotion" from your
contractors??? You even expect them to accept a multitude of collection
risks with respect to getting paid (you pay or maybe the client pays, it
pays by the hour or maybe it is by the project... why should the
contractor even consider billing your client if they are working for you?
Do you really expect your other employees to operate in this manner? Only
God knows who is supposed to pay who under such an arrangement.
Contractors are contractors, not your personal debt management and
collection agency. Damn the morale I suppose.).
Why not run a "We want a free expert Perl and PHP programmers because we
are cheap and we do not want our client's (if we get any) to know we lack
technical talent and don't believe in good business practices" campaign?
Hope you get what you pay for on that one.
--
Ethan H. Poole **** BUSINESS ****
ehpoole@ingress.com ==Interact2Day, Inc.==
(personal) http://www.interact2day.com/
------------------------------
Date: Sat, 16 Oct 1999 09:58:50 GMT
From: Mat Tillett <u2orange@bigfoot.com>
Subject: Re: Perl
Message-Id: <38084DFE.4A053AE4@bigfoot.com>
Go for the Activestate Perl.. It is all you will need..!
u2orange@bigfoot.com
------------------------------
Date: Sat, 16 Oct 1999 07:11:01 GMT
From: dVoon <dvoon@my-deja.com>
Subject: question on FORMAT
Message-Id: <7u98e2$sb2$1@nnrp1.deja.com>
Hi all,
Consider the code below. How to output a report with each department
grouped in one page? -Or how to page break each every new value in
$dept? Please help.
P/S: Please excuse my broken English.
Regards,
Daniel
%table = (
100 => ['john', 'sales', 3200],
200 => ['alan', 'tech', 2200],
300 => ['susan', 'admin', 1200],
400 => ['mark', 'sales', 3500],
500 => ['elle', 'tech', 2300],
600 => ['lee', 'admin', 2500],
700 => ['alice', 'sales', 3500],
800 => ['lucas', 'tech', 4000],
900 => ['mcarthur', 'admin', 2000]
);
foreach $id (sort {($table{$a}[1] cmp $table{$b}[1])||($a cmp $b)} keys
%table) {
($name, $dept, $salary) = @{$table{$id}};
write( STDOUT );
}
format STDOUT_TOP =
@<<<<<
$dept
NAME SALARY
---- ------
.
format STDOUT =
@<<<<<<< @####.##
$name, $salary
.
--
+--------------------------------------------+
| Reality is for people who lack imagination |
+--------------------------------------------+
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 15 Oct 1999 23:05:04 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: rand() problem. Please help.
Message-Id: <Pine.GSO.4.10.9910152302360.25558-100000@user2.teleport.com>
On Sat, 16 Oct 1999, Zhengdong Zhang wrote:
> Within each $individuals[$i] I can get random numbers, but every
> single random number is the same to different individual and different
> program run.
It sounds as if you have a very old version of Perl. If it's older than
5.004, upgrade at once.
If that's not it, ask again. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 16 Oct 1999 09:03:41 +0100
From: Michael Crowley <michael@forward.demon.co.uk>
Subject: Reading Web pages with Perl
Message-Id: <4xcjwAAdFDC4Ewcs@forward.demon.co.uk>
Using Perl I wish to read web pages (i.e. HTML files ) on different
servers. Knowing the web address of these pages is it possible for me to
either, copy the files to my server, or can perl read a file knowing the
web address.
Can anyone explain how I would do either of these operations.
Thank you in advance
--
Michael Crowley
e-mail michael@forward.demon.co.uk
------------------------------
Date: Sat, 16 Oct 1999 02:06:06 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: Reading Web pages with Perl
Message-Id: <mbudash-1610990206060001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>
In article <4xcjwAAdFDC4Ewcs@forward.demon.co.uk>, Michael Crowley
<michael@forward.demon.co.uk> wrote:
>Using Perl I wish to read web pages (i.e. HTML files ) on different
>servers. Knowing the web address of these pages is it possible for me to
>either, copy the files to my server, or can perl read a file knowing the
>web address.
>
>Can anyone explain how I would do either of these operations.
>
you'll want to investigate the perl modules commonly referred to as LWP
(actually libwww-perl)... go to your local neighborhood CPAN (cpan.org)
and check'em out - they're the ticket...
hth-
--
Michael Budash ~~~~~~~~~~ mbudash@sonic.net
------------------------------
Date: 16 Oct 1999 01:35:17 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: recursive delete
Message-Id: <slrn80g74j.q8s.abigail@alexandra.delanet.com>
Blair Heuer (ab@cd.com) wrote on MMCCXXXVII September MCMXCIII in
<URL:news:7u8vs7$cck$1@fir.prod.itd.earthlink.net>:
## I am trying to find out how to do a recursive delete. I need to be able to
## delete folders regardless of what is within them. I looked around on
## DejaNews trying to find the answer, to hopefully not have to bother the
## board with repeated questions (sorry i was unable to do that), and found
## many people point to File::Find but never a good explanation. Could someone
## please show me, possibly show all the code, to delete everything in a
## folder, $deleteme for instance.
The easiest way would be:
system rm => -r => $deleteme;
Or whatever the command on your system is.
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 08:20:23 GMT
From: Howard Sun <hxshxs@my-deja.com>
Subject: retrieve url from hypertext
Message-Id: <7u9cg3$vmm$1@nnrp1.deja.com>
just started learning Perl. not sure how to do the following,
extract all URLs within the hypertext.
if I use
if(/<a href="?.*"?>/) {
$link = $&;
}
it can only display <a href="http://......"> part, not the real url.
real URL maynot start with http or end with html.
also it stops at the first occurance.
Thanks for your help.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 16 Oct 1999 10:01:59 GMT
From: Mat Tillett <u2orange@bigfoot.com>
Subject: Re: Running Perl script locally on a win98 machine
Message-Id: <38084EBA.678A7C53@bigfoot.com>
You need to be running some web server s.ware, try Xitami
(www.xitami.com) I find this best and then if you are on a local
machine, you can use the loopback dns to see your perl output
(127.0.0.1). Dont forget to configure Xitami to look a directory for
it's root path..!
Hope this helps,
u2orange@bigfoot.com
------------------------------
Date: Sat, 16 Oct 1999 07:36:30 GMT
From: Brandon <pooka@cygnus.ucdavis.edu>
Subject: Re: tr// question
Message-Id: <3807BA42.22857388@cygnus.ucdavis.edu>
Uri Guttman wrote:
>
>
> there, no rtfm, no snide tone, just an honest assessment of your value in
> this group.
>
> now go back to studying for your classes. you have a test tomorrow. it
> is in the class of learning what you don't know. you are in danger of
> flunking it.
>
Nothing snide there... You just proved my case once again.
------------------------------
Date: Fri, 15 Oct 1999 11:36:32 +0200
From: Hans-Joachim Leidinger <"Hans-Joachim Leidinger <jojo"@buchonline.net>>
Subject: Trouble with perl debug mode and FreeBSD 3.3!
Message-Id: <0js6u7.dh1.ln@server>
Hi list,
sorry for my poor english!
I want to debug my perl script and i get the messages like
----snip-------------
Debugged program terminated. Use q to quit or R to restart,
use O inhibit_exit to avoid stopping after program termination,
h q, h R or h O to get additional info.
######### Forked, but do not know how to change a TTY. #########
Define $DB::fork_TTY
- or a function DB::get_fork_TTY() which will set $DB::fork_TTY.
The value of $DB::fork_TTY should be the name of TTY to use.
On UNIX-like systems one can get the name of a TTY for the given
window
by typing tty, and disconnect the shell from TTY by sleep 1000000.
DB<2>
----snip-------------
I have ask the FreeBSD list and i get this answer..
-------snipp-----------
I think that what is happening here is the script that you are trying to
debug is Forking and when a debuged script is forked the perl debugger
opens a new xterm with the perl debugger running on the child.
Maybe your script is forking right at the start, possibly in a BEGIN
block and the parent is then quiting. It appears that the perl debugger
cannot open a xterm, are you running X? I am not sure what the perl
debugger will do if you are not running X. Let me see here....
YEP, i ran this code under perl -d ...
fork and exit;
sleep 10;
and did it from the console (ttyv0) and it gave me the same error as the
one that you got.
Well I played a little more and this even happens under X. I am not sure
why it is doing this, I know that when I have debugged programs that
fork in the past that the perl debugger opens a new xterm, but now I
just get this error.
Well, I think that you should give this one to comp.lang.perl.* because
I am confused here.
-------snipp-----------
For example.. if i have this script and use
#!/usr/bin/perl -d
$a = "Hallo";
$b = " Leute!";
print $a . " " . $b;
i get
---snipp---
print $a . " " . $b;
Debugged program terminated. Use q to quit or R to restart,
etc.
if i add some new lines like
$a = "Hallo";
$b = " Leute!";
print $a . " " . $b;
# Ja, was machen wir denn jetzt?
# Vielleicht so?
print $b . " Ich möchte Euch mit einem kräftigem...\n\n";
print $a . " " . $b . "\n\n";
print "grüßen!";
i get
---snipp---
print "grüßen!";
Debugged program terminated. Use q to quit or R to restart,
etc.
This happen, if i don't use some command like "W $a" and type "c".
Any hints, explanations, tips are very welcome!
Thank you very much!
--
Hans-Joachim Leidinger
buch online jojo@buchonline.net
Munscheidstr. 14 FAX: +49 209 1971449
45886 Gelsenkirchen
------------------------------
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 1092
**************************************