[12311] in Perl-Users-Digest
Perl-Users Digest, Issue: 5911 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 7 11:07:32 1999
Date: Mon, 7 Jun 99 08:00:21 -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 Mon, 7 Jun 1999 Volume: 8 Number: 5911
Today's topics:
Re: Determining height and with of uploaded Graphic fil (Larry Rosler)
File uploading question <ex5316@netvigator.com>
HELP: How to extract href link?? lufan@hotmail.com
Re: HELP: How to extract href link?? <gellyfish@gellyfish.com>
HELP: Permission Denied retrieving remote URL (Greg)
Re: How do you do user input with opendir? <gellyfish@gellyfish.com>
Input from a pop-up html form (EXCHANGE:BNRTP:0S31)
is this code clunky? mikecard@my-deja.com
Re: is this code clunky? <uri@sysarch.com>
Re: left$ in basic -- also in perl? (John Klassa)
Little advice....Duh... jknoll@my-deja.com
Log reader utility <megrimes@flash.net>
Re: Need help to File Upload in perl ! <gellyfish@gellyfish.com>
New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
NT Services <arjan.huijzer@capgemini.nl>
Re: Perl "constructors" <jdporter@min.net>
Re: Perl "constructors" <jdporter@min.net>
Re: Perl "constructors" <jdporter@min.net>
Re: Perl Editor... <tchrist@mox.perl.com>
Permissions problem? <jhecker@iago.nac.net>
Re: Probably a dumb question on "use strict;" <steadmrd@cafes.net>
Re: Problem running '.exe' from 'CGI' (Larry Rosler)
Re: Redirect ftp://...? <gellyfish@gellyfish.com>
Re: Regular Expressions (Larry Rosler)
Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 7 Jun 1999 07:10:42 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Determining height and with of uploaded Graphic files
Message-Id: <MPG.11c5729f8d6a90bd989b7a@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <7jfuod$hoa$1@gatekeeper.ornano.kapt.com> on Mon, 7 Jun 1999
10:09:38 +0200, Fred Ruffet <fruffet@kaptech.com> says...
> >> What graphic files ? GIFs, JPGs, BMPs, XPMs,...
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >
> >Is that relevant to solving the problem? That just seemed odd to me?
>
> Well, excuse me, but I always forget that we need to download and use a big
> module that is able to do many things just to do one. Is that necessary to
> use a module that is able to determine size of any picture file format, just
> to read one ?
> Reusable code is all very well, but a thousand lines of code is not always
> useful... :-)
I agree that loading a thousand lines of code to crack this peanut of a
problem every time is absurd. But the code is reusable.
All you have to do (once) is download the module, and *read it*, and
grab the algorithms for those formats you are interested in. It takes
between two lines and a dozen lines of code for each of the picture file
formats that I needed.
I could post my tiny functions (each of which credits Image::Size) here,
but maybe you should try to catch your own fish.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 07 Jun 1999 22:15:00 +0800
From: Alex <ex5316@netvigator.com>
Subject: File uploading question
Message-Id: <375BD3E4.D485BFAC@netvigator.com>
Please help,
I intend to use the file-uploading script from Jeff Carnahan.This is a
very good script, indeed.
But I have a question:
If I only allow people to upload the specified filenames, e.g.
upload1.html, upload2.html and upload3.html. Filenames other than these
are not allow to upload.
How can I do that ?
Thank you
alex
------------------------------
Date: Mon, 07 Jun 1999 17:05:18 -0700
From: lufan@hotmail.com
Subject: HELP: How to extract href link??
Message-Id: <375C5E3E.48F8@hotmail.com>
hello all,
I use following expression extracting href link and
text name,
/<a[ ]+href=["|']?([^>|^'|^"]+)["|']?[\d|\s|\w|"|']*>([^<]+)<\/a>/i
As html version upgrading, more text like,
<a href=http://www.abc.com target=_blank><span>.... </span>text1</a>
appears, is there any code to help this ?
lufan
------------------------------
Date: 7 Jun 1999 15:28:06 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: HELP: How to extract href link??
Message-Id: <375bd6f6@newsread3.dircon.co.uk>
lufan@hotmail.com wrote:
> hello all,
>
> I use following expression extracting href link and
> text name,
> /<a[ ]+href=["|']?([^>|^'|^"]+)["|']?[\d|\s|\w|"|']*>([^<]+)<\/a>/i
>
> As html version upgrading, more text like,
>
> <a href=http://www.abc.com target=_blank><span>.... </span>text1</a>
>
> appears, is there any code to help this ?
>
The module HTML::LinkExtor ivailable from CPAN is probably what you
want.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Mon, 07 Jun 1999 08:18:58 GMT
From: gsoup@yahoo.com (Greg)
Subject: HELP: Permission Denied retrieving remote URL
Message-Id: <375b804b.3101269@news.anet-stl.com>
I am having problems retrieving a remote URL. I wrote a script using
LWP::Simple with the LWP and supporting modules copied into a library
directory.
use lib ('/home/username/public_html/cgi-bin/lib');
use LWP::Simple;
$content = get($url);
I successfully ran the script without errors on my home webpage, but
it returns a 500 Internal Server error on my free web host on
virtualave.net with the same module files copied into a library
directory. Virtualave.net does not allow telnet access, so I can't run
the script from the command line. I found a newsgroup article which
mentioned how to catch the error and wrote the folllowing script.
#! /usr/local/bin/perl
use lib ('/home/username/public_html/cgi-bin/lib');
use IO::Socket;
$url = 'http://www.yahoo.com';
($fetch_status, $fetch_message, $contents) = fetch("$url");
&displayresults("$fetch_status", "$fetch_message", "$contents");
sub fetch {
my $fetch_url = shift(@_);
my ($nethost, $request) = $fetch_url =~ m!http://([^/]+)(.*)!;
$nethost .= ':80' unless $nethost =~ /:\d+$/;
$request ||= '/';
my $h = IO::Socket::INET->new($nethost);
return (999, $@) unless $h; #return any errors
$h->print ("GET $request HTTP/1.0\r\n\r\n");
$header = $h->getline;
my ($status_line, %fields) = split(/^([-\w]+):/m,$header);
my ($status, $message) = $status_line =~
m!http/1\.\d+\s+(.*)$!i;
return (400,"malformed header") unless $status;
my ($data, $doc_body);
do { $doc_body .= $data } while $h->read($data, 1024);
$h->close;
return ($status, $message, $doc_body);
}
sub displayresults {
my ($status, $message, $contents) = @_;
print "Content-type: text/html\n\n";
print <<"RESULTS_END";
<html><head><title>Fetch results</title></head><body>
<center><table>
<tr><td align=right><b>Status</b></td><td>$status</td></tr>
<tr><td align=right><b>Message</b></td><td>$message</td></tr>
<tr><td
align=right><b>Contents</b></td><td>$contents</td></tr>
</table></center></body></html>
RESULTS_END
exit (0);
}
When this script is run from the browser, I get the displayresults
subroutine to display the error: IO::Socket::INET Permission Denied
Any ideas of what my problem(s) is?
Thanks,
Greg (GSoup@yahoo.com)
------------------------------
Date: 7 Jun 1999 14:59:06 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How do you do user input with opendir?
Message-Id: <375bd02a@newsread3.dircon.co.uk>
Mike <spammerswill@beshot.com> wrote:
> I wrote the following script, but activestate perl doesn't like it. I
> haven't tried it out in my copy of redhat though:
>
> opendir(that_dir, '$the_dir');
You have two errors in this line - the first was to put single quotes
around $the_dir thus causing the literal value '$the_dir' to passed to
opendir - the second was not to test for the failure of the opendir which
might have suggested where the error lay. Thus this line should be:
opendir(THAT_DIR,$the_dir) || die "Cant open directory $the_dir - $!\n";
Oh I didnt mention that it is conventional to use uppercase for file and
directory handles in order that they dont get confused with plain barewords.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Mon, 07 Jun 1999 10:18:31 -0400
From: "Barth, Brian (EXCHANGE:BNRTP:0S31)" <picoop2@americasm01.nt.com>
Subject: Input from a pop-up html form
Message-Id: <375BD4B7.A8703DD4@americasm01.nt.com>
I have a multiple selection pop-up html form in a perl script and i need
to send all the selected options to another script.
the form is method=get
how do read in all the selected options into an array in the called
script?
thanks
brian barth
------------------------------
Date: Mon, 07 Jun 1999 13:03:59 GMT
From: mikecard@my-deja.com
Subject: is this code clunky?
Message-Id: <7jgfvq$n1k$1@nnrp1.deja.com>
hello
first off i would like to officially take back what i said about
learning perl (remember that absurdly long thread "learning perl doesn't
seem to be written very well", well now that i am near the end i can
say that it is written very well, i've learned a lot and my appologies
to the authors.)
anyway on to my post, i am writing a card game as a way to solidify perl
in my brain. the following code works but i'm wondering if it is
bloated. basically i am taking a number between 0 and 51 and breaking
it into individual suits and cards
here it is...
@card_seq = qw(2 3 4 5 6 7 8 9 10 J Q K A);
if ($card <= 12) {
$suit_played = 'diamonds';
$card_place = $card;
}elsif ($card <= 25) {
$suit_played = 'hearts';
$card_place = ($card - 13);
}elsif ($card <= 38) {
$suit_played = 'clubs';
$card_place = ($card - 26);
}elsif ($card <= 51) {
$suit_played = 'spades';
$card_place = ($card - 39);
}else{
print "this dopey program gave you an invalid card";
}
print "card played is $card_seq[$card_place] of $suit_played\n";
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 07 Jun 1999 10:20:34 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: is this code clunky?
Message-Id: <x77lpg853h.fsf@home.sysarch.com>
>>>>> "m" == mikecard <mikecard@my-deja.com> writes:
m> first off i would like to officially take back what i said about
m> learning perl (remember that absurdly long thread "learning perl doesn't
m> seem to be written very well", well now that i am near the end i can
m> say that it is written very well, i've learned a lot and my appologies
m> to the authors.)
as well you should!
m> in my brain. the following code works but i'm wondering if it is
m> bloated. basically i am taking a number between 0 and 51 and breaking
yes it is.
m> @card_seq = qw(2 3 4 5 6 7 8 9 10 J Q K A);
m> if ($card <= 12) {
m> $suit_played = 'diamonds';
m> $card_place = $card;
m> }elsif ($card <= 25) {
m> $suit_played = 'hearts';
m> $card_place = ($card - 13);
m> }elsif ($card <= 38) {
m> $suit_played = 'clubs';
m> $card_place = ($card - 26);
m> }elsif ($card <= 51) {
m> $suit_played = 'spades';
m> $card_place = ($card - 39);
m> }else{
m> print "this dopey program gave you an invalid card";
m> }
m> print "card played is $card_seq[$card_place] of $suit_played\n";
^^^^^
played
@card_seq = qw(2 3 4 5 6 7 8 9 10 J Q K A);
@suit_seq = qw( diamonds hearts clubs spades ) ;
$suit_played = $card / 13 ;
$card_played = $card % 13 ;
print "card played is $card_seq[$card_played] of $suit_seq[$suit_played]\n";
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: 7 Jun 1999 13:47:57 GMT
From: klassa@aur.alcatel.com (John Klassa)
Subject: Re: left$ in basic -- also in perl?
Message-Id: <7jgiid$lfd$1@aurwww.aur.alcatel.com>
On Mon, 07 Jun 1999, Richard Lawrence <ralawrence@my-deja.com> wrote:
> Is there any equivilant in Perl? I've been looking through the
> programming perl book and some web help but haven't seemed to see
> anything that would indicate Perl can do this (which I'm sure it can).
Try "man perlfunc", and look for "substr".
--
John Klassa / Alcatel USA / Raleigh, NC, USA
------------------------------
Date: Mon, 07 Jun 1999 13:56:32 GMT
From: jknoll@my-deja.com
Subject: Little advice....Duh...
Message-Id: <7jgj2c$o6j$1@nnrp1.deja.com>
I recently downloaded a copy of perl at work. C: has like 5mb free
space. So I downloaded it to my Network drive H:
DO NOT DO THIS. Nobody ever told me not to do this so please save the
snide remarks. I realize it wasnt a smart thing to do, but it was my
only option and things seemed to be working fine.
That is untill we had to turn the power off, and shut down the
servers. There is a subdirectory called PIPE in one of the Win32s
directorys. There is also a command somewhere in the server that is
ALSO called PIPE. So needless to say the network crashed and some guys
got to almost spend the night at work because of me. I know its
probably in some FAQ somewhere about downloading, and I missed it, so to
any perl newbie that reads this;
Always download perl locally.
thanks,
Jrk
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Mon, 07 Jun 1999 14:24:33 GMT
From: "Mike Grimes" <megrimes@flash.net>
Subject: Log reader utility
Message-Id: <BCQ63.244$up4.415@news.flash.net>
I have a number of applications which generate individual log files. I am
looking for a public domain tool which can be configured to read multiple
log files and send email or a page depending on text messages entered in
these log files. Ideally, it will be written in PERL so that it might be
easily ported/used on NT boxes also. A tool like this must exist somewhere,
does anyone have experience with such a utility?
Mike Grimes
megrimes@flash.net
------------------------------
Date: 7 Jun 1999 14:42:05 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Need help to File Upload in perl !
Message-Id: <375bcc2d@newsread3.dircon.co.uk>
Ranganath <rangagv@compucomtech.com> wrote:
>
> Can u tell me where i can find this perldoc CGI and CGI.pm .
>
At the command prompt on your computer you type:
perldoc CGI
simply as that. While your at it you might try
perldoc perldoc
perldoc perl
As well.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: 7 Jun 1999 14:32:44 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <7jgl6c$8t2$2@info2.uah.edu>
Following is a summary of articles from new posters spanning a 7 day
period, beginning at 31 May 1999 14:31:02 GMT and ending at
07 Jun 1999 19:16:45 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 1999 Greg Bacon.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Totals
======
Posters: 281 (56.9% of all posters)
Articles: 571 (36.3% of all articles)
Volume generated: 969.0 kb (34.7% of total volume)
- headers: 455.2 kb (8,895 lines)
- bodies: 488.1 kb (16,247 lines)
- original: 360.1 kb (12,659 lines)
- signatures: 25.2 kb (580 lines)
Original Content Rating: 0.738
Averages
========
Posts per poster: 2.0
median: 1 post
mode: 1 post - 198 posters
s: 6.8 posts
Message size: 1737.8 bytes
- header: 816.4 bytes (15.6 lines)
- body: 875.3 bytes (28.5 lines)
- original: 645.8 bytes (22.2 lines)
- signature: 45.1 bytes (1.0 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
111 203.9 (106.8/ 83.9/ 55.1) Tom Phoenix <rootbeer@redcat.com>
23 46.6 ( 17.5/ 29.1/ 28.6) Hasanuddin Tamir <hasant@trabas.co.id>
14 23.0 ( 11.4/ 11.5/ 7.4) "Bastiaan S van den Berg" <office@asc.nl>
12 21.2 ( 10.7/ 10.6/ 4.3) "Bastiaan S van den Berg" <buzz@ddsw.nl>
7 11.5 ( 6.3/ 5.3/ 2.6) "Alar Pandis" <Alar@mtk.ut.ee>
6 13.9 ( 3.6/ 10.3/ 10.3) "Fadel" <fkamardean@email.msn.com>
6 22.6 ( 7.0/ 15.6/ 6.2) armchair@my-deja.com
6 9.4 ( 4.1/ 4.8/ 3.5) jde222RemovethiS@iname.com
5 5.3 ( 3.2/ 2.1/ 1.5) wasteNOSPAMbasket@bigfoot.com (Jamie Jackson)
5 8.4 ( 3.8/ 4.7/ 2.3) S Starre <sstarre@my-deja.com>
These posters accounted for 12.4% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
203.9 (106.8/ 83.9/ 55.1) 111 Tom Phoenix <rootbeer@redcat.com>
46.6 ( 17.5/ 29.1/ 28.6) 23 Hasanuddin Tamir <hasant@trabas.co.id>
23.0 ( 11.4/ 11.5/ 7.4) 14 "Bastiaan S van den Berg" <office@asc.nl>
22.6 ( 7.0/ 15.6/ 6.2) 6 armchair@my-deja.com
21.2 ( 10.7/ 10.6/ 4.3) 12 "Bastiaan S van den Berg" <buzz@ddsw.nl>
19.9 ( 1.8/ 18.2/ 14.6) 2 "Sherry" <vision4@bigplanet.com>
13.9 ( 3.6/ 10.3/ 10.3) 6 "Fadel" <fkamardean@email.msn.com>
11.5 ( 6.3/ 5.3/ 2.6) 7 "Alar Pandis" <Alar@mtk.ut.ee>
9.7 ( 0.6/ 8.8/ 8.8) 1 "William S. Lear" <rael@see.sig>
9.4 ( 4.1/ 4.8/ 3.5) 6 jde222RemovethiS@iname.com
These posters accounted for 13.7% of the total volume.
Top 10 Posters by OCR (minimum of three posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
1.000 ( 1.0 / 1.0) 3 "Thurley" <thurley@globalnet.co.uk>
1.000 ( 1.6 / 1.6) 3 reddogg1471@my-deja.com
1.000 ( 1.9 / 1.9) 4 Derek Lavine <derek@realware.com.au>
1.000 ( 1.0 / 1.0) 3 "Dmitry P." <dpodbori@email.msn.com>
0.996 ( 10.3 / 10.3) 6 "Fadel" <fkamardean@email.msn.com>
0.982 ( 28.6 / 29.1) 23 Hasanuddin Tamir <hasant@trabas.co.id>
0.971 ( 1.4 / 1.5) 3 fred dirkse <dirkse@my-deja.com>
0.952 ( 1.8 / 1.9) 3 bbrowning@northpolemedia.com (Brian Browning)
0.949 ( 2.5 / 2.6) 3 smnayeem@my-deja.com
0.897 ( 1.5 / 1.7) 3 "Bruno Baguette" <bruno.baguette@francemel.com>
Bottom 10 Posters by OCR (minimum of three posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.565 ( 1.2 / 2.1) 4 "Luke" <REMOVENOSPAMwmtoh@singnet.com.sg>
0.542 ( 2.4 / 4.5) 3 "Alex" <axc@iname.com>
0.504 ( 0.4 / 0.8) 3 mistral@zetnet.co.uk
0.497 ( 1.8 / 3.6) 3 cybear_x-nospam@geocities.com (Cybernetic Bear)
0.497 ( 2.6 / 5.3) 7 "Alar Pandis" <Alar@mtk.ut.ee>
0.486 ( 2.3 / 4.7) 5 S Starre <sstarre@my-deja.com>
0.407 ( 4.3 / 10.6) 12 "Bastiaan S van den Berg" <buzz@ddsw.nl>
0.401 ( 6.2 / 15.6) 6 armchair@my-deja.com
0.294 ( 0.5 / 1.7) 3 "Jester" <jester@isdead.aha>
0.269 ( 0.3 / 1.0) 3 sam@cheapnet.co.uk
34 posters (12%) had at least three posts.
Top 10 Crossposters
===================
Articles Address
-------- -------
18 "Kent Dahl" <MenThal@bigfoot.com>
11 "John" <John_B52hotmail.com> (at)
9 don'tbother@nospam.net
9 "Dan Hinojosa" <dawndan@gateway.net>
9 fvw@chello.nl (Frank v Waveren)
9 "Jay" <IMNOT@ZHOMEZ.COM>
6 Tom Phoenix <rootbeer@redcat.com>
4 jurgen.hildebrand@tridion.com
4 "Bastiaan S van den Berg" <buzz@ddsw.nl>
3 gillwill2000@my-deja.com
------------------------------
Date: Mon, 7 Jun 1999 16:05:53 +0200
From: "Arjan Huijzer" <arjan.huijzer@capgemini.nl>
Subject: NT Services
Message-Id: <7jgjjv$ev5$1@news1.xs4all.nl>
We have a couple of Perl Server-programs that we want to run as a NT
Service, so the server programs are running in the background and are
started automatically when our machines reboots.
Is there anybody who has done this before?
All hellp is welcome!
p.s. we are running NT 4 (service pack 5) & Perl 5.005_03
Arjan Huijzer
------------------------------
Date: Mon, 07 Jun 1999 13:03:23 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Perl "constructors"
Message-Id: <7jgfum$n16$1@nnrp1.deja.com>
In article <7il6ge$ruq$1@nnrp1.deja.com>,
armchair@my-deja.com wrote:
> In article <7i3spi$u50$1@nnrp1.deja.com>,
> John Porter <jdporter@min.net> wrote:
> > In article <7i2to7$83g$1@nnrp1.deja.com>,
> > armchair@my-dejanews.com wrote:
> >
> > > I never left C++. Unlike some, I have not yet fallen in love with
a
> > > programming language. But maybe you are right, Perl can only be
> > > understood by geniuses, where as C++ is the language of the common
> > man.
> >
> > ROFL. The real difference is, C++ is a low-level language, and
> > Perl is a high-level language. Each has its strengths, and its
> > peculiar idiom. Some aspects of Perl's idiom can seem bizarre to
> > people who are used to C++ (not to mention toy languages like VB).
>
> Since the looping and decision constructs of Perl are the same as C
Superficially.
> C++, and since C++ now has a string class,
Having a string class makes C++ a HLL? ROFL again.
> perhaps it is the dynamic
> arrays and dynamic hashes that have you [ROFL].
Not.
> Well, via the Standard Template Library (STL), those data
> structures also exist in C++ as well (few, if any vendors are not
> shipping the STL with their compiler). What then puts Perl at a higher
> level than C++?
If simply having the ability to create ADTs makes a language a HLL,
then every language in current usage -- including asm -- is a HLL,
because they're all Turing-equivalent. Were you sick they day they
talked about this in class? Perl is a HLL (relative to C and any
of its bastard children) because these data structures and their
operators are intrinsic to the language. Tell me, what is GC like
in C++? Partial evaluation? Rewriting?
--
John Porter
Put it on a plate, son. You'll enjoy it more.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Mon, 07 Jun 1999 13:14:37 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Perl "constructors"
Message-Id: <7jggjn$n81$1@nnrp1.deja.com>
In article <7jakjq$3h4$1@nnrp1.deja.com>,
armchair@my-deja.com wrote:
> Assembly does not have the same if and while/for logic as C/C++/Perl.
"Same"? Of course it's not the same. But it has them in some form.
And you're making a mistake to be lumping C/C++ with Perl.
> Assembly does not have arithmetic expressions and variable
> declaration/naming and assignment like C/C++/Perl.
"Like C/C++/Perl"? Of course not. But has them, in some form.
> And Assembly does not
> have IO statements like print and printf and read/write like
C/C++/Perl.
These are not statements in C/C++, they're library functions which
make the corresponding system calls. Asm can do that too.
C is a low-level language; it's merely a portable "assembly" language
with a well-defined standardized function library. ANYTHING you can
do in C, you can do in asm. The mapping is so obvious (to anyone
with a clue, at least). C++ is a little different. A lot of complex
baggage was added. Not that I'm complaining...
> And Assembly does not have the portability/standardization of
> C/C++/Perl.
Obviously! So what.
> can you do this in Assembly?:
>
> TextArray a;
> returnCode = a.LoadFromTextFile("input.txt");
> a.RemoveBlankLines();
> cout << a;
Of course. It would just be a lot more work.
The invention of C was not totally in vain, after all.
--
John Porter
Put it on a plate, son. You'll enjoy it more.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Mon, 07 Jun 1999 13:38:18 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Perl "constructors"
Message-Id: <7jgi09$noj$1@nnrp1.deja.com>
In article <7il85o$t0u$1@nnrp1.deja.com>,
armchair@my-deja.com wrote:
> Would you agree that you and I disagree on whether the forced type
> declaration in C++ adds to the readability and understandability of
the
> code in languages such as Perl?
I probably agree with you on that -- but I think you said that wrong.
Nothing in C++ (forced type declarations or anything else) has any
impact on code in Perl or any other language.
> Scalar variables in Perl (numbers, strings, references to
> (numbers,strings,hashes,arrays,objects)) are all identified the same.
> my $variable.
> This is not the same as C++ syntax.
> Nor is is that same as what takes place under the hood.
Obviously. I never said it was.
> > (Btw, p could indeed point to any type, including built-ins.
> > Maybe not in an ideal system, but it's still possible, and common.)
>
> No it can't. Try and get this to compile
>
> int *a;
> short b = 2;
> a = &b;
>
> Only pointers declared as void can point to any variable, and then you
> can't dereference them unless you cast them to the appropriate pointer
-
> you must ultimately know they type of what they point to.
If that's true, then the language has changed since the last time I
used it. It used to be, a pointer could point to any memory location,
regardless of what you or the computer thought was stored there.
All it took was a cast. You could dereference it, too. The only
case that was guaranteed to cause a problem was dereferencing a
NULL pointer.
But you're telling me that
Foo x;
int* p = (int*) &x;
int i = *p;
is an error. That's news to me.
> Overloading of operators in Perl? I guess I missed that in perlobj.
It's not in the core. Read perldoc overload if you're interested.
> > The philosophy of OO says that types should be abstracted.
Different
> > systems abstract them to different levels, and perhaps the best we
> > can say is that this is proper. In Perl, it was decided that --
most
> > of the time -- numbers and strings should be dealt with via a common
> > abstraction, i.e. a common superclass.
>
> If I have a date/time object, the "philosophy of OO" may say that I
> don't need to know how it is represented, but they have nothing
against
> me knowing that it represents dates and times. But with my $a =
> somefunction(); I don't know whether $a represents date/times or is a
> count of the number of times some functionality in Perl is represented
> as having arose from long and deep thought.
It's simply a higher degree of abstraction.
Some programmers see this as a feature.
--
John Porter
Put it on a plate, son. You'll enjoy it more.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 7 Jun 1999 08:19:53 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl Editor...
Message-Id: <375bd509@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
Darrick Wolfe <bravo@bravodesign.com> writes:
:http://www.petes-place.com/ and try CodeMagic. It still needs some work, but
:it's a pretty good IDE. and it is totally free.
Perl already has an IDE. It's called Unix.
--tom
--
In computer science, we stand on each other's feet. --Brian K. Reed
------------------------------
Date: Mon, 07 Jun 1999 14:57:18 GMT
From: Jared Hecker <jhecker@iago.nac.net>
Subject: Permissions problem?
Message-Id: <i5R63.156$tr.1066@nntp1>
Hello -
If I can stat $_ directory a with the expected result, but a stat $_
against directory b produces only a list of the file names (i.e., the
associated array is null), is this some sort of permissions problem? I
can 'ls -l' the directory (b), open files in it for editing, etc.
TIA -
Regards,
jh
--
Jared Hecker | HWA Inc. - Oracle architecture and Administration
jared@hwai.com | ** serving NYC and New Jersey **
------------------------------
Date: Mon, 7 Jun 1999 09:12:33 -0500
From: "Josh Steadmon" <steadmrd@cafes.net>
Subject: Re: Probably a dumb question on "use strict;"
Message-Id: <375bd325.0@news.isdn.net>
What's confusing me is that I did declare all of my variables with "my".
However, the error message still says:
"Global symbol ___ requires explicit package name at ....."
Eric Bohlman wrote in message ...
>Josh Steadmon (steadmrd@cafes.net) wrote:
>: I just added "use strict;" to several of my modules to make sure that I
had
>: done everything just right. The first module worked fine. The second
>: module, which "uses" the first module, got a whole bunch of errors saying
>: that "so-and-so variable requires explicit package name" or something
>: similar. I understood that to mean that every variable requires:
>
>: PackageName::variablename
>
>: instead of:
>
>: variablename.
>
>That's the case for undeclared variables. Declared global variables
>(declared with "use vars ...") and declared lexical variables (declared
>with my) don't need explicit package names.
>
>: Please, someone tell me that I'm wrong, because the module is probably
over
>: 1,000 lines, and I don't care to work my way over each and every one of
>: those.
>
>The solution is to declare all your variables at the beginning of the
module.
>
>: Also, is there a built-in Perl function to convert a character into its
>: ASCII value? (That would cut out the bulk of my progam.)
>
>perldoc -f ord
>
>
------------------------------
Date: Mon, 7 Jun 1999 07:18:04 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Problem running '.exe' from 'CGI'
Message-Id: <MPG.11c5746e580fcb12989b7b@nntp.hpl.hp.com>
In article <Pine.LNX.4.05.9906070500430.27580-100000@hill.cs.ucr.edu> on
Mon, 7 Jun 1999 05:15:44 -0700, Abraham Grief <abey@cs.ucr.edu> says...
...
> If you're not specifying the full path in your system calls, you might
> need to add something like
>
> use lib 'c:inetpub/wwwroot/cgi-bin';
>
> near the start of your script. When your webserver runs the cgi script,
> the cgi-bin might not be in the path. Also, I don't know if you can use /
> like that in your path on windows. It's been a while since I wrote any
> perl scripts on windows, but I always had to use backslashes for my paths.
If you don't know about something, why post your (incorrect)
conjectures?
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 7 Jun 1999 14:52:56 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Redirect ftp://...?
Message-Id: <375bceb8@newsread3.dircon.co.uk>
Steve Livingston <slivings@digitalriver.com> wrote:
> Is it possible to redirect ftp-urls like http-urls?
>
I dont know perhaps you ought to ask in a group that is concerned with
such matters.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Mon, 7 Jun 1999 07:42:59 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Regular Expressions
Message-Id: <MPG.11c57a4fb3fd7b989b7c@nntp.hpl.hp.com>
In article <375BB0CE.DF97A424@alcatel.be> on Mon, 07 Jun 1999 13:45:19
+0200, Timpie <tim.schelfhout@alcatel.be> says...
> /(\d*)\s*/;
> $num=$1;
>
> Then do your tests on the $num variable.
Two comments on these two lines.
1. The trailing '\s*' in the regex is superfluous. Anything whatever
following the digits will match your regex.
2. Should there not be any digits, the regex will match and store a
null string in $num. Better to test for failure:
/(\d+)/ or warn "No digits in string $_.\n";
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 7 Jun 1999 14:32:44 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <7jgl6c$8t2$1@info2.uah.edu>
Following is a summary of articles spanning a 7 day period,
beginning at 31 May 1999 14:31:02 GMT and ending at
07 Jun 1999 19:16:45 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 1999 Greg Bacon.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Excluded Posters
================
perlfaq-suggestions\@(?:.*\.)?perl\.com
Totals
======
Posters: 494
Articles: 1574 (725 with cutlined signatures)
Threads: 481
Volume generated: 2790.3 kb
- headers: 1230.2 kb (24,170 lines)
- bodies: 1437.6 kb (45,913 lines)
- original: 995.6 kb (33,967 lines)
- signatures: 121.0 kb (2,604 lines)
Original Content Rating: 0.693
Averages
========
Posts per poster: 3.2
median: 1.0 post
mode: 1 post - 302 posters
s: 8.3 posts
Posts per thread: 3.3
median: 2 posts
mode: 1 post - 134 threads
s: 3.5 posts
Message size: 1815.3 bytes
- header: 800.3 bytes (15.4 lines)
- body: 935.3 bytes (29.2 lines)
- original: 647.7 bytes (21.6 lines)
- signature: 78.7 bytes (1.7 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
111 203.9 (106.8/ 83.9/ 55.1) Tom Phoenix <rootbeer@redcat.com>
87 146.6 ( 67.9/ 68.4/ 33.8) Jonathan Stowe <gellyfish@gellyfish.com>
56 111.6 ( 46.0/ 59.2/ 34.3) David Cassell <cassell@mail.cor.epa.gov>
56 89.6 ( 35.0/ 48.5/ 27.3) lr@hpl.hp.com (Larry Rosler)
36 125.6 ( 29.3/ 92.5/ 87.5) tchrist@mox.perl.com (Tom Christiansen)
35 71.0 ( 38.0/ 17.6/ 16.0) abigail@delanet.com
33 72.7 ( 28.5/ 34.1/ 15.5) Uri Guttman <uri@sysarch.com>
27 45.7 ( 20.2/ 19.4/ 9.1) rjk@linguist.dartmouth.edu (Ronald J Kimball)
26 36.3 ( 15.1/ 21.2/ 13.9) tadmc@metronet.com (Tad McClellan)
24 35.2 ( 18.2/ 14.2/ 9.1) Greg Bacon <gbacon@cs.uah.edu>
These posters accounted for 31.2% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
203.9 (106.8/ 83.9/ 55.1) 111 Tom Phoenix <rootbeer@redcat.com>
146.6 ( 67.9/ 68.4/ 33.8) 87 Jonathan Stowe <gellyfish@gellyfish.com>
125.6 ( 29.3/ 92.5/ 87.5) 36 tchrist@mox.perl.com (Tom Christiansen)
111.6 ( 46.0/ 59.2/ 34.3) 56 David Cassell <cassell@mail.cor.epa.gov>
89.6 ( 35.0/ 48.5/ 27.3) 56 lr@hpl.hp.com (Larry Rosler)
72.7 ( 28.5/ 34.1/ 15.5) 33 Uri Guttman <uri@sysarch.com>
71.0 ( 38.0/ 17.6/ 16.0) 35 abigail@delanet.com
46.6 ( 17.5/ 29.1/ 28.6) 23 Hasanuddin Tamir <hasant@trabas.co.id>
45.7 ( 20.2/ 19.4/ 9.1) 27 rjk@linguist.dartmouth.edu (Ronald J Kimball)
40.0 ( 16.5/ 23.6/ 15.3) 22 "Bill Jones" <bill@fccj.org>
These posters accounted for 34.2% of the total volume.
Top 10 Posters by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.996 ( 10.3 / 10.3) 6 "Fadel" <fkamardean@email.msn.com>
0.995 ( 10.1 / 10.1) 11 andrew-johnson@home.com
0.991 ( 21.7 / 21.9) 13 pudge@pobox.com (Chris Nandor)
0.982 ( 28.6 / 29.1) 23 Hasanuddin Tamir <hasant@trabas.co.id>
0.947 ( 19.0 / 20.1) 18 fl_aggie@thepentagon.com
0.947 ( 87.5 / 92.5) 36 tchrist@mox.perl.com (Tom Christiansen)
0.930 ( 7.0 / 7.6) 10 Mitch <portboy@home.com>
0.924 ( 5.7 / 6.1) 5 "Jonathan" <jonathan@meanwhile.freeserve.co.uk>
0.921 ( 3.9 / 4.2) 5 Dale Henderson <dhenders@cpsgroup.com>
0.912 ( 16.0 / 17.6) 35 abigail@delanet.com
Bottom 10 Posters by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.473 ( 3.1 / 6.5) 6 Matt Sergeant <matt-news@sergeant.org>
0.468 ( 9.1 / 19.4) 27 rjk@linguist.dartmouth.edu (Ronald J Kimball)
0.454 ( 15.5 / 34.1) 33 Uri Guttman <uri@sysarch.com>
0.451 ( 3.8 / 8.5) 14 efflandt@xnet.com
0.442 ( 2.0 / 4.6) 7 dave@dave.org.uk (Dave Cross)
0.423 ( 1.2 / 2.7) 6 tgy@chocobo.org
0.407 ( 2.0 / 4.9) 5 "Fred Ruffet" <fruffet@kaptech.com>
0.407 ( 4.3 / 10.6) 12 "Bastiaan S van den Berg" <buzz@ddsw.nl>
0.401 ( 6.2 / 15.6) 6 armchair@my-deja.com
0.383 ( 2.5 / 6.5) 10 ada@fc.hp.com (Andrew Allen)
58 posters (11%) had at least five posts.
Top 10 Threads by Number of Posts
=================================
Posts Subject
----- -------
35 The artistic license and perl:
29 Y2K infected Perl code
21 Is split (surprisingly, amazingly) slow?
17 Copying any files
15 Anyone know what is this script line meaning ??
15 Perl, Y2K, and idiots
14 microso?t perl
14 Simple newbie question...
14 know Perl to maintain Perl (was: Re: I pass an array...)
13 uninitialized value? what am i doing wrong?
These threads accounted for 11.9% of all articles.
Top 10 Threads by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Subject
-------------------------- ----- -------
94.7 ( 31.1/ 57.7/ 42.1) 35 The artistic license and perl:
67.7 ( 30.3/ 33.6/ 19.5) 29 Y2K infected Perl code
63.4 ( 5.2/ 57.6/ 56.4) 7 Opening a remote file?
45.6 ( 18.5/ 26.2/ 18.8) 21 Is split (surprisingly, amazingly) slow?
39.3 ( 7.3/ 31.3/ 21.5) 10 sendmail doesn't work
34.1 ( 13.9/ 19.6/ 12.9) 15 Perl, Y2K, and idiots
31.3 ( 12.6/ 17.0/ 12.9) 14 know Perl to maintain Perl (was: Re: I pass an array...)
28.0 ( 14.6/ 12.1/ 5.6) 17 Copying any files
27.0 ( 10.4/ 15.4/ 7.4) 12 mail problems... still :)
26.5 ( 12.0/ 12.4/ 6.8) 14 Simple newbie question...
These threads accounted for 16.4% of the total volume.
Top 10 Threads by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.978 ( 56.4/ 57.6) 7 Opening a remote file?
0.970 ( 8.3/ 8.5) 5 replacing a word in a flat file
0.885 ( 7.0/ 7.9) 7 \n doesn't work on NT4 SP4
0.848 ( 5.8/ 6.9) 5 Concatenating variable names
0.846 ( 2.9/ 3.5) 6 formatting number output
0.837 ( 3.6/ 4.3) 5 Does $' return the previous regexp's $' ?
0.819 ( 5.1/ 6.2) 5 Executing adduser? Follow Up.
0.811 ( 7.4/ 9.2) 6 Struggling with FORMAMAIL.PL
0.809 ( 3.9/ 4.8) 5 How to list all installed modules
0.807 ( 7.1/ 8.8) 5 Bulk E-Mailing
Bottom 10 Threads by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.478 ( 7.4 / 15.4) 12 mail problems... still :)
0.464 ( 5.6 / 12.1) 17 Copying any files
0.460 ( 5.2 / 11.2) 11 Time Error
0.453 ( 1.7 / 3.7) 5 Problem copying file
0.452 ( 2.4 / 5.2) 8 GD, PPM, XML: Parser
0.448 ( 2.9 / 6.4) 6 HELP: Regular Expressions
0.426 ( 7.2 / 16.8) 7 Perl "constructors"
0.411 ( 1.9 / 4.7) 6 Making Perl Wait
0.384 ( 1.6 / 4.1) 6 CGI Scripting to a database
0.381 ( 1.7 / 4.3) 5 Help! Perl "typo" error
96 threads (19%) had at least five posts.
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
29 comp.lang.perl.modules
23 comp.software.year-2000
13 sci.crypt
10 comp.lang.perl
9 comp.lang.java.programmer
9 comp.lang.javascript
8 comp.lang.tcl
8 comp.os.linux.networking
8 comp.os.linux.advocacy
8 comp.os.linux.hardware
Top 10 Crossposters
===================
Articles Address
-------- -------
18 "Kent Dahl" <MenThal@bigfoot.com>
11 "John" <John_B52hotmail.com> (at)
9 fvw@chello.nl (Frank v Waveren)
9 "Dan Hinojosa" <dawndan@gateway.net>
9 "Jay" <IMNOT@ZHOMEZ.COM>
9 don'tbother@nospam.net
9 joh@gmx.net (Jochem Huhmann)
6 Tom Phoenix <rootbeer@redcat.com>
5 Jonathan Stowe <gellyfish@gellyfish.com>
5 NukeEmUp@ThePentagon.com (David Cantrell)
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5911
**************************************