[12328] in Perl-Users-Digest
Perl-Users Digest, Issue: 5928 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 9 06:07:18 1999
Date: Wed, 9 Jun 99 03:00:20 -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 Wed, 9 Jun 1999 Volume: 8 Number: 5928
Today's topics:
Apache Authenticate and CGI <chinaseeb@unocal.com>
Re: Binary File Uploading <dfs@thegrid.net>
Re: Brackets and comparisons <outlaw_torn@mailexcite.com>
C++ APIs for PERL <partha@mihy.mot.com>
E-mailing with perl is driving me crazy! <lgcl01@es.co.nz>
Re: E-mailing with perl is driving me crazy! (Arnaud Limbourg)
Re: E-mailing with perl is driving me crazy! (Arnaud Limbourg)
Getting HTTP Error 405 <chess@mocom.net>
Re: Getting HTTP Error 405 <eyounes@aol.com>
Re: how can i do this? <vincent_vanbiervliet@be.ibm.com>
Intersection of several lists (Thomas Weholt)
Net::FTP and IP-adress <hal9000@fetchmail.com>
Re: Newbie int() question (Larry Rosler)
Re: Perl "constructors" armchair@my-deja.com
Re: Perl "constructors" armchair@my-deja.com
Re: Perl "constructors" armchair@my-deja.com
Problems sorting. I'm stupid and I'll die (Stuart Wright)
size of a subdirectory without readdir? (William Herrera)
Substitution with functions <Herve.Foucher___NO_SPAM@helio.org>
Re: Substitution with functions (Andrew Johnson)
Using CGI.pm <streaking_pyro@my-deja.com>
waiting... <outlaw_torn@mailexcite.com>
Re: waiting... <fruffet@kaptech.com>
Why does $blabla = <STDIN> not work in VMS Perl 5? <sterk@ebi.ac.uk>
Writing a program to control the CD-ROM in U*IX? <streaking_pyro@my-deja.com>
Re: XS: newSVpv() and malloc (Ilya Zakharevich)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 9 Jun 1999 08:55:18 GMT
From: "Chinasee B." <chinaseeb@unocal.com>
Subject: Apache Authenticate and CGI
Message-Id: <01beb254$c9ce73a0$49d0f886@chinaseeb.bkk.unocal.com>
I use authentication on Apache to protect my webpage.
How can I use cgi to check username when user login
I wan to write cgi for user to change password and profile.
anyone who experinced this would you please supply me a example source
OS-FreeBSD3.1
Perl-5.005_02
Apache1.3.4
thank in advance
CHB
------------------------------
Date: Wed, 09 Jun 1999 08:16:53 GMT
From: "Ryan" <dfs@thegrid.net>
Subject: Re: Binary File Uploading
Message-Id: <01beb251$467aca60$d032a2d1@ryano-ke>
Thanks,
I realize this was a stupid post since I did not provide much information.
I think I have it fixed now.
Take care,
Ryan
Alastair <alastair@calliope.demon.co.uk> wrote in article
<slrn7lr8cn.5g.alastair@calliope.demon.co.uk>...
> Capt. Ry <dfs@thegrid.net> wrote:
> >
> >Hello Group,
> >
> >I am trying to create a binary upload script using CGI.pm I have tried
to
> >follow the doc files for CGI.pm but I am running into a 500 internal
error.
> >My uploaded file is created on my server, but no information is read
into
> >it. So I get a file name with 0 kb ??
>
> I'd want to see the server error log!
>
> HTH.
>
> --
>
> Alastair
> work : alastair@psoft.co.uk
> home : alastair@calliope.demon.co.uk
>
------------------------------
Date: Wed, 09 Jun 1999 06:09:59 GMT
From: outlaw_torn <outlaw_torn@mailexcite.com>
Subject: Re: Brackets and comparisons
Message-Id: <7jl0fj$ast$1@nnrp1.deja.com>
Thanks all for your replies.
I figured out the prob as soon as I got back to my desk and looked at
the code again. I actually posted the correction to my own problem
without noticing.Twas one of those silly errors you make when your
day-dreaming about a hot tub, a jar or cream, etc.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 09 Jun 1999 12:35:41 +0530
From: Ramanujam Parthasarathi <partha@mihy.mot.com>
To: fox@vulpes.com
Subject: C++ APIs for PERL
Message-Id: <375E1245.BA6FBEDC@mihy.mot.com>
Hi,
I found a module "perl-c++-api.0.0_3" which gives a C++ API to PERL
which is interesting. I see that it was last updated in 1997.
Is it that the development on this module has stopped? Or can somebody
give me the location from where I can download the latest?
Are there any similar APIs available?
(Mr. Fox, if I have reached you, can you please help me out........)
Thanks & Regards,
Partha
------------------------------
Date: Wed, 9 Jun 1999 21:06:28 +1200
From: "Christopher Fairbairn" <lgcl01@es.co.nz>
Subject: E-mailing with perl is driving me crazy!
Message-Id: <928919148.152293@inv.ihug.co.nz>
Hi,
I have a small question.
Why does the following peice of perl code fail:
#!/usr/local/bin/perl
open(MAIL,"|/usr/lib/sendmail lgcl01\@ihug.co.nz");
print MAIL "Subject: This is a subject line\n\n";
print MAIL "This is an empty body.\n";
close(MAIL);
open(MAIL,"|/usr/lib/sendmail lgcl01\@es.co.nz");
print MAIL "Subject: This is a subject line\n\n";
print MAIL "This is an empty body.\n";
close(MAIL);
It looks fine to me and both of those email accounts work properly. The
problem is that with this program there is never ever any email sent to
lgcl01@ihug.co.nz
Why is it that if I send an email with this simple perl / sendmail I get it
if I send it to lgcl01@es.co.nz but not if the perl / sendmail program
thinks it is being sent to lgcl01@ihug.co.nz ?
I'm stumped :-)
I've tried lots of things. I have a third email account which is
christopher@computer4u.com and this simple perl script won't send an email
to this account either.
What have I done wrong? It must be simple as the script couldn't get much
simpler could it?
Thanks,
Christopher Fairbairn.
------------------------------
Date: Wed, 09 Jun 1999 09:30:26 GMT
From: haytounet@my-dejanews.com (Arnaud Limbourg)
Subject: Re: E-mailing with perl is driving me crazy!
Message-Id: <375e33fe.95900331@news.bull.fr>
>Why does the following peice of perl code fail:
You should have a look at scripts that do what you want and check how
they do it.
------------------------------
Date: Wed, 09 Jun 1999 09:36:13 GMT
From: haytounet@my-dejanews.com (Arnaud Limbourg)
Subject: Re: E-mailing with perl is driving me crazy!
Message-Id: <375e3519.96183254@news.bull.fr>
>Why does the following peice of perl code fail:
oops, pressed the enter key too early!
I'm starting in Perl, but i think you must use a module like use
Net::SMTP or mail::send.
It is also possible to use unix sendmail or the equivalent for NT
(like wsendmail or mailto).
Hope this helps
------------------------------
Date: Wed, 9 Jun 1999 01:20:44 -0500
From: "Tiny Troll" <chess@mocom.net>
Subject: Getting HTTP Error 405
Message-Id: <XCn73.433$JL3.21381@typ42b.nn.bcandid.com>
I'm relatively new to perl and figure that this has a rather simple
resolution, but *I* don't know what it is! ;-) Any help would be very
appreciated.
I am running Perl 5.005 (that I got from ActiveState) on a WinNT server 4.0
running IIS 4.0.
I am just trying to get some simple script communication running to verify
that all is well. I want one perl script to pass form input to a second perl
script, which I then want to create a dynamic html page.
I have a simple hyperlink that creates the html form using perl. This first
step works fine. The problem arises in attempting to get the form input into
the second script.
Below is the perl script and the error that results once I select an item on
the form and submit it.
My thanks in advance!
Erik
=======================
<!--
use strict;
use CGI qw(:standard);
-->
<!-- print <<START_html;
Content-type: text/html -->
<HTML>
<HEAD><TITLE>Test HTML</TITLE>
</HEAD>
<BODY>
<CENTER>
<H1>Test HTML</H1>
<P>
You scream, I scream, we all scream for ice cream!
<BR><FONT SIZE="6">Select your favorite...</FONT>
<P>
<FORM METHOD="POST" ACTION="http://www.myurlremoved.net/cgi-bin/ic2.pl">
<TABLE>
<TR><TD>
<BR><INPUT TYPE="RADIO" NAME="ice" VALUE="mint" CHECKED> <FONT
COLOR="00FF00">Mint</FONT>
<BR><INPUT TYPE="RADIO" NAME="ice" VALUE="choc"> <FONT
COLOR="333300">Chocolate</FONT>
<BR><INPUT TYPE="RADIO" NAME="ice" VALUE="pbutter"> <FONT
COLOR="AAAA00">Peanut Butter</FONT>
<BR><INPUT TYPE="RADIO" NAME="ice" VALUE="fur"> <FONT COLOR="000000">Furball
Delight</FONT>
</TD></TR>
</TABLE>
<P>
<INPUT TYPE="RESET" VALUE="Clear form and start over">
<INPUT TYPE="SUBMIT" VALUE="Enter now!">
</FORM>
<!-- print <<END_html;
Content-type: text/html -->
</CENTER>
</BODY>
</HTML>
<!-- END_html -->
=========================
HTTP Error 405
405 Method Not Allowed
The method specified in the Request Line is not allowed for the resource
identified by the request. Please ensure that you have the proper MIME type
set up for the resource you are requesting.
------------------------------
Date: Wed, 9 Jun 1999 10:07:15 +0200
From: "Ysteric's" <eyounes@aol.com>
Subject: Re: Getting HTTP Error 405
Message-Id: <7jl6s8$pf4@news.vtcom.fr>
You're a luky man ! I've fixed this problem on my machine last week ...
start your Internet Service Manager
then open your "Default Web Site (or other)"/Properties dialog box and
choose the 'home directory' part. Click on the "configuration" button,
you'll have a new dialog box. Choose the "App Mapping" part and click on the
"Add" button. Then add ".pl" / "c`:\Perl\bin\Perl %s %s".
close everything. Stop and Start the web server. It must be run.
...sorry for my english ... i'm french
Eric from PARIS
------------------------------
Date: Tue, 8 Jun 1999 15:59:04 +0200
From: "Vincent Vanbiervliet" <vincent_vanbiervliet@be.ibm.com>
Subject: Re: how can i do this?
Message-Id: <375e16cd@news.uk.ibm.net>
<smnayeem@my-deja.com> wrote in message news:7jiioq$f52$1@nnrp1.deja.com...
> I cant work out how to access each element of an array of array using
> two for loops.
> heres my code :
> 1 my $header = [[a,b,c],[d,e,f],[g,h,i],[j,k,l]];
If you would use the -w switch when running perl, you would have noticed
that your first line was wrong. You have to use quotes.
my $header=[ ['a','b','c'], ['d','e','f'],['g','h','i'],['j','k','l'] ];
> 2 for ($i = 0;$i <= $#$header; $i++) {
There is an easier way to use for loops (at least, I like to think of them
as easier):
for $i (0 .. $#$header) { #at least it's shorter, and you don't have to
worry about using < or <=...
> 3 for ($j = 0;$j <= $#[$header->[$i]];$j++) {
Same remark here. And if you would have been running -w, you would have seen
that this line was wrong, as you suggest later.
You should use $#{$header->[$i]}. I don't know where you get the '['s from.
The book, and I guess the online docs only use '{'.
So:
for $j (0 .. $#{$header->[$i]}) {
> 4 print ($header->[$i][$j],"\t");
or put it in one statement:
print "$header->[$i][$j]\t";
> 5 }
> 6 print "\n";
> 7 }
> (please remove the line numbers)
>
> when i run it it shows :
> a
> d
> g
> j
>
Not to me. It shows some errors. But that's because I use perl -w... You
should too. Really.
> so as it looks, the problem is in line 3 where i used $#[$header->[$i]]
Correct.
> for getting the count of the array. I also tried $#$header->[$i] but
As written before: $#{$header->[$i]}
> that doesnt work either, can someone shed some lights here pls.
>
> any help would be greatly appreciated.
>
> thanks.
>
> smnayeem
> smnayeem@agni.com
>
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
Vincent
------------------------------
Date: Tue, 08 Jun 1999 16:58:38 GMT
From: u970130@studbo.hit.no (Thomas Weholt)
Subject: Intersection of several lists
Message-Id: <375d4b51.9175871@news1.c2i.net>
Hi,
I got several ( 3 - 15) lists that I need to put into one, containing
only the items that are in all the lists ( intersection ).
Please help a newbie!! ;->
------------------------------
Date: Wed, 09 Jun 1999 11:00:51 +0200
From: hal9000 <hal9000@fetchmail.com>
Subject: Net::FTP and IP-adress
Message-Id: <375E2D43.1B512B47@fetchmail.com>
I have a working script (perl 5.00503), using Net::FTP, that
contains the line:
$ftp = Net::FTP->new($host);
This is OK if $host is a hostname, but if I set
$host = '10.20.30.40';
I get the error-message 'Unknown error'. I have tried:
$host = '[10.20.30.40]';
It will not work either. Error message 'Bad hostname'...
How can I make the script connect to an IP-adress?
TIA
--
~hal9000
------------------------------
Date: Tue, 8 Jun 1999 22:23:06 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Newbie int() question
Message-Id: <MPG.11c79a014bb72240989b9d@nntp.hpl.hp.com>
In article <fred222-ya023580000806992311010001@news.bellatlantic.net> on
Wed, 09 Jun 1999 03:13:19 GMT, George <fred222@mauimail.com> says...
> I'd appreciate some help on how to use int(). I seem to recall that this
> function takes a number and rounds it to the nearest integer, but when I
> write int($whatever), $whatever does not change and Perl complains that int
> is used in void context.
Perl has wonderful documentation on your very own machine, which you
should learn how to use. There is no need to 'recall' what a function
does. Here is what the command
perldoc -f int
says:
int EXPR
int
Returns the integer portion of EXPR. If EXPR is omitted, uses $_.
You should not use this function for rounding...
Note that this function doesn't change its argument, which would be
rude. It returns a value.
> I'm afraid I am rather a newbie to Perl and Linux; I would greatly
> appreciate any help which anyone could afford me. If any replies could be
> cross-emailed to me at the following address without the NOSPAM, I would
> greatly appreciate it:
>
> yurtle@bellatlantic.netNOSPAM
If you had posted the address without the NOSPAM, I would have been
happy to email you a reply. Don't cave in to the spammers. Beat them!
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 09 Jun 1999 08:16:00 GMT
From: armchair@my-deja.com
Subject: Re: Perl "constructors"
Message-Id: <7jl7rs$ds7$1@nnrp1.deja.com>
In article <7jjmn6$s8a$1@nnrp1.deja.com>,
John Porter <jdporter@min.net> wrote:
> In article <7jikn4$flv$1@nnrp1.deja.com>,
> armchair@my-deja.com wrote:
> > In article <7jggjn$n81$1@nnrp1.deja.com>,
> > John Porter <jdporter@min.net> wrote:
> > > 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.
> >
> > If it ain't the same or equivalent, it ain't gonna help
> > your case, or
> > the posters.
>
> Perhaps; but fortunately for the posters, they're equivalent, even
> though they're not the same. Thanks for including that qualification;
> that met my needs nicely.
Equivalent say ye? Well, go ahead and post an assembler while, for, and
if/else statement for assembler, and I will follow up with the C++
version, and we can take a close look for any equivalence that may
exist.
> > > And you're making a mistake to be lumping C/C++ with Perl.
> >
> > Did you forget to add "in a Perl newsgroup" to the above sentence?
>
> No, I intentially omitted that, because it's true regardless of
> newsgroup.
I will believe it to be true when I see your theorem that does so.
Please provide it.
>
> > > > 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.
> >
> > I see. Would you be so kind as to give me the Asm eqivalent to
> > printf("The number of trucks was %d all of the color %s\n",
> > numTrucks, color);
>
> It depends on the assembler, of course, and the available libraries,
> not to mention the platform. But on unix, one could easily code
> something like this (forgive the pseudocode; it's been years):
>
> push color
> push numTrucks
> push "The ... %d ... %s\n"
> call printf
So you've proven that assembler is not on the same level as C++, or even
C. Thanks.
>
> That's what C's doing under the hood, after all.
> If I can do it in C, I can do it in asm.
But you didn't do it in asm. You needed 4 statements to simulate one,
and even that disparity was minimized because example did not involve
capturing a return code or passing by reference.
>
> > as well as:
> > int returnCode = read(data,int,10,myFilePtr);
>
> push MyFilePtr
> push 10
> push int ; although that's a reserved word in C
> push data
> call read
> pop returnCode
>
> If I can do it in C, I can do it in asm.
Again you have proven Assembler to not be the equivalent of C. 6
statments to try and simulate one. I give you credit for being
big enough to disprove you own case.
> > > 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).
> >
> > To anyone with a clue, C is much easier to use than assembly,
>
> Well no duh! You think I'm advocating the use of asm?!?
You are calling them equivalent buckeroo. That's saying that using one
is just as good as using the other. If not, do give your own definition
of equivalent.
>
> > much higher level,
>
> Only for certain non-standard definitions of "higher level".
I see. At one instantd you are - "duh! not advocating assembler" and on
the next instance they are at the same level. You will need to explain
that incongruity, if there is a way.
>
> > and not "merely a portable assembler".
>
> C comes with a great, well-defined standard library.
> And excellent development environments abound for this language.
> As for the language itself, and its design philosophy,
> it is merely a portable assembler.
I see. At one instantd you are - "duh! not advocating assembler" and on
the next instance one is just a portable version of the other. You will
need to explain that incongruity, if there is a way.
>
> > > C++ is a little different. A lot of complex
> > > baggage was added. Not that I'm complaining...
> >
> > Complex baggage like a string? Like iostream? Like classes? Not
> > complex at all (to anyone with a clue, at least).
>
> People with a clue as to the difference between C and C++ know that
> C++ is frought with lots of very complex stuff. Call me clueless
> if it makes you feel smarter; but while you're doing that, why
> don't you also go read the ARM for once, and see what really
> clueful people have to say about it.
I see, you can see that you can dish out the "clueful commentary", but
not take it. And you ducked the question. Is a string complex? Is an
iostream? Is a class construct complex? Were they implemented in complex
ways? Can you clue me in? Or are you just swinging wildly?
>
> > > > 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.
> >
> > Well, my my, in one breath we get "C is just a portable assembler
> > (anyone can see the mapping who has a clue)" , and in the
> > next we get
> > "It is a lot more work to use". Perhaps you can work on those a bit.
>
> If you insist.
>
> First, allow me to point out that those two things were not in the
> same breath, and were not about the same language. The first was
> about C, the other was about C++.
Oh, I see, C is just a portable assembler, worth very little, but
something was salvaged from the effort by having it be the basis of C++.
Regarding this "portable assembler concept, would you be so kind as to
give the assembly equivalent of the following C code:
int i = 0;
for ( ; i < 10; i++ )
{
int j;
for ( ; j < 50; j++ )
{
printf ("i/j %d %d\n",i,j);
}
}
>
> C is portable assembler; the mapping of C constructs to the
> equivalent assembly (which is after, essentially what the C compiler
> generates, usually skipping the asm stage) is very close, though of
> course C is more concise.
You've already demonstrated that C is not portable assembler twice, and
I would like to give you another chance:
Please give the assembler equivalent to the following code.
int a = read(data,sizeof(int),4,file);
while (a != 0)
{
for ( int i = 0; i < 4; i++ )
printf("the integer value is %d\n",data[i]);
}
That's six lines, and I have put braces on lines by themselves. Let's
see if you can do it 6 lines in assembler, which should be quite easy,
albeit not as portable, eh?
>
> C++ semantics are much more complex, and the compiler has to do a lot
> more work to generate executable code from your source. Not only
> that, but it also generates a substantial amount of code which the
> semantics require at run time. Whereas hand-translating C into asm
> is basically just tedious, translating C++ into asm would be an
> excercise in frustration and futility.
Since we are not discussing compiler design, but language syntax, the
above comments are irrelevant. As they say - Red Herring.
>
> And I think, if this discussion is to continue, it should be taken
> to another newsgroup.
let me guess: comp.lang.portable-assembly/c
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 09 Jun 1999 08:47:07 GMT
From: armchair@my-deja.com
Subject: Re: Perl "constructors"
Message-Id: <7jl9m9$ec9$1@nnrp1.deja.com>
In article <7jjl5o$rkg$1@nnrp1.deja.com>,
John Porter <jdporter@min.net> wrote:
> In article <7jijvk$fep$1@nnrp1.deja.com>,
> armchair@my-deja.com wrote:
>
> > > On Sat, 05 Jun 1999 07:46:02 GMT, armchair@my-deja.com said:
> > >
> > > >can you do this in Assembly?:
> >
> > Not in 4 lines...
>
> The question was "can you do this in assembly",
> not "can you do this in assembly in 4 lines".
There was an implied "in 4 lines like this example" in the question. I'm
sorry if it wasn't obvious.
>
> I don't think there's *anything* you can do in only 4 lines
> of assembly! :-)
And yet your persist in calling C, merely "portable assembly".
>
> The issue was not whether the languages are "equal", but really
> whether they're Turing-equivalent; and they are, of course.
No, the issue was whether they were equal, or equivalent. I don't know
what Turing-equivalent is, but I believe you have finally admitted that
assembly is not equal or equivalent to C.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 09 Jun 1999 08:42:15 GMT
From: armchair@my-deja.com
Subject: Re: Perl "constructors"
Message-Id: <7jl9d5$e9k$1@nnrp1.deja.com>
In article <7jjnr3$sn3$1@nnrp1.deja.com>,
John Porter <jdporter@min.net> wrote:
> In article <7jilf3$fr5$1@nnrp1.deja.com>,
> armchair@my-deja.com wrote:
> > In article <7jgfum$n16$1@nnrp1.deja.com>,
> > John Porter <jdporter@min.net> wrote:
> > > In article <7il6ge$ruq$1@nnrp1.deja.com>,
> > > armchair@my-deja.com wrote:
> > > > Since the looping and decision constructs of Perl are the same
as
> C
> > >
> > > Superficially.
> >
> > Do elaborate on what you see as the major difference.
>
> I'll refer you to the standard Perl documentation.
> If you're the C/C++ guru you make yourself out to be,
> the differences should become apparent as you read the Perl
> documentation.
Hmmmm, I am tempted to believe that a charge of "making one's self out
to be a guru", just might be a complement in this forum. If so, thanks a
million! What pages of the standard Perl documentation, in your opinion,
best demonstrate it's higher level language status versus C++?
>
> > > > C++, and since C++ now has a string class,
> > >
> > > Having a string class makes C++ a HLL? ROFL again.
> >
> > Do elaborate on what makes a language a HLL
>
> The common, conventional definition is good enough for me.
> Try AltaVista if you need more info.
And what would I query on "John and Porter and definition and high and
level and language"?
>
> > > > perhaps it is the dynamic
> > > > arrays and dynamic hashes that have you ROFL.
> > >
> > > Not.
> >
> > I guess that would leave the <> operator. Not much to stand on my
> > friend.
>
> That's o.k., I'm not standing anyway, I'm rolling on the floor.
Fleas?
>
> > > 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?
> >
> > Above you said that dynamic hashes and arrays were, to
> > quote you - Not - the reason that Perl was in your opinion, a high
> > level language.
>
> No, I said they were not the reason I was ROFL.
Then it is fleas.
>
> > And Vector and Map are not just something
> > one can create in C++, they have been created, standardized,
> > and ship
> > with compilers.
>
> That doesn't make them part of the language, any more than
> printf is a part of the C language. (I know many C fanatics
> will argue that they ARE part of the language, because they're
> required by the standard.) Saying the Vector class is a part
> of the C++ language is like saying the CGI.pm module is part
> of the Perl language. Absurd.
And if I speak of datatyping am I not referred to fields.pm, or to
another module for function overloading, and to a third for operator
overloading? That would mean that Perl does not have function
overloading (a very nice feature encouraging adding to code without
disturbing existing code and giving a lot of flexibility) nor operator
overloading (can make working with lowlevel objects like DateTime's or
String very intuitive), or variable data typing (an obvious benefit in
wringing out mistakes at compile time). Is it me or does Perl seem to be
getting lower level?
>
> > And do give me your source code for creating dynamic
> > hashes and arrays in Assembler, or were you sick the day they
> > supposedly talked about that in class?
>
> I'll send you my rate card. I would not relish that task; but
> at least I admit that it's possible.
It's possible to paint the Golden Gate Bridge with a nail polish brush.
It's another thing to talk about doing so. And yet you did so. Go
figure.
>
> > And do you have
> > any defense of Perl as a higher level language versus C++ not
> > being one
> > that doesn't involve the red herring of dragging in Assembly?
>
> Everything I've said about Perl being a HLL is still relevant,
> even if you only take in the context of comparison to C++.
But you haven't made a case for Perl being a higher level language by
discussing features. On the contrary, you have made hand waving
statements like "go read the ARM" or "go make an AltaVista query" or
"I'll refer you to standard Perl documentation" along with trying to
downgrade C++ by claiming that you can do the same in Assembly, and
trying to downgrade C by calling it merely a portable version of
assembly language.
>
> > It's odd
> > that you can't just point out what is in Perl but not in C++
>
> No? I believe I've done that, though admittedly not in much depth.
If the Atlantic Ocean had that kind of depth and substance I would
backpack over to England.
>
> > (and we
> > haven't even got into what is in C++ but not in Perl).
>
> (I'm not particularly interested. C++ is great in its own way;
> and if I were forced to use it, I would complain only mildly.)
No doubt because your Perl shrine would remain undisturbed in your
garage. (I must admit I thought the paper mache statue of Larry Wall on
a camel was very impressive).
>
> > > 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?
>
> > Before I can answer your question on GC, you will have to
> > tell me what
> > you are using GC as an abbreviation for.
>
> Garbage Collection.
> Not that a C/C++ programmer would know what that was about.
>
With pre-canned objects, C++ programmers are starting to forget what
memory allocation is about.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 09 Jun 1999 09:07:16 GMT
From: stuw@dial.pipex.com.remove.everything.after.com (Stuart Wright)
Subject: Problems sorting. I'm stupid and I'll die
Message-Id: <375e2d3a.4121716@news.demon.co.uk>
I have some script which I copied from a resource somewhere and it doesn't
work because the version of Perl on my host's server doesn't like the '->'
syntax.
I have an array @record which contains about 500 records, each made up of
$manufacturer,$model,$rating,$date
I need to do a case insensitive sort by $rating.
I have read the Perl documentation and I simply don't understand it. I'm
sorry - I'm stupid and I'll die.
In the brief spell before I expire, could someone please give me the script
to sort my array?
like @records = (sort {uc($rating{a}) cmp uc($rating{b})} @records) type
stuff. Nice and simple.
I'd love to get this script to work so I can go back to killing my brain
with beer. Many thanks in advance.
--
Stuart Wright stu-w@usa.net.remove.everything.after.net
Software Developer,
Web author for the Hi-Fi and Home Cinema Industries,
MIDI sequencer, Drummer and Motorcyclist.
Visit my web site http://ds.dial.pipex.com/town/road/xmk67/
------------------------------
Date: Wed, 09 Jun 1999 07:20:58 GMT
From: posting.account@lynxview.com (William Herrera)
Subject: size of a subdirectory without readdir?
Message-Id: <375e152f.3156645@news.rmi.net>
I have to read a directory from time to time that may contain 300 to
2000 entries. opendir/readdir just to count the entries (archiving
when they are above a certain number like 500) can be slow.
Is there a better/faster way in Perl to count how many files are in a
subdirectory?
---
The above from: address is spamblocked. Use wherrera (at) lynxview (dot) com for the reply address.
------------------------------
Date: Wed, 09 Jun 1999 07:13:43 GMT
From: Herve Foucher <Herve.Foucher___NO_SPAM@helio.org>
Subject: Substitution with functions
Message-Id: <7jl473$brk$1@nnrp1.deja.com>
Hi!
I would like to substitute a model by a function of this model.
For example:
$a_string =~ s/\#\#[^\#.]*\#/&MyPerlFunction($&)/g;
This looks recursively for ##something# in $a_string but:
<< Hello I am ##happy# to receive some ##news# >>
becomes:
<< Hello I am &MyPerlFunction(##happy#) to receive some
&MyPerlFunction(##news#) >>
Would you know how to force the substitution to JUMP into
my function to produce this:
<< Hello I am yppah to receive some swen >>
Thanks!
----------------------------------------------------------------------
Herve FOUCHER
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 09 Jun 1999 08:51:35 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: Substitution with functions
Message-Id: <rWp73.3642$WL.87404@news2.rdc1.on.home.com>
In article <7jl473$brk$1@nnrp1.deja.com>,
Herve Foucher <Herve.Foucher___NO_SPAM@helio.org> wrote:
! Hi!
!
! I would like to substitute a model by a function of this model.
! For example:
!
! $a_string =~ s/\#\#[^\#.]*\#/&MyPerlFunction($&)/g;
Perhaps you want to use the /e modifier on that
regex (and maybe capture the part you are interested in
changing):
s/\#\#([^\#.]*)\#/reverse $1/eg;
regards
andrew
--
The generation of random numbers is too
important to be left to chance.
------------------------------
Date: Wed, 09 Jun 1999 05:13:20 GMT
From: R.Joseph <streaking_pyro@my-deja.com>
Subject: Using CGI.pm
Message-Id: <7jkt5a$a0k$1@nnrp1.deja.com>
I have been writing CGI for a couple of months, and the instructor in
my class always used CGI-LIB.pl by Steven Brenner. However, I keep
hearing more and more about this CGI.pm module. Is there someone who
can explain it's differences from CGI-LIB.pl and if it is better than
CGI-LIB.pl or not? Any help is much appreciated. Thanks.
--
R.Joseph
http://www.24-7design.com
http://bowdown.to
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 09 Jun 1999 05:58:25 GMT
From: outlaw_torn <outlaw_torn@mailexcite.com>
Subject: waiting...
Message-Id: <7jkvpu$ao9$1@nnrp1.deja.com>
Hi all
Just wanting some advice. I'm trying to figure out the best way to call
another program, wait for that program for a while and then kill it off
if it doesn't finish after a certain amount of time. I have thought of
a way and I was wondering if anyone can recommend a
"better" solution.
Firstly i'd do a system call with an &. The parse some ps gibberish to
get the pid, check to see when the pid terminates (more ps parsing) and
then go on. If it don't terminate after a while, kill it and go on.
Thats basically it, any suggestions.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 9 Jun 1999 09:53:19 +0200
From: "Fred Ruffet" <fruffet@kaptech.com>
Subject: Re: waiting...
Message-Id: <7jl6hr$qtk$1@gatekeeper.ornano.kapt.com>
Euh ?!? it was a good idea, but, maybe, you don't use the good things...
to launch the program, you'd better make a fork, then the son execs the code
you want, the father waits (with sleep) a while and then kill is son (no
matter if he's still alive or not).
Regards,
Fred
------------------------------
Date: Wed, 09 Jun 1999 09:18:04 +0100
From: Peter Sterk <sterk@ebi.ac.uk>
Subject: Why does $blabla = <STDIN> not work in VMS Perl 5?
Message-Id: <375E233C.1757F6C1@ebi.ac.uk>
Hi,
I was surprised that the following simple script which works on all sort
of OS's doesn't work under VMS Perl 5.003_24 (the first two and the last
line are necessary to run perl scripts on VMS):
------------------------------
$ perl -x
$ deck/dollar="_END_"
#! /usr/bin/perl -w
print "What's your name? \n";
chop($my_name = <STDIN>);
print "My name is $my_name\n";
_END_
------------------------------
When this script is run, it does not pause for input from the terminal?
Couldn't find any explanation in any FAQ or VMS Perl document. Anyone
with a suggestion (other than 'don't bother with VMS')?
Thanks in advance for your help,
:Peter
------------------------------
Date: Wed, 09 Jun 1999 05:22:41 GMT
From: R.Joseph <streaking_pyro@my-deja.com>
Subject: Writing a program to control the CD-ROM in U*IX?
Message-Id: <7jktmq$a5q$1@nnrp1.deja.com>
I know that Perl includes the standard ioctl(2) function, and I was
wondering if anyone knew how I would go about using ioctl to
control '/dev/cdrom' (the CD-ROM) device in Linux. All I really want
to do is open and close and start the motor. Any help is appreciated.
Thanks.
--
R.Joseph
http://www.24-7design.com
http://bowdown.to
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 9 Jun 1999 06:05:50 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: XS: newSVpv() and malloc
Message-Id: <7jl07u$7oi$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Dan Sugalski
<sugalskd@netserve.ous.edu>],
who wrote in article <7jk4d6$9bt$1@news.NERO.NET>:
> : Another XS clarification: when using the newSVpv(char *, int)
> : function, it creates a *copy* of the string you've passed in, not the
> : original, correct? Since I have a library that malloc()'s strings for
> : me to examine, once passed into newSVpv() it should be safe to free()
> : that string, yes?
>
> Yep. All the functions that set an SV's value make copies of the
> data you pass.
Nope. There are .*use.* functions which make a copy. They may
realloc() things though so that they can put a '\0' at the end, so a
reasonable malloc() will help.
Ilya
------------------------------
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 5928
**************************************