[13844] in Perl-Users-Digest
Perl-Users Digest, Issue: 1254 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 2 12:10:39 1999
Date: Tue, 2 Nov 1999 09:10:15 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <941562615-v9-i1254@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 2 Nov 1999 Volume: 9 Number: 1254
Today's topics:
Re: MacPerl 5 assign to Listelement (Chris Nandor)
Re: More Than A Little Help Needed for a newbie.... <mark.bluemelNOmaSPAM@siemens.co.uk.invalid>
Re: Perl Newbie <gellyfish@gellyfish.com>
Re: Range operators: two dots v.s. three dots <gellyfish@gellyfish.com>
Re: Range operators: two dots v.s. three dots <skilchen@swissonline.ch>
read it and find out <o.r.dickenson@student.salford.ac.uk>
Re: read it and find out <bivey@teamdev.com>
Re: Searching within web pages for text <sloon@mindless.com>
Re: Sort order in Perl (Chris Nandor)
Re: Sort order in Perl (Anno Siegel)
strange Perl incompatibility (NT & UNIX) <reembar@hotmail.com>
Re: string number conversion <lr@hpl.hp.com>
Re: Stripping live HTML into text <dsparling@my-deja.com>
VMS user authentication <matthew@swt.edu>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 02 Nov 1999 14:44:38 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: MacPerl 5 assign to Listelement
Message-Id: <pudge-0211990944430001@192.168.0.77>
In article <381C70D9.155C66C6@etech.hs-bremen.de>, "Dr.-Ing. M. Hartje"
<hartje@etech.hs-bremen.de> wrote:
# On MacPerl 5 the output is:
# |out of memory!
# |*
Try giving the MacPerl app more memory in the Finder (though this should
not be necessary, do it anyway :).
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: Tue, 02 Nov 1999 07:23:28 -0800
From: Mark Bluemel <mark.bluemelNOmaSPAM@siemens.co.uk.invalid>
Subject: Re: More Than A Little Help Needed for a newbie....
Message-Id: <004aa0e3.db677156@usw-ex0102-014.remarq.com>
Cc'ed
In article <381EE7C4.265DE695@student.salford.ac.uk>, Owen Dickenson
<o.r.dickenson@student.salford.ac.uk> wrote:
> Hi all, this is my first post to this newsgroup so i'll give u
> all a
> little background to my problem and myself. i am 19 years old and
> currently studing for a BSc in Information Technology at Slaford
> university (www.salford.ac.uk)
> As part of the degree we gave to undertake a Multi Year team
> project for
> a real client. ours is a local college. They have a wind turbine
> and
> they want a live data feed to a website which produes graphs and
> compares the figures to historical data. there web server is on
> UNIX
> and thier network is NT4. basicaly the problem is that we have no
> idea
> how to do this, several people i know have suggested perl but i
> don't
> know anything about it. ideally what i need is to be pointed in
> the
> direction of some resources that will be useful and maybe even a
> few
> good guide site's to perl. since i don't really know what need
> to know
> *boggles* then i can't really be more specific.
Some suggestions:-
1) RTFM & RTFFAQ - a lot of online information is available at
www.perl.com, but see my comment below about whether Perl is relevant
just yet.
2) Find a text on real-time processing in the Salford library - you do
have a university library don't you?
3) Talk to your tutors - they should be involved in the project
4) If you *must* use usenet as a resource, find the appropriate
newsgroup.
Your question has nothing to do with any programming language at
present its about how to implement real-time monitoring. Perl may be
appropriate for some part of the exercise (quite possibly not all), but
not yet.
--
Mark Bluemel
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: 2 Nov 1999 15:45:42 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl Newbie
Message-Id: <381f0726_1@newsread3.dircon.co.uk>
Andrew Longworth <Andrew_Longworth@bigfoot.com> wrote:
> I have never used perl before and need to write some perl. Does anyone know
> where I can find info on the web. (tutorials etc.)
>
Well I would start at <http://www.perl.com> in the first instance.
There is also a fine document set distributed with Perl - you will be able
to find out about this by typing :
perldoc perl
at some command prompt (of course you will have to have Perl installed
on the machine where you type this).
/J\
--
"Malcolm, what have I told you about putting chocolate near your
crotch?" - Mrs Merton
------------------------------
Date: 2 Nov 1999 16:12:08 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Range operators: two dots v.s. three dots
Message-Id: <381f0d58_1@newsread3.dircon.co.uk>
Samuel Kilchenmann <skilchen@swissonline.ch> wrote:
> Abigail <abigail@delanet.com> wrote in message
> news:slrn81t8om.66b.abigail@alexandra.delanet.com...
>> John Lin (johnlin@chttl.com.tw) wrote on MMCCLIV September MCMXCIII
> in
>> <URL:news:7vlnis$j0c@netnews.hinet.net>:
>> ~~ Hi,
>> ~~ I see the two dot operator '..' and three dot operator '...'
> in perlop.
>> ~~ Without examples, I can't understand the difference.
>>
>>
>> $ perl -wle 'for (qw /foobar barbar bazbar/) {print}' |\
>> perl -wne 'print if /foo/ .. /bar/'
>> foobar
>> barbar
>> $ perl -wle 'for (qw /foobar barbar bazbar/) {print}' |\
>> perl -wne 'print if /foo/ ... /bar/'
>> foobar
>> $
>>
> You must have a broken Perl...
>
Er that is exactly the same behaviour that I demonstrated is mine broken
as well ?
/J\
--
"Is there no demand for mechanical pussies?" - Mrs Slocombe
------------------------------
Date: Tue, 02 Nov 1999 16:43:29 GMT
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: Range operators: two dots v.s. three dots
Message-Id: <RwET3.28289$m4.101570039@news.magma.ca>
Jonathan Stowe schrieb in Nachricht <381f0d58_1@newsread3.dircon.co.uk>...
>Samuel Kilchenmann <skilchen@swissonline.ch> wrote:
>> Abigail <abigail@delanet.com> wrote in message
>> news:slrn81t8om.66b.abigail@alexandra.delanet.com...
>>> John Lin (johnlin@chttl.com.tw) wrote on MMCCLIV September MCMXCIII
>> in
>>> <URL:news:7vlnis$j0c@netnews.hinet.net>:
>>> ~~ Hi,
>>> ~~ I see the two dot operator '..' and three dot operator '...'
>> in perlop.
>>> ~~ Without examples, I can't understand the difference.
>>>
>>>
>>> $ perl -wle 'for (qw /foobar barbar bazbar/) {print}' |\
>>> perl -wne 'print if /foo/ .. /bar/'
>>> foobar
>>> barbar
>>> $ perl -wle 'for (qw /foobar barbar bazbar/) {print}' |\
>>> perl -wne 'print if /foo/ ... /bar/'
>>> foobar
>>> $
>>>
>> You must have a broken Perl...
>>
>
>Er that is exactly the same behaviour that I demonstrated
>is mine broken as well ?
>
No your Perl isn't broken because your example demonstrated exactly the
opposite behavior.
According to the documentation the first of Abigail's examples must print:
foobar
the second example must print:
foobar
barbar
------------------------------
Date: Tue, 02 Nov 1999 16:02:21 +0000
From: Owen Dickenson <o.r.dickenson@student.salford.ac.uk>
Subject: read it and find out
Message-Id: <381F0B0C.79C30D08@student.salford.ac.uk>
>
it would appear that i have chosen the wrong people to ask, if i have
inconvienienced anyone in anyway then i am truly sorry. i am getting
desperate however, my tutors have told me to use perl, so i thought "why not
ask the people who know" afterall you don't see a mechanic if you have a
medical problem do you. If it was just my degree riding on this then i
would not have such a complex project to be involved in, ther are 16 other
people's futures at stake.
Once again, my apologies. I doubt i'll post on here again.
In response to mark's post - do you really think i got to university by
fluke? of course i have read the books and manuals, the problem is i am not
a programmer, you are. i don't really undertand programming and if there is
a newsgroup out there that you kno of that could help, let me know. all i
wanted was a little help, was that too much to ask? i'll stop typing now,
otherwise i'll get abusive
------------------------------
Date: 2 Nov 1999 16:55:03 GMT
From: "William" <bivey@teamdev.com>
Subject: Re: read it and find out
Message-Id: <01bf2553$3ba75ac0$3527e1ce@bill.jump.net>
Owen Dickenson <o.r.dickenson@student.salford.ac.uk> wrote in article
<381F0B0C.79C30D08@student.salford.ac.uk>...
> >
> it would appear that i have chosen the wrong people to ask, if i have
> inconvienienced anyone in anyway then i am truly sorry. i am getting
> desperate however, my tutors have told me to use perl,
Mark may have been a tiny bit brusque (not compared to what
you could easily have gotten here), but he gave you good
advice. He pointed you at some resources. (I'd also suggest
getting "Learning Perl" AKA The Llama Book.) But he also
pointed out that picking a language to use was premature
if you didn't yet have a handle on how to solve the problem.
Programming languages are rarely solutions, they are the
tools you use to build solutions. Without a solution in
mind, you can't pick the right tool. Figure out exactly
what you need to accomplish, then look and see which
language makes the most sense.
And you didn't originally say "my tutors have told me to
use perl" you said "several people i know have suggested
perl" That's quite a bit different. You also failed to
mention that you "don't really undertand programming."
So, the first task you need to accomplish is to get some
idea of what programming is all about. In this case,
learning some Perl (and maybe some Java, etc.) makes
sense. So follow the link Mark gave you. start reading
and following other links. Do some searches on yahoo and
deja.com - you'll find tons of stuff. While what I said
before about not picking tools befor you have a solution
in mind still holds, it does help to know what kind of
tools you have to choose from. -Wm
------------------------------
Date: Tue, 02 Nov 1999 14:57:49 GMT
From: rob watson <sloon@mindless.com>
Subject: Re: Searching within web pages for text
Message-Id: <evseOMmbDklmCkGRUYY0C=I8+odW@4ax.com>
Thank you all for those helpfull replies.
rob
On Fri, 29 Oct 1999 15:30:33 GMT, rob watson <sloon@mindless.com>
wrote:
>Hi,
>
>I am curious as to how I could search within "only" the content of web
>pages for text. Ignoring the HTML tags, etc. and only searching for
>the given phrase within the text that would normally be rendered on
>the screen when the page is viewed in a browser.
>
>Thank's so much
>rob
------------------------------
Date: Tue, 02 Nov 1999 14:46:07 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Sort order in Perl
Message-Id: <pudge-0211990946120001@192.168.0.77>
In article <7vmnc3$akn$1@news1.xs4all.nl>, h.benne@library.uu.nl wrote:
# The order words are sorted by Perl is not the way I want it to be. The
# diacritical character 'ö' for example is sorted after the 'z' and I want
it to
# be sorted as 'oe'. The same for 'ä' (ae) and 'ü' (ue). Is this possible ?
See `man perllocale` and `perldoc locale`.
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: 2 Nov 1999 15:15:57 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Sort order in Perl
Message-Id: <7vmv7d$anm$1@lublin.zrz.tu-berlin.de>
Keywords: perl, sorting order
<h.benne@library.uu.nl> wrote in comp.lang.perl.misc:
>Hello,
>
>This is probably a newbie question, but I do not know the answer and hopefully
>somebody does.
>
>I want to sort an array with names that contains diacritical characters in a
>different way Perl does by default.
>
>The order words are sorted by Perl is not the way I want it to be. The
>diacritical character 'ö' for example is sorted after the 'z' and I want it to
>be sorted as 'oe'. The same for 'ä' (ae) and 'ü' (ue). Is this possible ?
Why, yes. use locale; might be all you need. That failing, to sort
your strings, create a hash %strings that has the original strings for
keys and the same strings with the umlauts substituted by whatever you
need for values (s///g). Then
sort { $strings{ $a} cmp $strings{ $b}}, keys %strings;
and you're set.
Anno
------------------------------
Date: Tue, 02 Nov 1999 18:41:57 +0200
From: Re'em Bar <reembar@hotmail.com>
Subject: strange Perl incompatibility (NT & UNIX)
Message-Id: <381F1455.66ACEFA1@hotmail.com>
I have made a search engine for my site, using Active Perl.
first it searchs for $search in each page's text and put the results in
@results, and later checks the pages title, $title, and print it with
the text matches, using those lines:
$title=~s/($search)/<b>\1<\/b>/gi;
if($1 || $results[0]){
print "<font size=4>$title<br><font size=3>";
foreach $match(@results){
$match=~s/($search)/<b>\1<\/b>/gi;
print"$match<br>";
}
}
now, with the Apache server on my computer, using Active Perl, it works
fine.
on the Linux host of my site, the results are printed only if there is a
match in the text ($results[0] ne "") but not if there is a match in the
title only ($1 ne "")
can someone solve this mystery?
--
Re'em
http://snark.co.il
------------------------------
Date: Tue, 2 Nov 1999 07:17:05 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: string number conversion
Message-Id: <MPG.1288a04f8f01427f98a189@nntp.hpl.hp.com>
In article <slrn81tjgk.ren.abigail@alexandra.delanet.com> on 2 Nov 1999
05:42:50 -0600, Abigail <abigail@delanet.com> says...
...
> This one allows for leading and trailing spaces, spaces around the /,
> dies with appropriate messages, defaults to use $_, has a cute final
> expression, allows for an optional sign, and uses the same number
> of lines:
>
> sub frac2dec (;$) {
> local $_ = @_ ? shift : $_;
> /\d/ && m{^\s*([-+]?)\s*(\d*)\s*(?:(\d+)\s*/\s*(\d+))?\s*$} or
> die "Not a fraction\n";
> die "Illegal division by zero" if defined $3 && $3 == 0;
^^ ^^
> ($1 eq '-' ? -1 : 1) * (($2 || 0) + ($3 || 0) / ($4 || 1));
> }
The denominator is $4, not $3. "Copy and paste working, tested code."
Heh, heh, heh.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 02 Nov 1999 15:04:54 GMT
From: dsparling <dsparling@my-deja.com>
Subject: Re: Stripping live HTML into text
Message-Id: <7vmuik$in$1@nnrp1.deja.com>
In article <RhpS3.4009$49.263485@news.flash.net>,
"Ryan" <ryan_richards_2000[NOSPAM]@yahoo.com> wrote:
> I need to come up with a solution to strip text from an html page and
place
> it in a file on the local machine. I was thinking Java, Javascript,
PERL
> etc. Any ideas would be most welcome!
>
> Ryan
>
>
#!/usr/local/bin/perl -w
package MyHTMLparser;
use HTML::Parser;
@ISA = qw(HTML::Parser);
sub text {
my ($self,$text) = @_;
$self->{myText} .= $text;
}
package main;
# Select file to be parsed.
$in_file = "test.html";
# Parse file.
my $p = MyHTMLparser->new;
$p->parse_file("$in_file");
print $p->{myText};
# Save parsed file to output file.
$out_file = "test.txt";
open(FILE, ">$out_file") || die "Cannot open $out_file for writing $!";
print FILE $p->{myText};
close FILE;
--
"Only two things are infinite: the universe and human stupidity."
Albert Einstein
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 02 Nov 1999 10:10:52 -0600
From: Matt Williamson <matthew@swt.edu>
Subject: VMS user authentication
Message-Id: <381F0D0C.A77E28A1@swt.edu>
I'm trying to write a CGI script on a VMS system that authenticates
usernames and passwords based on the standard VMS login database. I
accomplished this in UNIX/Linux, but I used some shell calls:
$pwd = (getpwuid(`id -u $FORM{'user'}`))[1];
if(crypt($FORM{'passwd'}, $pwd) eq $pwd){
&Authorize;
} else {
&Decline;
}
I'm not particularly familiar with the VMS operating system (read
quasi-ignorant). Is there an analogous way to do this under OpenVMS? Is
it possible for a script like this to work when it's running under
NETWORK mode (whatever that means...)?
-Matt Williamson, Web Developer
Southwest Texas State University
Department of Computer Science
------------------------------
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 1254
**************************************