[12403] in Perl-Users-Digest
Perl-Users Digest, Issue: 6003 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 15 13:07:16 1999
Date: Tue, 15 Jun 99 10:00:22 -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 Tue, 15 Jun 1999 Volume: 8 Number: 6003
Today's topics:
Re: Afraid to ask about Y2K! (Jerome O'Neil)
Re: Backtits and tainting (Hasanuddin Tamir)
Re: Child processes, "Please wait" pages (Randal L. Schwartz)
Re: CPAN process still running???? <gellyfish@gellyfish.com>
Re: Creating an external config file. How ? (Hasanuddin Tamir)
Re: Environment variables. (Jerome O'Neil)
Re: Environment variables. (Bart Lateur)
Events in CGI/Perl <technology@workmail.com>
Re: examples <cassell@mail.cor.epa.gov>
Re: File Processing <gellyfish@gellyfish.com>
Re: File Uploading (Abigail)
Re: Fix this uglyness <aqumsieh@matrox.com>
Re: Help with uploads <cassell@mail.cor.epa.gov>
Re: how do i make a Multi Dimensional array? <simon@profero.com>
Re: How do I trim a string? <gbartels@xli.com>
I dont understand system calls <Mark.Conlin@bridge.bellsouth.com>
Re: I dont understand system calls <Mark.Conlin@bridge.bellsouth.com>
IO::Socket, Socket <SternSZ@gmx.de>
Re: Netscape problem (Abigail)
Re: Newbie wants to know: How would you do this? (Abigail)
Re: parse a string in triplet ? (Larry Rosler)
Re: parse a string in triplet ? <garethr@cre.canon.co.uk>
Re: Perl "constructors" <jdporter@min.net>
Re: Perl "constructors" <jdporter@min.net>
Re: Perl Compiler (Abigail)
Re: Regex question (Abigail)
Re: taint checking setuid error message <cassell@mail.cor.epa.gov>
Re: user IP (Hasanuddin Tamir)
Re: user IP (Abigail)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 15 Jun 1999 15:49:18 GMT
From: jeromeo@atrieva.com (Jerome O'Neil)
Subject: Re: Afraid to ask about Y2K!
Message-Id: <7k5slu$66d$1@brokaw.wa.com>
In article <7k5njd$nbp$1@nnrp1.deja.com>,
finsol@ts.co.nz writes:
> I would also like to thankyou for your very comprehensive an exhaustive
> instructions on how to perform a Y2K audit on Perl code. Unfortunately
> it seems that you have very limited experience of the real world -
> perhaps you are an academic? Few, if any, IT departments have the
> luxury of a team of competent programmers assigned to task of
> application familiarisation, regular meetings to discuss strategy,
> findings, documentation etc. etc. Get real!
You are a fraud. For your blatant ignorance, complete incompetence,
and painful arrogance...
<*plonk*>
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: 16 Jun 1999 06:45:25 GMT
From: hasant@trabas.co.id (Hasanuddin Tamir)
Subject: Re: Backtits and tainting
Message-Id: <slrn7mcvef.gbl.hasant@borg.intern.trabas.co.id>
On Tue, 15 Jun 1999 11:53:28 +0200, Peter Staab <staab@linopress.com> wrote:
> Hello
>
> Ist it possible to disable the tainting.
Don't do that!
> I want to to something like
>
> $out = ` $com`;
>
> and $com is delivered from a file.
> For the perl-skript the s-bit is set.
>
> I get the error : 'Insecure dependency...'
> I try to solve it with .
>
> if ($com=~ /\w/)
> {
> $com = $1;
> }
> else
> {
> $com = $1;
> }
Doesn't make any sense....
$1 contains nothing and you just
set $com to undefined value.
if ($com =~ /^(\w+)$/) {
$com = $1;
} else {
die "you gave me bad thing: $com!\n";
}
manpage: perlre
> $out = ` $com`;
>
> But then I get the error:
> 'Insecure $ENV{PATH} while running setuid '
> How can I use the backtits without getting these error messages or ist
> there another solution ?
The error tells you: Insecure $ENV{PATH}....
The variable isn't secure. It will be secure
if you set it to known value.
$ENV{PATH} = '/bin'; # example
manpage: perlsec
HTH,
--
-hasan-
uhm, no more sig(h)
------------------------------
Date: 15 Jun 1999 09:06:07 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Child processes, "Please wait" pages
Message-Id: <m11zfdh2j4.fsf@halfdome.holdit.com>
>>>>> ""Thomas" == "Thomas J Margolis" <tmargolis@seqnet.net> writes:
"Thomas> I am working with some very ugly, long Perl legacy code which, prompted by a
"Thomas> user's form submission, extracts data from a database and prints a report to
"Thomas> the browser. Because this process takes a while, I want a "Please wait"
"Thomas> page to appear after the user presses Submit, and to be replaced by the
"Thomas> database report when the extraction process is completed.
Sounds exactly like column 20 in
http://www.stonehenge.com/merlyn/WebTechniques/
And this question probably would have better been answered in CIWAC,
not here.
print "Just another Perl hacker,"
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 15 Jun 1999 16:52:33 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: CPAN process still running????
Message-Id: <376676c1@newsread3.dircon.co.uk>
master <master@m.com> wrote:
> I have started experimenting with the CPAN shell the last couple of days.
> After an unsuccessfull attempt at downloading and installing
> "Bundle-libnet", (by running perl -MCPAN -e "install Bundle::libnet" or
> something like that) I did CTRL-C to break out of the loop. My next attempt
> to access the shell gave the following message:
>
> D:\users>perl -MCPAN -e shell
>
> There seems to be running another CPAN process (306). Contacting...
> kill process failed!
CPAN will create a file called .lock in a directory called .cpan in your home
directory (in Unix) or in the root of the current drive (On Win32) you
should remove that file ...
Win32 :
P:\.cpan>dir
Volume in drive P has no label
Directory of P:\.cpan
. <DIR> 15/06/99 16:49 .
.. <DIR> 15/06/99 16:49 ..
LOCK~1 9 15/06/99 16:49 .lock
sources <DIR> 15/06/99 16:47 sources
1 file(s) 9 bytes
3 dir(s) 2,041.50 MB free
Unix:
fatmog:~/.cpan$ ls -al
total 7
drwxr-xr-x 6 tdcjs users 1024 Jun 15 15:50 ./
drwxr-xr-x 14 tdcjs root 1024 Jun 15 15:42 ../
-rw-r--r-- 1 tdcjs users 6 Jun 15 15:50 .lock
drwxr-xr-x 2 tdcjs users 1024 Mar 24 11:30 Bundle/
drwxr-xr-x 2 tdcjs users 1024 Mar 24 11:41 CPAN/
drwxr-xr-x 13 tdcjs users 1024 Apr 30 10:54 build/
drwxr-xr-x 4 tdcjs users 1024 Mar 24 11:40 sources/
/J\
--
"I can't believe Elton John recorded that song again. Exactly how do you
live your life like a spurgis in the wind?" - Ronnie, Veronica's Closet
------------------------------
Date: 16 Jun 1999 05:57:26 GMT
From: hasant@trabas.co.id (Hasanuddin Tamir)
Subject: Re: Creating an external config file. How ?
Message-Id: <slrn7mcjtd.f71.hasant@borg.intern.trabas.co.id>
On 14 Jun 1999 20:01:35 GMT, Kenneth Herron <kherron@sgum.mci.com> wrote:
[snip]
> >Now:
> >
> > do "myproggie.cf";";
>
> Along those lines, you can do something like this:
>
> %config = require 'foo.pl';
You mean, $config = require 'foo.pl';
> where foo.pl contains an anonymous hash:
>
> {
> 'logdir' => '/var/log',
> 'logfile' => 'local0',
> # etc.
> };
>
> and then refer to $config->{'logdir'} and so on.
>
> The downside of both of these methods is that the "configuration file"
> has to be syntactically valid perl. Depending on the software's target
> audience, this might present ease-of-use problems for future
> users/maintainers.
Needlessly to say about the problem, particularly
for the mainteners. I use this kind of approaching
as well, only that I use Data::Dumper to build my
config file.
The only solution I have right now is creating
another interface to manage the file and emphasizing
to leave the file alone. Yet I'm still not sure
it's enough.
--
-hasan-
uhm, no more sig(h)
------------------------------
Date: 15 Jun 1999 15:59:16 GMT
From: jeromeo@atrieva.com (Jerome O'Neil)
To: Bernt Rygg <berntr@persbraten.vgs.no>
Subject: Re: Environment variables.
Message-Id: <7k5t8k$66d$2@brokaw.wa.com>
[Posted and mailed]
In article <37666CDA.52D4C352@persbraten.vgs.no>,
Bernt Rygg <berntr@persbraten.vgs.no> writes:
> Hi,
> where can I find a listing of available environment variables like
> REMOTE_HOST, REMOTE_ADDR etc.?
while(my($key,$val) = each(%ENV)){
print qq{$key = $val\n};
}
> (BTW: Why does REMOTE_HOST not always hold a value ?)
Because it is not always set!
Good Luck!
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: Tue, 15 Jun 1999 16:25:37 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Environment variables.
Message-Id: <37667e19.36589387@news.skynet.be>
Bernt Rygg wrote:
>where can I find a listing of available environment variables like
>REMOTE_HOST, REMOTE_ADDR etc.?
>(Does that set depend on Perl or the operating system - in this case
>RedHat Linux?)
More on the CGI server.
And you could, at least, experiment with them. Their use MAY become
obvious.
print "Content-type: text/plain\n\n";
foreach (sort keys %ENV) {
print "$_: $ENV{$_}\n";
}
Bart.
------------------------------
Date: Tue, 15 Jun 1999 09:29:29 -0700
From: Raj <technology@workmail.com>
Subject: Events in CGI/Perl
Message-Id: <37667F69.6EA57BEC@workmail.com>
Hi,
How can an OnClick event on a link on my CGI/Perl Script
1. Invoke a " Save As" Message Box to let the user save the target file
into the local hard drive..?
2.Maintain a counter of OnClicks on the Server ( to track the downloads)
Any Clue Please....!!? TIA
~Raj
------------------------------
Date: Tue, 15 Jun 1999 09:34:34 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: examples
Message-Id: <3766809A.D02D74A3@mail.cor.epa.gov>
Abigail wrote:
>
> Lucas Hernandez (hernal@champint.com) wrote on MMCXIII September MCMXCIII
> in <URL:news:7k3hrt$7m1$1@sneezy.strategicit.net>:
> ""
> "" I'm trying to find out how to create a html code able to call a pearl script
> "" under windows platform..
>
> You might want to ask in alt.music.blueoystercult for pearl scripts.
And if you're doing signal handling, don't fear the \&REAPER
David, ducking rapidly...
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 15 Jun 1999 16:57:19 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: File Processing
Message-Id: <376677df@newsread3.dircon.co.uk>
Larry Rosler <lr@hpl.hp.com> wrote:
> [Posted and a courtesy copy sent.]
>
> In article <37661890@newsread3.dircon.co.uk> on 15 Jun 1999 10:10:40
> +0100, Jonathan Stowe <gellyfish@gellyfish.com> says...
> ...
>> my $r
>> while($r = <FILE>)
>> {
>> print $r;
>> }
>
> You are missing a semicolon there.
Yup - teach me to get cocky and type it straight in ;-}
> But what you really want for those
> five lines is:
>
> print while <FILE>;
>
> See how many characters that saved!
>
Whilst I wouldnt want anyone to wear out their keyboard - I retained the
original posters variable on the assumption that he wanted to do something
else with the file than simply printing it out ...
/J\
--
"They're called Virgin Trains because they don't go all the way" -
Simon Hoggart, The Guardian
------------------------------
Date: 15 Jun 1999 00:22:27 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: File Uploading
Message-Id: <slrn7mbp8u.cmq.abigail@alexandra.delanet.com>
Aneesha (aneesha@vettweb.net.au) wrote on MMCXIV September MCMXCIII in
<URL:news:kTk93.2008$fR5.12111@ozemail.com.au>:
..
.. While I'm familiar with ASP, and Javascript I'm very new to writing cgi
.. programs with perl. I basically need to get a script that will allow a user
.. to upload a file to a directory on my webserver. All the scripts i have
.. tried don't work and just get an internal server error. The problem is that
.. all the scripts i can find use the CGI.pm module which i don't think is
.. installed on the server. When i ring the ISP tech support - all they say is
.. that they will check and send me an email. I never get that email. I don't
.. have telnet access either. My client really wants the site finished but I'm
.. stalled because of where it is hosted. So my question is can i upload files
.. without the cgi.pm module. Is there any way to use ftp from a perl cgi
.. script? Any help in the right direction would be much appreciated.
What makes you think you need tech support to install a module?
You have paying customers and you don't even know the basics about
installing modules? Poor customers.
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Mon, 14 Jun 1999 11:02:24 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Fix this uglyness
Message-Id: <x3yk8t6x1tr.fsf@tigre.matrox.com>
alanp@unixpower.org (Alan) writes:
> I haven't the time to do it myself, so could someone please fix the
> systeming I used when I got tired:
Why do you think we want to waste our time on something for you, when
you don't want to spend any of your valuable time on it?
*plonk*
------------------------------
Date: Tue, 15 Jun 1999 09:49:27 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: R & K Rideout <rideout@sound.net>
Subject: Re: Help with uploads
Message-Id: <37668417.A35246F6@mail.cor.epa.gov>
[courtesy cc to poster]
R & K Rideout wrote:
>
> Does anyone have or know of a .pl to strip the ^M from the end of each line
> once it is uploaded to UNIX. Currently, I have to do it one line at a time.
You mean a Perl program, I think. But what you *really* want
is to ftp your files in ASCII mode instead of binary, so they
won't have those annoying ^M guys hanging around.
In future, be Lazier. :-)
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Tue, 15 Jun 1999 17:56:50 +0100
From: Simon Wistow <simon@profero.com>
Subject: Re: how do i make a Multi Dimensional array?
Message-Id: <376685D2.2E72CEEC@profero.com>
> Not at all. It has to do with basic syntax. You cannot dump a BLOCK
> arbitrarily in the middle of an expression.
>
> config = substr($ENV{'HTTP_COOKIE'},7) or do {
> print "Set-Cookie: config=1\n";
> $config=1;
> };
>
Whoops, shudl have looked at the code more closley :(
--
Simon Wistow Developement
simon@profero.com Profero Ltd
Phone:0171 700 9960 Fax: 0171 700 9961
------------------------------
Date: Tue, 15 Jun 1999 11:38:56 -0400
From: Greg Bartels <gbartels@xli.com>
Subject: Re: How do I trim a string?
Message-Id: <37667390.A7C671C0@xli.com>
Simon Kerr wrote:
> For example, "Call Detail For 012542916".
> I want to remove all of the alphabetic (i.e. [a-zA-Z]) characters, so that
> I'm just left with the numberic string ("012542916").
$string =~ tr/ a-zA-Z//d;
translate/space, alphabet/to nothing/ d=delete any thing without
matches.
Greg
------------------------------
Date: Tue, 15 Jun 1999 11:54:42 -0400
From: Mark Conlin <Mark.Conlin@bridge.bellsouth.com>
Subject: I dont understand system calls
Message-Id: <37667742.9F485A10@bridge.bellsouth.com>
I am having problems understanding the system command.
I want to use system to look for a file, How can I get
the results from
system("ls"); or
system("find", "myfile");
thanks
Mark
------------------------------
Date: Tue, 15 Jun 1999 12:12:39 -0400
From: Mark Conlin <Mark.Conlin@bridge.bellsouth.com>
Subject: Re: I dont understand system calls
Message-Id: <37667B77.38992D33@bridge.bellsouth.com>
I figured it out myself
the trick is to use backticks
$mylist = `ls`;
Mark*
------------------------------
Date: 15 Jun 1999 20:32:34 +0200
From: Benjamin Schweizer <SternSZ@gmx.de>
Subject: IO::Socket, Socket
Message-Id: <m3lndlqpq5.fsf@anthrax.local.net>
Hi,
somebody told me to use IO::Socket instead of Socket.
What is better in IO::Socket?
Has anybody an example for me (I need an multithreaded Server)?
regards
-Benjamin
--
PC-Hardware HOWTO -> http://privt.schlund.de/SternSZ/hardware.htm
------------------------------
Date: 14 Jun 1999 23:28:25 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Netscape problem
Message-Id: <slrn7mbm3l.cmq.abigail@alexandra.delanet.com>
Bob Perini (perini@buffalo.edu) wrote on MMCXIII September MCMXCIII in
<URL:news:7k3qkj$7es$1@prometheus.acsu.buffalo.edu>:
'' I have a script that I am trying to run, and when I try to run the script,
'' netscape doesn't run it at all, but instead asks to save the file. This
'' script works fine on Internet Explorer.
'' What general problem causes a perl program to try to save in netscape?
That's not a Perl question.
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 15 Jun 1999 00:24:25 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Newbie wants to know: How would you do this?
Message-Id: <slrn7mbpck.cmq.abigail@alexandra.delanet.com>
Ken Bass (Barista@End.Of.Universe) wrote on MMCXIII September MCMXCIII in
<URL:news:37658a86.10998384@nntp1.ba.best.com>:
==
== What I want is to have the left frame also to contain links
== personalized for a specific person. I already have a user database set
== up and can access it from a perl script. I would like to some how use
== cookies to identify the user, read the pre-selected links from the
== database, and list them in the left frame. I think I know how to do
== that (although I'm still confused about using cookies, with different
== frames). What I am really confused about, though, is how a user can
== request a link be added to his "personalized" list? It would be nice
== if by clicking on a button on the top frame, whatever link is in the
== third frame would be written to the database, and then the left frame
== would get updated.
And your Perl question is?
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Tue, 15 Jun 1999 09:20:36 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: parse a string in triplet ?
Message-Id: <MPG.11d01d24ca412aa989beb@nntp.hpl.hp.com>
In article <37715a00.18650287@enews.newsguy.com> on Tue, 15 Jun 1999
13:51:44 GMT, Marcel Grunauer <marcel.grunauer@lovely.net> says...
...
> #!/usr/bin/perl -w
> use strict;
> my $dna = 'ACTGTGCATGACGACTGTGCATGACGACTGTGCATGACGAGTA';
> while (length $dna > 3) {
> print substr($dna,0,3), '+';
> substr($dna,0,3)=''; # Empty string, not double quote
> }
> print $dna;
>
> I'm sure someone can come up with a more elegant solution, more
> idiomatic (Larry? Bart?)
print join '+' => map substr($dna, 3 * $_, 3), 0 .. (length $dna)/3;
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 15 Jun 1999 16:44:47 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
Subject: Re: parse a string in triplet ?
Message-Id: <si3dztza4g.fsf@cre.canon.co.uk>
Marcel Grunauer wrote:
> while (length $dna > 3) {
> print substr($dna,0,3), '+';
> substr($dna,0,3)=''; # Empty string, not double quote
> }
> print $dna;
>
> I'm sure someone can come up with a more elegant solution, more
> idiomatic (Larry? Bart?)
Larry Rosler wrote:
> print join '+' => map substr($dna, 3 * $_, 3), 0 .. (length $dna)/3;
$_ = $dna; s/\G([ACGT]{3})/$1+/g; print;
--
Gareth Rees
------------------------------
Date: Tue, 15 Jun 1999 15:20:06 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Perl "constructors"
Message-Id: <7k5qup$oo6$1@nnrp1.deja.com>
In article <7k5bgh$j3d$1@nnrp1.deja.com>,
armchair@my-deja.com wrote:
> In article <7k3d72$u1n$1@nnrp1.deja.com>,
> John Porter <jdporter@min.net> wrote:
> > Or rather, it's only relevant to fellows who lack the background
> > and/or cognitive abilities to recognize the equivalence of the two.
>
> Would that background include a tour as a Moonie?
No, it would not.
> > > Allow me to give you credit for something.
> >
> > What you do with your worthless credit is your own business.
>
> I would think that fellows who persist in calling C "portable
assembler"
> would cherish any credit they got, and not sullenly toss it aside.
You would be wrong.
> > It's ridiculous to suppose that some code in C is
> > more powerful, by any definition, than its asm equivalent.
>
> Really,
Really.
> First Perl strings were different than Perl strings,
Is that a typo? Or are you an idiot?
> and now it is easy
> to write a C++ string that does the same thing.
Now, then, and always.
> Are you suggesting
> that no current C++ string class does what a Perl string does?
No.
> And what
> does a Perl string do that is keeping you from specifying it?
Nothing is keeping me from specifying it, other than the fact
that I have better things to do with my time.
If you want a functional description, read perldata, perlop,
and perlfunc.
> Help me out - explain this phrase "how the language implementation
> supports the creation of classes and objects".
I'm refering to the capabilities of the compiler in all its parts --
the lexer, the parser, the semantic processor, the symbol table
manager, and the run-time components added by the back-end --
which support the OO features of the language. In concrete terms,
the things that make
class Foo {
private:
int x;
protected:
int y;
int size();
public:
Foo() { }
};
a legal and meaningful thing to write.
I was specifically NOT referring to the source of classes themselves,
e.g. Foo in the above example.
> And we were comparing C++ and Perl source code,
Not at the time the subject of the complexity of C++ came up.
And in fact I was never talking about "source code".
That seems to be your bailiwick.
> > Hmm. The simplest "class definition" in Perl consists of no code
> > at all. This does not stop you from having instances of the class,
> > however.
> >
> > $foo = bless {}, 'Foo'; # make an object of class Foo.
>
> C++ is a little more flexible with it's simplest definition of a class
> not requiring you to create an instance of the object:
>
> class Foo {};
It's true that objects have primacy over classes in Perl, which is
the opposite of C++.
> It certainly does show how much more complex the Perl class
> implementation is.
Actually it's only possible because of the simple, dynamic
implementation of classes in Perl.
And it shows that Perl is more powerful than C++ in this one
specific respect at least.
> > Make undefined method calls do something useful:
> >
> > sub Foo::AUTOLOAD {
> > my $self = shift;
> > my $name = $Foo::AUTOLOAD;
> > $name =~ s/.*:://; # strip the qualification
> > $self->{'contained_object'}->$name( @_ );
> > }
>
> Don't know what this is doing, but it again appears that Perl objects
> have a lot of complexity to them versus the much simpler C++.
It only appears complex to you *because* you don't know what's
going on. It's really not bad at all.
And it is a powerful, useful feature which C++ programmers could
only dream of.
> > > End of story.
> >
> > Stories, like newsgroup threads, don't end just because someone
> > declares them ended.
>
> Didn't say the story ended,
You are a liar.
> > It's unfortunate that the benefits of C++ come at such a high
> > cost in complexity. This was, of course, one of the motivating
> > factors in the creation of Java.
>
> You were supposed to demonstrate how C++ classes were more complex
than
> Perl's,
"Supposed to"? Think again.
> and you somehow forgot to show the C++ classes at all, far from
> proving C++ to be complex.
The C++ machinery for supporting OOP is far more complex than that
of Perl, but it would require some understanding of both for one to
realize it. But the point, originally, was that C++ was so much
more complex than C because of this extra machinery. Not sure why
you find it so hard to believe.
> Maybe you can get the Java creators to help
> you demonstrate the complexity of creating classes in C++.
They would be more than happy to; simply go make this request
for info in comp.lang.java.
(My apologies to the clj guys in advance.)
--
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: Tue, 15 Jun 1999 15:49:42 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Perl "constructors"
Message-Id: <7k5smg$pib$1@nnrp1.deja.com>
In article <7k5chd$jb9$1@nnrp1.deja.com>,
armchair@my-deja.com wrote:
> In article <7k30op$p12$1@nnrp1.deja.com>,
> John Porter <jdporter@min.net> wrote:
> >
> > Perl is little more than a programming language,
> > although it is a great one.
>
> my concern is that you consider Perl more than just
> a programming language. And above, you admit to that fact.
And your opinion of C and C++ is different, how?
You have claimed, repeatedly, that C is not comparable to asm on
the basis of the quality/quantity of its available support tools.
If these things can be considered part of "the C language",
then I can confidently say that Perl is truly nothing more than a
programming language.
> Can't we talk about how C++ "models the real
> machine" while Perl "models a virtual machine"??
Actually C++ does a half-way decent job of trying to model something
a little more abstract than the real machine.
> Why does your "C is
> portable assember" "argument" not apply to C++.
I am simply recognizing the design motivations for those languages,
and also that they have achieved their design goals with some
considerable degree of success.
> > Anything in C++ that is not in Perl is not necessary in a
> > high-level language.
>
> I hope you tell that to the programmers writing fields.pm and other
> modules for function overloading and operator overloading.
Some people, especially recovering C++ programmers, find these things
desirable. Necessary: not.
> I am glad to see that they agree with me, and not you.
Rather than assume that they do, perhaps you should ask them.
> I have never programmed in assembler.
Well that explains a lot.
> I give credit to Perl
Heh, Perl doesn't need your credit. Thanks anyway.
> ... for giving me new ideas
I suppose that's the best outcome we can hope for here.
--
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: 15 Jun 1999 00:27:57 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl Compiler
Message-Id: <slrn7mbpj9.cmq.abigail@alexandra.delanet.com>
cor75@my-deja.com (cor75@my-deja.com) wrote on MMCXIV September MCMXCIII
in <URL:news:7k49fh$8m0$1@nnrp1.deja.com>:
??
?? Do I need to have root access in order to run make for the Perl
?? Compiler?
No. What makes you think you do?
Abigail
--
perl -e 'for (s??4a75737420616e6f74686572205065726c204861636b65720as?;??;??)
{s?(..)s\??qq \?print chr 0x$1 and q ss\??excess}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 15 Jun 1999 00:34:19 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Regex question
Message-Id: <slrn7mbpv6.cmq.abigail@alexandra.delanet.com>
Jody Fedor (JFedor@datacom-css.com) wrote on MMCXIV September MCMXCIII in
<URL:news:7k4ia6$id4$1@plonk.apk.net>:
,,
,, My $date variable now has Tue Jun 15 00:10:02 1999.
,,
,, I would like $date to have Tue Jun 15 1999.
,,
,, I came up with $date =~ s/(\w+{4}?)//;
,,
,, (My thinking \w matches first letter in word adding + matches whole word,
,, using () because of grouping using {4} because perlre says to and ? because
,, it could be anything.)
You misunderstood \w, {}, () and ?.
\w matches any letter, digit or _, not just a first letter in a word.
{4} means "match the previous thing 4 times".
? means "match the previous thing 0 or 1 times."
There's no need to group here, as you're not using anything that you capture.
Hence, \w{4}? will always match, as it matches the empty string.
What you want is studying 'man perlre' again. Then you will be able
to deduce you need: s/\d\d:\d\d:\d\d //;
Abigail
--
perl -wlne '}for($.){print' file # Count the number of lines.
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Tue, 15 Jun 1999 09:21:22 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: taint checking setuid error message
Message-Id: <37667D82.9DEF2165@mail.cor.epa.gov>
Tom Phoenix wrote:
>
> On Mon, 14 Jun 1999, John wrote:
>
> > I'm running perl v4
>
> When that version of Perl was current, OJ Simpson was best known for being
> a Heisman trophy winner. He still can't seem to find the real killer, but
> you can (and should) find the real Perl.
>
> http://www.cpan.org/
In the words of Randal, "heh".
> There are even CERT advisories telling why such old software isn't safe to
> use. Please upgrade.
>
> > (actually ingperl v4).
>
> Well, you can probably do whatever it is that was special about ingperl
> with a module (a database module, perhaps?). And your code will be more
> reliable for no extra cost.
IngPerl was the old Ingres database code for Perl. It has been
supplanted by the DBI module and the appropriate DBD::* module.
And these need a modern Perl to run. So pay attention to TomP.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 16 Jun 1999 05:57:40 GMT
From: hasant@trabas.co.id (Hasanuddin Tamir)
Subject: Re: user IP
Message-Id: <slrn7mcsit.f71.hasant@borg.intern.trabas.co.id>
On Tue, 15 Jun 1999 00:03:52 -0400, Leonid Goltser <leonid76@erols.com> wrote:
> Is there a method in perl to check for IP?
In what context?
--
-hasan-
uhm, no more sig(h)
------------------------------
Date: 15 Jun 1999 00:35:26 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: user IP
Message-Id: <slrn7mbq19.cmq.abigail@alexandra.delanet.com>
Leonid Goltser (leonid76@erols.com) wrote on MMCXIV September MCMXCIII in
<URL:news:7k4j9g$127$1@autumn.news.rcn.net>:
,, Is there a method in perl to check for IP?
Check in which sense?
Abigail
--
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")
-> define ("foldoc", "perl")) [0] -> print'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 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 6003
**************************************