[23901] in Perl-Users-Digest
Perl-Users Digest, Issue: 6103 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 9 21:05:51 2004
Date: Mon, 9 Feb 2004 18:05:08 -0800 (PST)
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, 9 Feb 2004 Volume: 10 Number: 6103
Today's topics:
(quickie) print in place? <not_a_real@adress.getting.too.much.spam.org>
Re: (quickie) print in place? <usenet@morrow.me.uk>
Re: (quickie) print in place? <gnari@simnet.is>
Re: Anyone using Berkley XML DB w/Perl (of course)...? <bobx@linuxmail.org>
Re: Anyone using Berkley XML DB w/Perl (of course)...? <usenet@morrow.me.uk>
Re: Array size <dd-b@dd-b.net>
Re: Array size <uri@stemsystems.com>
automatically send http header <chpshi@stonix.com>
Re: automatically send http header <1usa@llenroc.ude>
Re: automatically send http header <matthew.garrish@sympatico.ca>
convert cgi to mod_perl <chpshi@stonix.com>
Re: convert cgi to mod_perl <emschwar@pobox.com>
Re: convert cgi to mod_perl <matthew.garrish@sympatico.ca>
Re: CPAN cc vs. gcc <mhunter@uclink.berkeley.edu>
Encrypt and Decrypt for text ... <gis86508@cissol1.cis.nctu.edu.tw>
Re: glob in perl <dd-b@dd-b.net>
How to time out TCP read with Windows? <dan.NOzerkle@SPAMoracle.PLEASEcom>
Re: How to time out TCP read with Windows? <usenet@morrow.me.uk>
Re: memory profiling ctcgag@hotmail.com
Re: Perl project update <bik.mido@tiscalinet.it>
Re: Site Visitor's eMail Address <harley_young@hotmail.com>
Re: substitution fails for long line ctcgag@hotmail.com
Re: Why is Perl losing ground? <usenet@morrow.me.uk>
Re: Why is Perl losing ground? <bobx@linuxmail.org>
Re: Why is Perl losing ground? <usenet@morrow.me.uk>
Re: Why is Perl losing ground? <tore@aursand.no>
Re: Why is Perl losing ground? <dd-b@dd-b.net>
Re: Why is Perl losing ground? <dd-b@dd-b.net>
Re: Why references?? <xxala_qumsiehxx@xxyahooxx.com>
Re: Why references?? <usenet@morrow.me.uk>
Re: Why references?? <xxala_qumsiehxx@xxyahooxx.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 9 Feb 2004 17:02:14 -0800
From: "Damian" <not_a_real@adress.getting.too.much.spam.org>
Subject: (quickie) print in place?
Message-Id: <c09aeu$14hlvn$1@ID-196529.news.uni-berlin.de>
was wondering how exactly do you print(...) in place? Like the percent
counter for installers like linux's rpm. In other words so the output
keeps going to the same spot in stead of advancing the cursor.
If this is something only on Linux/Unix thats fine, as thats the only
place I really need to do this. Though portability never hurts.
Many thanks.
------------------------------
Date: Tue, 10 Feb 2004 01:24:14 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: (quickie) print in place?
Message-Id: <c09bru$cnm$1@wisteria.csv.warwick.ac.uk>
"Damian" <not_a_real@adress.getting.too.much.spam.org> wrote:
> was wondering how exactly do you print(...) in place? Like the percent
> counter for installers like linux's rpm. In other words so the output
> keeps going to the same spot in stead of advancing the cursor.
>
> If this is something only on Linux/Unix thats fine, as thats the only
> place I really need to do this. Though portability never hurts.
Term::ANSIScreen.
Ben
--
Heracles: Vulture! Here's a titbit for you / A few dried molecules of the gall
From the liver of a friend of yours. / Excuse the arrow but I have no spoon.
(Ted Hughes, [ Heracles shoots Vulture with arrow. Vulture bursts into ]
/Alcestis/) [ flame, and falls out of sight. ] ben@morrow.me.uk
------------------------------
Date: Tue, 10 Feb 2004 01:19:08 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: (quickie) print in place?
Message-Id: <c09bgi$5p9$1@news.simnet.is>
"Damian" <not_a_real@adress.getting.too.much.spam.org> wrote in message
news:c09aeu$14hlvn$1@ID-196529.news.uni-berlin.de...
> was wondering how exactly do you print(...) in place? Like the percent
> counter for installers like linux's rpm. In other words so the output
> keeps going to the same spot in stead of advancing the cursor.
>
> If this is something only on Linux/Unix thats fine, as thats the only
> place I really need to do this. Though portability never hurts.
"\r"
gnari
------------------------------
Date: Mon, 09 Feb 2004 18:24:36 -0500
From: Robert <bobx@linuxmail.org>
Subject: Re: Anyone using Berkley XML DB w/Perl (of course)...?
Message-Id: <I5SdnWO_lv4pi7XdRVn-uA@adelphia.com>
Chris wrote:
> I'm trying to find some Perl API support (read "CPAN module") for using
> Sleepcat's Berkley XML DB, but I'm coming up blank. Sleepcat's web site
> is Java and C++ centric and I see no Perl information there though an
> article I read on XML DB claims there is Perl support. Googling for a
> suitable module produced nothing of interest, not to mention such
> searching is muddied by www.xmldb.org which uses a lot of Perl-like
> "XML::DB" notation.
>
> It would appear that Berkley's XML DB coupled with XML::Dumper poses
> some interesting possibilities for run-time object persistence between
> client and server platforms... tantalizing to say the least.
>
> Surely I would be spared having to download the Java support and convert
> to Perl modules... 8-( I guess I can try their message list, but
> thought a quick note here would maybe turn up something solid.
>
> Chris
> -----
And if someone does create a binary (esp. for ActiveState) please share
it. :-)
------------------------------
Date: Tue, 10 Feb 2004 00:12:32 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Anyone using Berkley XML DB w/Perl (of course)...?
Message-Id: <c097lg$ajg$2@wisteria.csv.warwick.ac.uk>
Vetle Roeim <vetro@online.no> wrote:
> * ceo@nospan.on.net
> > I'm trying to find some Perl API support (read "CPAN module") for
> > using Sleepcat's Berkley XML DB, but I'm coming up blank.
>
> You're not going to find it on CPAN, unfortunately. To install it, I
> downloaded the source code, compiled it, and then installed the Perl
> module from dbxml-1.2.0/src/perl.
Having taken a look at that: bleech. Is it *quite* necessary to
trample on that many different (including top-level and pragmatic)
namespaces? And is it really necessary to have the interface be so
C++ish?
You may be better off writing your own wrapper: it shouldn't be *that*
hard...
Ben
--
For the last month, a large number of PSNs in the Arpa[Inter-]net have been
reporting symptoms of congestion ... These reports have been accompanied by an
increasing number of user complaints ... As of June,... the Arpanet contained
47 nodes and 63 links. [ftp://rtfm.mit.edu/pub/arpaprob.txt] * ben@morrow.me.uk
------------------------------
Date: Mon, 09 Feb 2004 18:30:08 -0600
From: David Dyer-Bennet <dd-b@dd-b.net>
Subject: Re: Array size
Message-Id: <m2u11z93ov.fsf@gw.dd-b.net>
Uri Guttman <uri@stemsystems.com> writes:
>>>>>> "DD" == David Dyer-Bennet <dd-b@dd-b.net> writes:
>
> >> did you try $#$f ?
>
> DD> No, but I'm quite sure it's not in the man pages anywhere, because I
> DD> looked at all the $# hits, and didn't find it.
>
> because it has nothing to do with array size but more to do with
> references. read perlreftut and perlref.
Yes, read them, too. None of the man pages give a clue about how to
apply $# to a reference. At least not a clue that can be *found*.
--
David Dyer-Bennet, <mailto:dd-b@dd-b.net>, <http://www.dd-b.net/dd-b/>
RKBA: <http://noguns-nomoney.com> <http://www.dd-b.net/carry/>
Photos: <dd-b.lighthunters.net> Snapshots: <www.dd-b.net/dd-b/SnapshotAlbum/>
Dragaera/Steven Brust: <http://dragaera.info/>
------------------------------
Date: Tue, 10 Feb 2004 01:58:17 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Array size
Message-Id: <x7n07rg0g6.fsf@mail.sysarch.com>
>>>>> "DD" == David Dyer-Bennet <dd-b@dd-b.net> writes:
DD> Uri Guttman <uri@stemsystems.com> writes:
>>>>>>> "DD" == David Dyer-Bennet <dd-b@dd-b.net> writes:
>>
>> >> did you try $#$f ?
>>
DD> No, but I'm quite sure it's not in the man pages anywhere, because I
DD> looked at all the $# hits, and didn't find it.
>>
>> because it has nothing to do with array size but more to do with
>> references. read perlreftut and perlref.
DD> Yes, read them, too. None of the man pages give a clue about how to
DD> apply $# to a reference. At least not a clue that can be *found*.
no, it tells you how to do ANYTHING with a ref. see tad's recent posts
showing the rule for converting a regular variable use into a ref
use. same thing for $#
you have to use a little brain power with the docs as with anything to
do with coding. they can't spell out every possible combination of
everything in everyplace.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Mon, 9 Feb 2004 18:06:39 -0500
From: "Alex Shi" <chpshi@stonix.com>
Subject: automatically send http header
Message-Id: <slUVb.17465$L34.8842@nntp-post.primus.ca>
With php you don't need to explicitly send http header before
print or echo. However in perl you need it. Even with mod_perl
you have to issue following before any http output
print "Content-type: text/plain\n\n";
I am just wondering if it possible to add a command in Apache
configuration so that we don't need the line of sending header
in perl script?
Thanks in advance!
Alex Shi
--
==================================================
Cell Phone Batteries at 30-50%+ off retail prices!
http://www.pocellular.com
==================================================
------------------------------
Date: 9 Feb 2004 23:44:11 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude>
Subject: Re: automatically send http header
Message-Id: <Xns948ABE9907FDFasu1cornelledu@132.236.56.8>
"Alex Shi" <chpshi@stonix.com> wrote in news:slUVb.17465$L34.8842@nntp-
post.primus.ca:
> With php you don't need to explicitly send http header before
> print or echo. However in perl you need it. Even with mod_perl
> you have to issue following before any http output
>
> print "Content-type: text/plain\n\n";
>
> I am just wondering if it possible to add a command in Apache
> configuration so that we don't need the line of sending header
> in perl script?
You do realize that the content type depends on the type of the content you
want to send, right?
Sinan.
--
A. Sinan Unur
1usa@llenroc.ude (reverse each component for email address)
------------------------------
Date: Mon, 9 Feb 2004 18:30:45 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: automatically send http header
Message-Id: <xKUVb.2843$sO4.418686@news20.bellglobal.com>
"Alex Shi" <chpshi@stonix.com> wrote in message
news:slUVb.17465$L34.8842@nntp-post.primus.ca...
> With php you don't need to explicitly send http header before
> print or echo. However in perl you need it.
>
Perl is an all-purpose scripting language, so of course you have to send
your own header. Output goes to STDOUT. If STDOUT happens to be going to a
browser, you have to format your http headers accordingly. It wouldn't make
for a very good language if every time you tried to print to STDOUT an http
header was dumped out (Perl != CGI).
>
> I am just wondering if it possible to add a command in Apache
> configuration so that we don't need the line of sending header
> in perl script?
>
You're asking an apache configuration question in a Perl newsgroup. Someone
here might have an answer for you, but you're far more likely to get a
response by posting your question to a newsgroup that deals with apache
configuration issues. There's no harm in trying here (depending on who
responds), but I suspect most people will just ask you what your Perl
question is.
Matt
------------------------------
Date: Mon, 9 Feb 2004 18:07:13 -0500
From: "Alex Shi" <chpshi@stonix.com>
Subject: convert cgi to mod_perl
Message-Id: <%lUVb.17467$Tm4.16677@nntp-post.primus.ca>
Hi,
I have made my Apache work correctly with mod_perl and created
a deploy directory for it. It was tested OK. Also I have some old perl
cgi scripts and want to convert them to mod_perl. Can I just do it by
moving those scripts to the deploy dirtory and removing the shibang
line from the old scripts? Thanks in advance!
Alex Shi
--
==================================================
Cell Phone Batteries at 30-50%+ off retail prices!
http://www.pocellular.com
==================================================
------------------------------
Date: Mon, 09 Feb 2004 16:25:39 -0700
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: convert cgi to mod_perl
Message-Id: <etoekt3zvgs.fsf@fc.hp.com>
"Alex Shi" <chpshi@stonix.com> writes:
> I have made my Apache work correctly with mod_perl and created
> a deploy directory for it. It was tested OK. Also I have some old perl
> cgi scripts and want to convert them to mod_perl. Can I just do it by
> moving those scripts to the deploy dirtory and removing the shibang
> line from the old scripts? Thanks in advance!
Did you read the documentation for mod_perl? Everything you're
looking for is there already. Check out <URL:http://apache.perl.org/docs/>.
In your case, you want the "CGI to mod_perl Porting" page at
<URL:http://apache.perl.org/docs/1.0/guide/porting.html>.
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: Mon, 9 Feb 2004 18:37:28 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: convert cgi to mod_perl
Message-Id: <QQUVb.2851$sO4.420658@news20.bellglobal.com>
"Alex Shi" <chpshi@stonix.com> wrote in message
news:%lUVb.17467$Tm4.16677@nntp-post.primus.ca...
> Can I just do it by
> moving those scripts to the deploy dirtory and removing the shibang
> line from the old scripts?
>
Freudian slip, or are you just maniacally egotistical? : )
Matt
------------------------------
Date: Mon, 9 Feb 2004 23:55:24 +0000 (UTC)
From: Mike Hunter <mhunter@uclink.berkeley.edu>
Subject: Re: CPAN cc vs. gcc
Message-Id: <slrnc2g7c1.kk.mhunter@celeste.net.berkeley.edu>
On Sat, 7 Feb 2004 21:45:47 +0000 (UTC), Ben Morrow wrote:
>
> mhunter@uclink.berkeley.edu wrote:
> > On Fri, 6 Feb 2004 08:51:13 -0800, Mothra wrote:
> > > export CC=gcc
> >
> > Unfortunately, that won't work:
> >
> > perl -MCPAN -e 'install Digest::MD5'
> > .
> > .
> > .
> > cc: unrecognized option `-KPIC'
> > cc: language depend not recognized
> > cc: MD5.c: linker input file unused because linking not done
> >
> > What's happening is that the config files are structured to build
> > with cc, but I need to change that to gcc.
> >
> > I tried hacking cc to gcc in
> > /usr/perl5/5.6.1/lib/sun4-solaris-64int/Config.pm, but that didn't
> > work either.
> >
> > Any other thoughts? Rebuild perl from source?
>
> Always the best option IMHO. Build perl on the machine it will be
> running on, with the compiler you intend to build extensions
> with. Much less hassle.
I did this and things are working. Thanks everybody for the help.
Mike
------------------------------
Date: Tue, 10 Feb 2004 00:46:22 +0000 (UTC)
From: stratus <gis86508@cissol1.cis.nctu.edu.tw>
Subject: Encrypt and Decrypt for text ...
Message-Id: <c099ku$166k$1@news.cis.nctu.edu.tw>
Is there any share tools in Unix,or even in PERL for encrypting the
ascii text to binary or anything else and decrypting it to ascii text.
Thanks a lot !!!
Or can tell me how to do it !!
------------------------------
Date: Mon, 09 Feb 2004 18:31:37 -0600
From: David Dyer-Bennet <dd-b@dd-b.net>
Subject: Re: glob in perl
Message-Id: <m2ptcn93me.fsf@gw.dd-b.net>
Ben Morrow <usenet@morrow.me.uk> writes:
> David Dyer-Bennet <dd-b@dd-b.net> wrote:
>> Ben Morrow <usenet@morrow.me.uk> writes:
>> >
>> > Because that's what glob does! RTFM.
>>
>> I just went back and R the FM again, including going down into perlop
>> from the mention in perlfunc, and it *still* doesn't document this
>> behavior or show any examples of it.
>
> True... the nearest perlfunc comes to it is 'as /bin/csh would do',
> which I guess implies split-on-whitespace, but most of us are
> (thankfully) not familiar with csh!
>
> However, at least the 5.8 perlfunc also points to File::Glob, which
> explicitly explains it in the second para.
There is a reference to that in 5.6.1 as well.
--
David Dyer-Bennet, <mailto:dd-b@dd-b.net>, <http://www.dd-b.net/dd-b/>
RKBA: <http://noguns-nomoney.com> <http://www.dd-b.net/carry/>
Photos: <dd-b.lighthunters.net> Snapshots: <www.dd-b.net/dd-b/SnapshotAlbum/>
Dragaera/Steven Brust: <http://dragaera.info/>
------------------------------
Date: Tue, 10 Feb 2004 01:19:18 -0000
From: Dan Zerkle <dan.NOzerkle@SPAMoracle.PLEASEcom>
Subject: How to time out TCP read with Windows?
Message-Id: <Xns948AB041C843Fdzerklepryankstersor@216.168.3.44>
I have a perl script on Windows that expects to read some data through a
TCP connection that it has established. However, if the other end doesn't
supply enough data for the recv call, the whole thing hangs (yuck!).
I want to time out the read after a few seconds. If I were using Unix, I'd
be using alarm and signal handlers to handle this. However, I have to use
Windows for this, and Perl under Windows doesn't seem to have a working
alarm function. I tried the Time:: module, but I couldn't get that to
work, either.
I'm using the latest version of ActivePerl for Windows. I don't need to
use a portable method.
Anyone know how to do this?
------------------------------
Date: Tue, 10 Feb 2004 01:25:52 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: How to time out TCP read with Windows?
Message-Id: <c09bv0$cnm$2@wisteria.csv.warwick.ac.uk>
Dan Zerkle <dan.NOzerkle@SPAMoracle.PLEASEcom> wrote:
> I have a perl script on Windows that expects to read some data through a
> TCP connection that it has established. However, if the other end doesn't
> supply enough data for the recv call, the whole thing hangs (yuck!).
>
> I want to time out the read after a few seconds. If I were using Unix, I'd
> be using alarm and signal handlers to handle this. However, I have to use
> Windows for this, and Perl under Windows doesn't seem to have a working
> alarm function. I tried the Time:: module, but I couldn't get that to
> work, either.
>
> I'm using the latest version of ActivePerl for Windows. I don't need to
> use a portable method.
>
> Anyone know how to do this?
Use non-blocking reads and a select loop till you've got it all. Put a
timeout on the select, so you don't wait forever.
Ben
--
"If a book is worth reading when you are six, * ben@morrow.me.uk
it is worth reading when you are sixty." - C.S.Lewis
------------------------------
Date: 10 Feb 2004 01:18:10 GMT
From: ctcgag@hotmail.com
Subject: Re: memory profiling
Message-Id: <20040209201810.153$pd@newsreader.com>
Jaap Karssenberg <j.g.karssenberg@student.utwente.nl> wrote:
> Does anyone know of a simple way to see where the memory goes in a large
> perl application ?
Depends on how modular the application is.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service New Rate! $9.95/Month 50GB
------------------------------
Date: 9 Feb 2004 23:20:15 GMT
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Perl project update
Message-Id: <eepi2095gv10o3d8co16pupml8mrf9vemm@4ax.com>
On Mon, 09 Feb 2004 13:23:12 GMT, "edgrsprj" <edgrsprj@ix.netcom.com>
wrote:
>"Keith Keller" <kkeller-usenet@wombat.san-francisco.ca.us> wrote in message
>news:7d960c.k0d.ln@goaway.wombat.san-francisco.ca.us...
>
>> On 2004-02-08, edgrsprj <edgrsprj@ix.netcom.com> wrote:
>> > For example, if a Windows Notepad text file window was being displayed
>>> the program would need to be able to read information from and write
>>> information to that screen.
>>
>> That's amazingly silly. Why Notepad? Why not just take a filename as
>> input and output to another file and/or STDOUT? Something like
>
>The following is one of the most important reasons for developing this
>technology. And I am afraid that if you are not constantly involved with
One thing: in the rest of this post repeatedly refer to "this
technology", but do not explain what "this technology" really is. To
me it is -mostly- "using perl", which is fine, but a little bit too
generic...
>this type of work you really won't understand and appreciate its
>significance. These are personal opinions.
Wether these are personal opinions or not is not relevant: before
proceding I'll let you know in advance that the all of what you wrote
in the rest of your long post proves that you completely missed the
point brought out by Keith.
As a side note I'm sorry to say that the amount of hopefully
unintended trollish(-like) content reaches a local maximum in this
post amongst your recent ones.
>With a good percentage of the projects that I work on either as a
>professional or on my own, a mistaken number generated through calculations
>or moved from one location to another can in my opinion have fatal
>consequences, at times for sizeable numbers of people. And since a certain
OK
>amount of this work involves some of the most advanced research being done
>anywhere I often have no backup. There are no other people who can check
OK
[But... then you'd better develop (also) a "technology" to make
backups in a suitable way for your project.]
>the work in the time which is available. On occasion that time period may
>be and actually has been just a few hours.
OK
>When you deal with large amounts of technical data, especially seeming
>endless list of numbers it is virtually impossible to do numerous
>calculations by hand or to copy numbers manually from one place to another
>without making an error.
OK
>One of the most important reasons for developing this technology is the fact
>that it makes it possible to have a computer program perform routine number
>generation and transfer operations. And now that I have that computer
OK
[apart the fact that "this technology" seems to be tautologically
defined here in terms of using "a computer program perform routine
number generation and transfer operations", which is good, granted.
But tremendously generic and not particularly original/innovative as
an idea.]
>interface developed, if I have a report which contains a list of numbers in
>the middle of a report and I want to perform some calculation on them and
>store them in another column to the right of the first one I can write a
>simple Perl program which will read the number in the first column and print
>the new number in the second column. That is just one example.
OK
>It is true that spreadsheet programs and some word processing programs can
>be used to do things like that. But this approach is easier and faster.
OK
[But do you feel that somebody suggested you to use a spreadsheet and
a word processor instead of perl?!? If so, then you should read more
carefully: BTW, note that this shouldn't be particularly difficult.
Keith's cmt for example was just 3 or 4 lines of terse and clean
text.]
>And I feel that in many cases it produces better results. For example, you
>can watch as the numbers are generated and make immediate changes if that is
OK
>necessary. When you do file to file transfers that might not be possible.
Huh?!?
I'm not sure if I understand what you mean. Practically after having
said so much to the effect that doing "manual operations" is so error
prone wrt having a computer program to perform them, you say that
automatically automatically launching Notepad loaded with the
generated output is useful in terms of the possibility of doing manual
interventions. It seems rather contraddictory to me...
>As I said, unless you have applications such as that one which are important
>to you then you will probably not appreciate how valuable this type of
>technology can be.
I think it is *very* *very* hard for one how valauble this type of
technology can be unless one understands what "this technology" is.
What that is by no means obvious!
Said all those OKs to the various points above, one wonders what the
hell all this has to do with notepad and how using its "screen"
(Aarrrgggghhhhh!) instead of good 'ol files could be of any advantage.
I can't see how manipulating info from and to notepad (a particularly
crappy text editor, btw) could be any different from manipulating info
from file to file and opening notepad on the latter...
Michele
--
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
"perl bug File::Basename and Perl's nature"
------------------------------
Date: Mon, 09 Feb 2004 19:03:44 -0500
From: Harley Young <harley_young@hotmail.com>
Subject: Re: Site Visitor's eMail Address
Message-Id: <c09750$74$1@news.eusc.inter.net>
>> I teach Mathematics using Internet to secondary school students. I have
>> many students to whom I send emails on Monday, Wednesday, and Friday.
Or....just get the students to turn in their problems by email. Then you
know who does the problems AND you remove the burden of figuring out a
technical solution yourself.
/hsy
------------------------------
Date: 10 Feb 2004 01:26:03 GMT
From: ctcgag@hotmail.com
Subject: Re: substitution fails for long line
Message-Id: <20040209202603.919$C8@newsreader.com>
"Pranav Agarwal" <a__pranav@rediffmail.com> wrote:
>
> The problem I am facing is when i try to run my a.pl i.e.
> open(FH,"$ARGV[0]");
> while(<FH>){
> $x=$_;
> $len = length($_);
> print ("$len\n");
> $x =~ s/(\s*)(nothingtomatch)/$1/g;
> print $x;
> }
> My perl program hangs when the value for $_ is that particular long line.
> %perl a.pl x.1
> 20
> <H3>References</H3>
> 23646
> ^C (!!! HANGED !!!)
Is it spinning the CPU or is just sleeping?
What is the exact regex you are matching? If the regex engine
has to march back and forth over a very long line a very high number
of times, it may take a very long time to do it.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service New Rate! $9.95/Month 50GB
------------------------------
Date: Mon, 9 Feb 2004 23:09:15 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Why is Perl losing ground?
Message-Id: <c093ur$875$1@wisteria.csv.warwick.ac.uk>
lesley.b@zen.co.yuk wrote:
> To me, PHP looks like a scripting version of Perl in the same way ASP
> is a scripting version of VB.
Err... no. Perl is the scripting version of Perl. PHP is in no way
related, and some of the language concepts are quite different (no
distinction between arrays/hashes, no closures, no refs, no
namespacing, no anything that makes Perl what is is... :).
About the only similarites are that both have a 'scalar' variable type
that will autoconvert int<->float<->string and both signify these with
an initial '$' on the variable name.
> This is obvioulsy a huge generalisation and I'll freely admit, would
> probably hold less water than a colander if put seriously to the
> test.
Yup!
Ben
--
If you put all the prophets, | You'd have so much more reason
Mystics and saints | Than ever was born
In one room together, | Out of all of the conflicts of time.
ben@morrow.me.uk |----------------+---------------| The Levellers, 'Believers'
------------------------------
Date: Mon, 09 Feb 2004 18:23:05 -0500
From: Robert <bobx@linuxmail.org>
Subject: Re: Why is Perl losing ground?
Message-Id: <I5SdnWC_lv7Hi7XdRVn-uA@adelphia.com>
David Dyer-Bennet wrote:
<snip>
> PHP out-performs Perl by a tremendous margin in a shared hosting
> environment, which is where most sites are implemented. mod_perl
> doesn't isolate the various users enough to be very safe in a shared
> hosting environment, and you need mod_perl to get performance.
mod_php out-performs mod_perl? Really? Show me the tests...
------------------------------
Date: Tue, 10 Feb 2004 00:10:27 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Why is Perl losing ground?
Message-Id: <c097hj$ajg$1@wisteria.csv.warwick.ac.uk>
Robert <bobx@linuxmail.org> wrote:
> David Dyer-Bennet wrote:
> <snip>
> > PHP out-performs Perl by a tremendous margin in a shared hosting
> > environment, which is where most sites are implemented. mod_perl
> > doesn't isolate the various users enough to be very safe in a shared
> > hosting environment, and you need mod_perl to get performance.
>
> mod_php out-performs mod_perl? Really? Show me the tests...
No, he said mod_php outperforms CGI Perl (duh) and that he doesn't
trust mod_perl.
Ben
--
For the last month, a large number of PSNs in the Arpa[Inter-]net have been
reporting symptoms of congestion ... These reports have been accompanied by an
increasing number of user complaints ... As of June,... the Arpanet contained
47 nodes and 63 links. [ftp://rtfm.mit.edu/pub/arpaprob.txt] * ben@morrow.me.uk
------------------------------
Date: Tue, 10 Feb 2004 01:30:53 +0100
From: Tore Aursand <tore@aursand.no>
Subject: Re: Why is Perl losing ground?
Message-Id: <pan.2004.02.10.00.30.33.493427@aursand.no>
On Mon, 09 Feb 2004 16:32:59 -0600, David Dyer-Bennet wrote:
>> As a programmer who is addicted to Perl, I am curious as to why Perl is
>> losing ground to another bunch of languages, namely: Python, PHP and
>> Ruby. I'd like to hear your opinions. Is Perl just not "trendy"
>> anymore? Does it still scare programmers who haven't used it? Or do the
>> other languages have any major advantages over Perl? I haven't worked
>> in these other languages, so I'm not qualified to have much of an
>> opinion here. What do you think?
> PHP out-performs Perl by a tremendous margin in a shared hosting
> environment, which is where most sites are implemented. mod_perl
> doesn't isolate the various users enough to be very safe in a shared
> hosting environment, and you need mod_perl to get performance.
Well. What you _actually_ is trying to say, is that:
a) mod_php is faster than CGI
b) You don't trust mod_perl
Now. Do _you_ see how smart your statement was? :)
--
Tore Aursand <tore@aursand.no>
"Scientists are complaining that the new "Dinosaur" movie shows
dinosaurs with lemurs, who didn't evolve for another million years.
They're afraid the movie will give kids a mistaken impression. What
about the fact that the dinosaurs are singing and dancing?" -- Jay
Leno
------------------------------
Date: Mon, 09 Feb 2004 18:32:47 -0600
From: David Dyer-Bennet <dd-b@dd-b.net>
Subject: Re: Why is Perl losing ground?
Message-Id: <m2llnb93kg.fsf@gw.dd-b.net>
Robert <bobx@linuxmail.org> writes:
> David Dyer-Bennet wrote:
> <snip>
>> PHP out-performs Perl by a tremendous margin in a shared hosting
>> environment, which is where most sites are implemented. mod_perl
>> doesn't isolate the various users enough to be very safe in a shared
>> hosting environment, and you need mod_perl to get performance.
>
> mod_php out-performs mod_perl? Really? Show me the tests...
mod_php is usable in a shard hosting environment. mod_perl
essentially is not; at least that seems to be the consensus of most of
the places selling shared hosting, and reading about it, it does seem
that you don't have adequate isolation between virtual users in
mod_perl.
--
David Dyer-Bennet, <mailto:dd-b@dd-b.net>, <http://www.dd-b.net/dd-b/>
RKBA: <http://noguns-nomoney.com> <http://www.dd-b.net/carry/>
Photos: <dd-b.lighthunters.net> Snapshots: <www.dd-b.net/dd-b/SnapshotAlbum/>
Dragaera/Steven Brust: <http://dragaera.info/>
------------------------------
Date: Mon, 09 Feb 2004 18:33:18 -0600
From: David Dyer-Bennet <dd-b@dd-b.net>
Subject: Re: Why is Perl losing ground?
Message-Id: <m2hdxz93jl.fsf@gw.dd-b.net>
Ben Morrow <usenet@morrow.me.uk> writes:
> Robert <bobx@linuxmail.org> wrote:
>> David Dyer-Bennet wrote:
>> <snip>
>> > PHP out-performs Perl by a tremendous margin in a shared hosting
>> > environment, which is where most sites are implemented. mod_perl
>> > doesn't isolate the various users enough to be very safe in a shared
>> > hosting environment, and you need mod_perl to get performance.
>>
>> mod_php out-performs mod_perl? Really? Show me the tests...
>
> No, he said mod_php outperforms CGI Perl (duh) and that he doesn't
> trust mod_perl.
Well, mostly. I trust mod_perl just fine, so long as I'm the only
user.
--
David Dyer-Bennet, <mailto:dd-b@dd-b.net>, <http://www.dd-b.net/dd-b/>
RKBA: <http://noguns-nomoney.com> <http://www.dd-b.net/carry/>
Photos: <dd-b.lighthunters.net> Snapshots: <www.dd-b.net/dd-b/SnapshotAlbum/>
Dragaera/Steven Brust: <http://dragaera.info/>
------------------------------
Date: Tue, 10 Feb 2004 00:14:42 GMT
From: "Ala Qumsieh" <xxala_qumsiehxx@xxyahooxx.com>
Subject: Re: Why references??
Message-Id: <SnVVb.23127$gO4.17814@newssvr25.news.prodigy.com>
"Malcolm Dew-Jones" <yf110@vtn1.victoria.tc.ca> wrote in message
news:40280649@news.victoria.tc.ca...
> I prefer
> $my_hash{$item}
>
> but someone else might prefer
>
> $my_hash->{$item}
errr .. those two are not the same.
> It makes no difference to the interpreter, so use which ever style you
> prefer (they are different of course, it just doesn't _make_ any
> difference).
I don't understand how two different things don't make any difference (not
sure if the sentence itself makes sense, though).
> If the program has other references (that are needed) that using
> references everywhere might also make the program more consistent,
> stylisticly.
Agreed.
> $myhash1->{$item}
> $myhash2->{$item}
> $myhash3{$item} # huh, why is this different?
Maybe because $myhash1 and $myhash2 are references to hashes, while $myhash3
doesn't exist, and %myhash3 is a normal hash?
--Ala
------------------------------
Date: Tue, 10 Feb 2004 00:26:43 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Why references??
Message-Id: <c098g3$be7$1@wisteria.csv.warwick.ac.uk>
"Ala Qumsieh" <xxala_qumsiehxx@xxyahooxx.com> wrote:
> "Malcolm Dew-Jones" <yf110@vtn1.victoria.tc.ca> wrote in message
> news:40280649@news.victoria.tc.ca...
>
> > I prefer
> > $my_hash{$item}
> >
> > but someone else might prefer
> >
> > $my_hash->{$item}
>
> errr .. those two are not the same.
<snip>
> > $myhash1->{$item}
> > $myhash2->{$item}
> > $myhash3{$item} # huh, why is this different?
>
> Maybe because $myhash1 and $myhash2 are references to hashes, while $myhash3
> doesn't exist, and %myhash3 is a normal hash?
You're missing the point. If you want to use a hash, you can either
create it thus
my %hash = (
key => $value,
);
and use it thus
$hash{key};
or you can create it thus
my $hash = {
key => $value;
};
and use it thus
$hash->{key};
. Which you choose makes no difference to the outcome of the program.
Ben
--
If I were a butterfly I'd live for a day, / I would be free, just blowing away.
This cruel country has driven me down / Teased me and lied, teased me and lied.
I've only sad stories to tell to this town: / My dreams have withered and died.
ben@morrow.me.uk <=>=<=>=<=>=<=>=<=>=<=>=<=>=<=>=<=>=<=>=<=> (Kate Rusby)
------------------------------
Date: Tue, 10 Feb 2004 00:44:31 GMT
From: "Ala Qumsieh" <xxala_qumsiehxx@xxyahooxx.com>
Subject: Re: Why references??
Message-Id: <PPVVb.23131$c45.15440@newssvr25.news.prodigy.com>
"Ben Morrow" <usenet@morrow.me.uk> wrote in message
news:c098g3$be7$1@wisteria.csv.warwick.ac.uk...
> You're missing the point.
Hmm .. I think you're right. Thanks.
> . Which you choose makes no difference to the outcome of the program.
Then let me throw in my two cents, just to contribute (hopefully)
constructively to this thread.
I'm paranoid about the tiny fraction of a millisecond that it takes to
dereference a reference. So, I tend to avoid references wherever I can. The
exception comes when passing parameters to/returning values from
subroutines. Then, I'm more paranoid about the amount of time it takes to
push/pop values onto the stack.
And, sometimes references are unavoidable, such as when dealing with
multi-dim structures and objects. In some situations, using references can
give more succinct and elegant code. Elegance tends to drive many of my
coding choices. Alas, it's in the eye of the beholder, so your standards
might vary.
Bottom line to OP: do whatever feels more natural to you.
--Ala
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 6103
***************************************