[16725] in Perl-Users-Digest
Perl-Users Digest, Issue: 4137 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 26 00:10:36 2000
Date: Fri, 25 Aug 2000 21:10:20 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <967263019-v9-i4137@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 25 Aug 2000 Volume: 9 Number: 4137
Today's topics:
redirect to FTP? fperkins@my-deja.com
Re: redirect to FTP? (Martien Verbruggen)
Re: redirect to FTP? <jhelman@wsb.com>
RegEx problem <derek@realware.com.au>
Re: RegEx problem <jhelman@wsb.com>
Re: RegEx problem <derek@realware.com.au>
Regexp Question cghawthorne@yahoo.com
Re: Regexp Question (Tony L. Svanstrom)
Re: Regexp Question <jlhelman@home.com>
Re: Remote Search Engine (Abigail)
Re: Searching an Array of Hashes <smerr612@mailandnews.com>
Re: Searching an Array of Hashes <smerr612@mailandnews.com>
Re: Searching an Array of Hashes <mauldin@netstorm.net>
searching client site cookie script or tutorial.. <danielxx@bart.nl>
Re: selling perl to management (Steve Leibel)
Re: selling perl to management <ren.maddox@tivoli.com>
Re: selling perl to management <mjcarman@home.com>
Re: selling perl to management <mjcarman@home.com>
Slideshow with backgounrd music? (bowmah)
Re: Slideshow with backgounrd music? <lauren_smith13@hotmail.com>
Re: Stumped by Reg Exp Problem - help?? <elijah@workspot.net>
Re: Stumped by Reg Exp Problem - help?? (Keith Calvert Ivey)
Re: stupid question probably (Martien Verbruggen)
Re: stupid question probably (Abigail)
Re: Win32 Registry and IP addresses. (Keith Calvert Ivey)
Re: Wrong @INC in Apache <bop@mypad.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 26 Aug 2000 01:42:57 GMT
From: fperkins@my-deja.com
Subject: redirect to FTP?
Message-Id: <8o77au$5cn$1@nnrp1.deja.com>
I'm trying to redirect to an FTP site by doing:
# myperlscript.cgi
<snip>
print "Content-type: text/html \n";
print "Location: ftp://www.somesite.com/\n\n";
</snip>
In NS v4.7 it works fine, however, in IE 5.x, I get a msg popup:
"Internet Explorer cannot open the Internet site
http://www.site.com/myperlscript.cgi?file=test
A redirection problem has occured."
I searched deja to no avail. Any suggestions?
TIA,
Frank
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 26 Aug 2000 12:03:15 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: redirect to FTP?
Message-Id: <slrn8qe9b3.5ap.mgjv@martien.heliotrope.home>
On Sat, 26 Aug 2000 01:42:57 GMT,
fperkins@my-deja.com <fperkins@my-deja.com> wrote:
> I'm trying to redirect to an FTP site by doing:
Nothing in your post is Perl specific. If you use a shell language, C,
Fortran or Cobol to output the stuff you make Perl output, the problem
would be exactly the same.
You will most likely have much more success if you ask in a group that
knows and cares about HTTP, CGI, web browsers and servers, and their
various bugginess. Somewhere in the comp.infosystems.www.* hierarchy you
will find the appropriate group.
We talk about Perl here. Not about all the things that you can do with
Perl.
Martien
PS. Followups set to prevent unnecessary clueless discussion about this
subject.
--
Martien Verbruggen | My friend has a baby. I'm writing
Interactive Media Division | down all the noises the baby makes
Commercial Dynamics Pty. Ltd. | so later I can ask him what he meant
NSW, Australia | - Steven Wright
------------------------------
Date: Sat, 26 Aug 2000 02:25:08 GMT
From: Jeff Helman <jhelman@wsb.com>
Subject: Re: redirect to FTP?
Message-Id: <39A72AF9.F247A6D8@wsb.com>
fperkins@my-deja.com wrote:
>
> I'm trying to redirect to an FTP site by doing:
>
> # myperlscript.cgi
>
> <snip>
>
> print "Content-type: text/html \n";
> print "Location: ftp://www.somesite.com/\n\n";
>
> </snip>
>
> In NS v4.7 it works fine, however, in IE 5.x, I get a msg popup:
>
> "Internet Explorer cannot open the Internet site
> http://www.site.com/myperlscript.cgi?file=test
>
> A redirection problem has occured."
>
> I searched deja to no avail. Any suggestions?
>
Several. One, direct this to the proper newsgroup. This has nothing to
do with Perl. Try a CGI newsgroup.
Two, read the HTTP specification. You are returning an invalid header
combination. The "Location" header is only valid in 3xx code
(redirection) responses. Read
http://www.w3.org/Protocols/rfc1945/rfc1945 to start.
Three, replace your Content-type line with "Status: 302 Get Outta
Here!\n"
> TIA,
You're welcome.
>
> Frank
>
JH
------------------------------
Date: Sat, 26 Aug 2000 12:56:13 +1000
From: Derek Lavine <derek@realware.com.au>
Subject: RegEx problem
Message-Id: <MPG.1411dccbf93dc0e0989683@news.hutch.com.au>
Hi all,
I have a small regex question
I am looping through a set of data and field names. The data is in
@fieldData and the loop that loops through the fieldNames contains
$text =~ s/$_/$fieldData[$i]/ge;
The problem is, that $_ is not getting evaluated so the patern match is
being performed against $_ literally rather than what $_ contains. I need
to know how to get it to match against the content of $_
Thanks very much
Derek
------------------------------
Date: Sat, 26 Aug 2000 03:15:11 GMT
From: Jeff Helman <jhelman@wsb.com>
Subject: Re: RegEx problem
Message-Id: <39A736B4.3F237AC6@wsb.com>
Derek Lavine wrote:
>
> Hi all,
>
> I have a small regex question
>
> I am looping through a set of data and field names. The data is in
> @fieldData and the loop that loops through the fieldNames contains
>
> $text =~ s/$_/$fieldData[$i]/ge;
>
> The problem is, that $_ is not getting evaluated so the patern match is
> being performed against $_ literally rather than what $_ contains. I need
> to know how to get it to match against the content of $_
>
I suspect one of two things is happending, either you are using some
ancient buggy incarnation of Perl or there is something you aren't
telling us.
To check case 1, type "perl -v" on the command line. If you aren't
running at least 5.005, then that may solve your problem.
To illustrate, this works just fine:
$Var = "foobar";
$_ = foo;
$Val[1] = "bar";
$Var =~ s/$_/$Val[1]/ge;
print "$Var\n";
Prints: "barbar" and a newline under 5.6.0
To check the second potential problem, post a real code snippet. Since
I can't reproduce your problem, I can't help.
Sorry,
JH
------------------------------
Date: Sat, 26 Aug 2000 13:32:11 +1000
From: Derek Lavine <derek@realware.com.au>
Subject: Re: RegEx problem
Message-Id: <MPG.1411e547c73e609f989684@news.hutch.com.au>
Jeff,
Thanks for your time and my apologies I just noticed I had a logic bug in
my code that was causing the problem and I had just assumed that the
regex was the problem. Sorry about that, I must have had too many beers
last night ;-)
Derek
In article <39A736B4.3F237AC6@wsb.com>, jhelman@wsb.com says...
> Derek Lavine wrote:
> >
> > Hi all,
> >
> > I have a small regex question
> >
> > I am looping through a set of data and field names. The data is in
> > @fieldData and the loop that loops through the fieldNames contains
> >
> > $text =~ s/$_/$fieldData[$i]/ge;
> >
> > The problem is, that $_ is not getting evaluated so the patern match is
> > being performed against $_ literally rather than what $_ contains. I need
> > to know how to get it to match against the content of $_
> >
> I suspect one of two things is happending, either you are using some
> ancient buggy incarnation of Perl or there is something you aren't
> telling us.
>
> To check case 1, type "perl -v" on the command line. If you aren't
> running at least 5.005, then that may solve your problem.
>
> To illustrate, this works just fine:
>
> $Var = "foobar";
> $_ = foo;
> $Val[1] = "bar";
> $Var =~ s/$_/$Val[1]/ge;
> print "$Var\n";
>
> Prints: "barbar" and a newline under 5.6.0
>
> To check the second potential problem, post a real code snippet. Since
> I can't reproduce your problem, I can't help.
>
> Sorry,
> JH
>
------------------------------
Date: Sat, 26 Aug 2000 01:25:15 GMT
From: cghawthorne@yahoo.com
Subject: Regexp Question
Message-Id: <8o769c$4c4$1@nnrp1.deja.com>
Hi!
I have a question on constructing a regexp. I'm designing a CGI script
that will need to take an image file name
(/home/person/public_html/img.gif)
and translate it to something that can be used in an <img> tag
(example.com/~person/img.gif). The easiest way I can think of to do
this is to use a regexp to return everything from the last "/" on and
deal with it from there.
Any ideas would be appreciated!
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 26 Aug 2000 04:00:07 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: Regexp Question
Message-Id: <1efydiu.1v21lc1upmx4aN%tony@svanstrom.com>
<cghawthorne@yahoo.com> wrote:
> I have a question on constructing a regexp. I'm designing a CGI script
> that will need to take an image file name
> (/home/person/public_html/img.gif)
> and translate it to something that can be used in an <img> tag
> (example.com/~person/img.gif). The easiest way I can think of to do
> this is to use a regexp to return everything from the last "/" on and
> deal with it from there.
>
> Any ideas would be appreciated!
This simply removes what you know shouldn't be there, that way you won't
have any problems using subfolders; if you ever want to do that:
s!/home/person/public_html!!;
but, to solve your problem completly (the way it is in your posting,
personally I'd let the webbrowser sort out what domain to use, when that
is possible):
s!/home/person/public_html!http://example.com/~person!;
/Tony
--
/\___/\ Who would you like to read your messages today? /\___/\
\_@ @_/ Protect your privacy: <http://www.pgpi.com/> \_@ @_/
--oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
on the verge of frenzy - i think my mask of sanity is about to slip
---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
\O/ \O/ ©99-00 <http://www.svanstrom.com/?ref=news> \O/ \O/
------------------------------
Date: Sat, 26 Aug 2000 02:21:11 GMT
From: Jeff Helman <jlhelman@home.com>
Subject: Re: Regexp Question
Message-Id: <39A72A0C.237BC6DA@wsb.com>
cghawthorne@yahoo.com wrote:
>
> Hi!
Greetings.
>
> I have a question on constructing a regexp. I'm designing a CGI script
> that will need to take an image file name
> (/home/person/public_html/img.gif)
> and translate it to something that can be used in an <img> tag
> (example.com/~person/img.gif). The easiest way I can think of to do
> this is to use a regexp to return everything from the last "/" on and
> deal with it from there.
>
> Any ideas would be appreciated!
>
If we can assume that you are running Apache on some flavor of /*+nix/,
then the following should work (diddle as needed):
my $Image = "/home/person/public_html/img.gif";
$Image =~ s!^/home/!www.someserver.com/~!;
Thus, the regex strips "/home/" and replaces it with the Apache URL for
the home directory of whomever.
Hope this helps.
JH
------------------------------
Date: 26 Aug 2000 02:46:08 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Remote Search Engine
Message-Id: <slrn8qebq3.tj3.abigail@alexandra.foad.org>
BB (wiburton@yahoo.com) wrote on MMDLI September MCMXCIII in
<URL:news:H_Bp5.31436$Ok.23685@ralph.vnet.net>:
)) I'm looking for a customizable search engine that will slurp all of the
)) search results from other search engines, pages 1 through N.
))
)) Tips, please?
Yeah, first ask permission of the other search engines.
Abigail
--
perl -Mstrict -we '$_ = "goto H.print chop;\n=rekcaH lreP rehtona tsuJ";H1:eval'
------------------------------
Date: Fri, 25 Aug 2000 21:57:35 GMT
From: Steven Merritt <smerr612@mailandnews.com>
Subject: Re: Searching an Array of Hashes
Message-Id: <8o6q44$mnv$1@nnrp1.deja.com>
In article <39A6D976.D1B7D08A@netstorm.net>,
Jim Mauldin <mauldin@netstorm.net> wrote:
> Steven Merritt wrote:
> >
>
> > if (($From_Date ge $DataLine->{Timestamp}) &&
> > ($To_Date le $DataLine->{Timestamp})){
> >
> > my $From_Date = '19991001091612';
> > my $To_Date = '20000603111734';
>
> The condition can never be true with these values of $From_Date and
> $To_Date.
Grr, I always feel like a damn fool when I post something with a little
logical error like this. This particular time I'll plead an excuse
though. Originally $From_Date and $To_Date were reversed as the naming
convention for the logfiles was to be
YoungestRecordTimestamp-OldestRecordTimestamp.log But when the admin
actually changed the filenames in our log archives, he reversed this so
I now have files with the
OldestRecordTimestamp-YoungestRecordTimestamp.log naming convention.
This has played hell with me before. I thought I had caught all these
errors though. I apologize for wasting your time, and appreciate the
input.
Steven
--
King of Casual Play
The One and Only Defender of Cards That Blow
My newsreader limits sigs to four lines, but I cleverly bypassed this by
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 25 Aug 2000 22:13:32 GMT
From: Steven Merritt <smerr612@mailandnews.com>
Subject: Re: Searching an Array of Hashes
Message-Id: <8o6r1r$np8$1@nnrp1.deja.com>
In article <39A6D7AE.1F39C179@vpservices.com>,
Jeff Zucker <jeff@vpservices.com> wrote:
> Steven Merritt wrote:
> >
> > I've got an array of hashes(well, hashrefs actually) and I've got
> > several variables I need to use to search this array and decide to
fill
> > another array @Matches with the proper records.
>
> You have made a good start at reinventing the wheel on this, but since
> all of your operations are standard database operations you should
> probably just use datbase access methods. With DBD::RAM you can
create
> your database either from a file (in almost any format), or directly
> from your array (or actually your reference to an array of hashrefs).
> You can then use SQL queries on it. Here's a simple example, all you
> need to do to make it work on your data is substitute in your array
for
> the data_source, change the col_names to match your column headings,
and
> use any number of SQL queries (combinations of AND, OR, NOT as per
your
> examples):
I've been keeping an eye on the DBD::RAM module via the dbi-users list.
At the moment we don't have it installed on these machines, but I'll
keep it in mind when we do a full re-write of this logging utility in a
couple months. Our first implulse, and probably our best option, is to
go with an Oracle back-end with PerlTk front-end and a DBI middle, but
if this proves to be too resource intensive/impractical then we'll
consider keeping our current flat-file scheme and using something like
DBD::RAM. At the moment I'm pushing Oracle because our PHB's can run
Crystal Reports against it and I won't have to write a new search
function every time they want to do something new with the data.
Steven
--
King of Casual Play
The One and Only Defender of Cards That Blow
My newsreader limits sigs to four lines, but I cleverly bypassed this by
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 25 Aug 2000 23:02:37 GMT
From: Jim Mauldin <mauldin@netstorm.net>
Subject: Re: Searching an Array of Hashes
Message-Id: <39A6FA84.E6F7C43@netstorm.net>
Steven Merritt wrote:
>
> Grr,
I can relate - familiar sound (around here, anyway) of hand slapping
forehead
> I apologize for wasting your time
You didn't. On the contrary, you're helping me become a better Perl
programmer.
Have fun,
-- Jim
------------------------------
Date: Fri, 25 Aug 2000 22:25:12 GMT
From: "Daniel van den Oord" <danielxx@bart.nl>
Subject: searching client site cookie script or tutorial..
Message-Id: <cnCp5.32421$Gd1.175022@Typhoon.bART.nl>
I have made a site with a login script written in perl and a MySQL Database.
I want to be able to store the username and password client sided.. and
everytime he gets on my page the cookies will be loaded so he doesn't have
to login every time.... (advantages are also the person can be recognized as
a member and directly be redirected to another site..)
I've been looking for this but all I could find was this (for me) unclear
document in the perl FAQ.. and some html cookie examples.. (I don't want
that I need the perl variants.. storing 2 variables $username and
$password...
I would be greatfull if somebody could give me a hint !!!
------------------------------
Date: Fri, 25 Aug 2000 15:11:55 -0700
From: stevel@bluetuna.com (Steve Leibel)
Subject: Re: selling perl to management
Message-Id: <stevel-2508001512240001@192.168.100.2>
In article <8o6p88$g32$1@provolone.cs.utexas.edu>, logan@cs.utexas.edu
(Logan Shaw) wrote:
> In article <8o621i$ojp$1@nnrp1.deja.com>, <reg_exp@my-deja.com> wrote:
> >* perl code is about 10 times smaller than the c code
> >
> >i now need to make a presentation to the senior management to get them
> >to accept perl. the initial response i got was:
> >
> >* perl is tough to read, tough to maintain
> >* it's going to be tough getting people to maintain perl code and tough
> >to train people in perl.
>
> I think first of all you want to establish in a concrete way why Perl
> is better for the job. The fact that the code is 10 times shorter in
> perl is a very important point. More lines of code generally means
> more work to maintain. You might even try to take a real world example
> and show the C code necessary to solve the problem vs. the perl code.
>
> For example, splitting a string on whitespace in C takes multiple calls
> to strtok() allocation and copying of strings all inside loop plus
> allocation of an array. The same thing in perl is a single call to
> split(). Such an example might not only demonstrate to them how much
> simpler the Perl solution is but also might convince them that the Perl
> solution might be *easier* to understand.
>
> Second, I'd try to explain that Perl isn't maybe as exotic as they
> think. You might cite the 3rd State of the Onion article at
> http://www.perl.com/pub/1999/08/onion/talk1.html , which mentions that
> according to their measurements of traffic on dice.com, Perl job
> postings are more numerous than Visual Basic, second only to C++ and
> Java.
>
> If possible, it might also be a good idea to be more concrete than
> that. Giving them a list of resources of where you can get perl
> programmers and perl training would be helpful. Tell them about
> recruiters, web sites, personal contacts, and anything else you can
> think of that is a resource for finding Perl people.
>
> Above all, I'd say try to figure out what their concerns are and figure
> out whether they're valid. If they are, then consider whether the pros
> outweigh the cons and explain why you think they do if they do. If
> they're not valid, try to explain what the misconceptions are.
Management is right to be concerned.
Say you have a production system running Perl 5.005_xx and you want to
upgrade to 5.6. Management will rightly ask, "Is it likely to break
things and thereby knock down our production system and thereby cost the
company revenue?"
And if you are an honest engineer you must answer, "Yes. Perl upgrades
are generally messy. The Perl community regards new features as more
important than guaranteed backward compatability. Moreover, the Perl
community is insistent in its position that standardizing the language is
evil. No one can even guarantee that "while" loops will be part of the
language in the future. There is no such thing as a Perl language
standard. The language is defined as whatever the developers release.
And if it breaks last week's version, that's a problem, but it's not their
problem."
And management will rightly conclude that C++ or Java are better choices
from the standpoint of production stability, which equates to revenue.
Consider a ommon question on this newsgroup: "How do I build the most
efficient regexp to do such-and-so?" The problem is that it's easy to
write very clever Perl that is very difficult for other programmers to
understand. The more clever the Perl programmer, the more
incomprehensible the code. As is often pointed out, there is no need for
an obfuscated Perl contest.
From the standpoint of corporate management, every line of code you write
must live for ten years or more, and must be maintained by many
programmers long after you're gone, and must survive countless upgrades of
both the Perl interpreter and the underlying operating system.
Perl has a low cost of development but a high cost of maintenance. This
is what concerns management.
The best way to introduce Perl into a large project is as a design
prototyping language. Because you can get code running quickly in Perl,
you can use Perl to bring up a proof-of-concept system and work out your
object heirarchy and other elements of the design. That's the best use of
Perl in large systems and it's the best way to sell Perl into large
software environments.
As far as the beauty of split(), and the while (<filehandle>) syntax and
all the rest, I agree, these are wonderful productivity features. But
productivity during development is only part of the overall cost of
software. When you consider the cost of code over the lifetime of the
code, maintainability and stability across multiple releases become much
more important, and that's why management doesn't like Perl.
Steve L
------------------------------
Date: 25 Aug 2000 18:52:27 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: selling perl to management
Message-Id: <m3hf886gqs.fsf@dhcp11-177.support.tivoli.com>
stevel@bluetuna.com (Steve Leibel) writes:
> Management is right to be concerned.
>
> Say you have a production system running Perl 5.005_xx and you want to
> upgrade to 5.6. Management will rightly ask, "Is it likely to break
> things and thereby knock down our production system and thereby cost the
> company revenue?"
>
> And if you are an honest engineer you must answer, "Yes. Perl upgrades
> are generally messy. The Perl community regards new features as more
> important than guaranteed backward compatability. Moreover, the Perl
> community is insistent in its position that standardizing the language is
> evil. No one can even guarantee that "while" loops will be part of the
> language in the future. There is no such thing as a Perl language
> standard. The language is defined as whatever the developers release.
> And if it breaks last week's version, that's a problem, but it's not their
> problem."
>
> And management will rightly conclude that C++ or Java are better choices
> from the standpoint of production stability, which equates to revenue.
Careful there -- Java is certainly still evolving and there is no
guarantee that all existing code will work correctly with a new
compiler, or even that existing byte-code will work correctly on a new
JVM. It may not be as likely to break as when changing versions of
Perl, but it can still break, so in truth, the same caution must be
used when changing compilers or virtual machines as when changing
versions of Perl.
> Consider a ommon question on this newsgroup: "How do I build the most
> efficient regexp to do such-and-so?" The problem is that it's easy to
> write very clever Perl that is very difficult for other programmers to
> understand. The more clever the Perl programmer, the more
> incomprehensible the code. As is often pointed out, there is no need for
> an obfuscated Perl contest.
Of course "clever" and "skilled" are not necessarily the same thing.
Using Perl does not force obfuscated code any more than using C++ or
Java forces clear code. It requires discipline and coding standards
to achieve those things, and those can be applied just as well in any
language.
> From the standpoint of corporate management, every line of code you write
> must live for ten years or more, and must be maintained by many
> programmers long after you're gone, and must survive countless upgrades of
> both the Perl interpreter and the underlying operating system.
Upgrading the operating system is just as likely to break a C++
program as a Perl program. Probably true for Java as well with the
added piece that upgrading the JVM introduces an extra variable.
> Perl has a low cost of development but a high cost of maintenance. This
> is what concerns management.
Perl may have a perceived high cost of maintenance, but that doesn't
make it true.
> The best way to introduce Perl into a large project is as a design
> prototyping language. Because you can get code running quickly in Perl,
> you can use Perl to bring up a proof-of-concept system and work out your
> object heirarchy and other elements of the design. That's the best use of
> Perl in large systems and it's the best way to sell Perl into large
> software environments.
In my experience, the best way to introduce Perl into a large project
is to have respected Engineers/Programmers inform management that it
is the right thing to do -- assuming that it is the right thing to do,
and by no means am I saying that Perl is always the right tool for the
job.
> As far as the beauty of split(), and the while (<filehandle>) syntax and
> all the rest, I agree, these are wonderful productivity features. But
> productivity during development is only part of the overall cost of
> software. When you consider the cost of code over the lifetime of the
> code, maintainability and stability across multiple releases become much
> more important, and that's why management doesn't like Perl.
I'm sure there are some managers that don't like Perl because they
believe this to be true, but I doubt it is the most common reason.
Rather, it is more likely FUD (Fear, Uncertainty and Doubt).
I've seen so much C and C++ code that is in such bad shape with such
poor programming, that I find it humorous that anyone would positively
associate maintainability with C++. Sure, you *can* write
maintainable code in C++, but it's not like it happens automatically.
I'll grant that Java avoids many of the larger pitfalls of C++, but it
certainly doesn't force you to write maintainable code.
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Sat, 26 Aug 2000 01:19:29 GMT
From: Michael Carman <mjcarman@home.com>
Subject: Re: selling perl to management
Message-Id: <39A71C33.99CE4DB3@home.com>
Steve Leibel wrote:
>
> Perl upgrades are generally messy.
Messier than compiler upgrades? Or switching compiler vendors? *Any*
change to hardware or software in a production environment is a
potential time bomb, but I think its unfair to characterize Perl as
being particularly bad. I've never written a script that failed to work
perfectly on newer versions. I've often had to tweak things to satisfy
the whims of a particular compiler. Of course, that's just my
experience. YMMV.
If you're really that paranoid, you can always keep an old version of
Perl around. Hell, my company still has version 4 available! I wouldn't
touch it with an electric llama-prod, but it's there in case some very
old, very important script might break under v5+.
> The Perl community regards new features as more important than
> guaranteed backward compatability.
Sorry, but I agree with this attitude (sort of). Backwards compatibility
is good, but attempting it perfectly and perpetually would eventually
lead to something incapable of growth and improvement, or even
maintenance. Actually, the Perl developers have tried very hard to
preserve compatibility. The early work on v6 is the first time they've
considered willfully breaking it, and part of Larry's requirement to
ease this pain is to provide a method of automatic translation. I'd say
that shows a pretty strong commitment to keeping existing scripts
working.
> And management will rightly conclude that C++ or Java are better
> choices from the standpoint of production stability, which equates
> to revenue.
Perhaps, but that's an oversimplification. What about the cost of
development environments? What if it takes twice as many man-hours to
write the code in another language? What if they need to support
multiple platforms?
> The problem is that it's easy to write very clever Perl that
> is very difficult for other programmers to understand. The
> more clever the Perl programmer, the more incomprehensible the
> code. As is often pointed out, there is no need for an obfuscated
> Perl contest.
I can write incomprehensible code in any language. :)
Perl's flexible syntax does make it possible to write messy programs. It
also makes it possible to write very clean programs.
Still, I hope that Abigail et. al. don't make a habit of writing in the
style they often show here.
> The best way to introduce Perl into a large project is as a design
> prototyping language. Because you can get code running quickly in
> Perl, you can use Perl to bring up a proof-of-concept system and
> work out your object heirarchy and other elements of the design.
And with a little luck, your prototype will work so well that it will
become the 'official' software.
> [P]roductivity during development is only part of the overall
> cost of software.
Yes, but it's one of the bigger costs. College educated programmers and
engineers aren't cheap.
> When you consider the cost of code over the lifetime of the
> code, maintainability and stability across multiple releases
> become much more important, and that's why management doesn't
> like Perl.
Poor code is poor code in any language. It's not difficult to write
maintainable Perl. Further, if development is rapid in Perl, why
shouldn't maintenance be as well? (Assuming well written/commented code
and proficient programmers, but that applies equally to any language.)
The ultimate question is always what's the right tool for the job. The
first sentence from the OP reads
: i am working on a project where we manipulate lots of
: text data that is in a structured format.
And to me, that just screams out for Perl.
-mjc
------------------------------
Date: Sat, 26 Aug 2000 01:47:26 GMT
From: Michael Carman <mjcarman@home.com>
Subject: Re: selling perl to management
Message-Id: <39A722C2.3B858775@home.com>
reg_exp@my-deja.com wrote:
>
> i am working on a project where we manipulate lots of text
> data that is in a structured format.
Sounds like a perfect job for Perl.
> i now need to make a presentation to the senior management to get them
> to accept perl. the initial response i got was:
>
> * perl is tough to read, tough to maintain
Well, Ada is easy to read, practically self-documenting. At least, until
you vary ever-so-slightly form what it thinks is kosher. Then you have
to go through such contortions that it becomes completely obscured.
I find that most Perl syntax is quite clear. Regex syntax is a little
bizarre, but it's entirely logical and easy to break into digestable
chunks. It's also not unique to Perl -- people with appropriate
backgrounds will understand s/foo/bar/ right off the bat. (vi anyone?)
> * it's going to be tough getting people to maintain perl code
> and tough to train people in perl.
Naw, assuming prior knowledge of programming a Perl newbie can be
writing small but useful programs in a day.
Maintainence is a concern with any language. I've had to bring together
C code that fragmented in three or four different directions under
multiple develpers. I ended up duct-taping it all together. I'm not
proud of it, but I didn't have the time to do a ground-up rewrite.
(Unfortunately, Perl wasn't suited for use there.)
I would point out to your management that Perl was created for text
manipulation. (Though it's grown far beyond that now.) The language has
many built-in features for text processing. While they may fear that
some of these features make for hard to read code, the truth is that
they allow for very consise code which is actually much clearer. This
makes maintainance *easier*. Yes, you have the overhead of learning this
syntax, but (to borrow from Logan's example) it's faster to learn
split() once and immediately recognize what one line of Perl is doing
than to have to recognize an entire construct in C.
-mjc
------------------------------
Date: Fri, 25 Aug 2000 23:35:49 GMT
From: bowmah@hotmail.com (bowmah)
Subject: Slideshow with backgounrd music?
Message-Id: <39a7027a.567816@news.telus.net>
I want to create a slide show of 20 photos and have music (midi
perhaps) background and dsiplay it via IE or netscape. What is the
easiest way to do this? I am not able to write computer languages but
I have edited a few perl scripts before. Any ideas?
Thanks
bowmah@hotmail.com
Bowmah
------------------------------
Date: Fri, 25 Aug 2000 18:06:27 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: Slideshow with backgounrd music?
Message-Id: <8o7536$nn0$1@brokaw.wa.com>
bowmah <bowmah@hotmail.com> wrote in message
news:39a7027a.567816@news.telus.net...
> I want to create a slide show of 20 photos and have music (midi
> perhaps) background and dsiplay it via IE or netscape. What is the
> easiest way to do this? I am not able to write computer languages but
> I have edited a few perl scripts before. Any ideas?
This is not usually done with Perl. You may want to ask in the
comp.infosystems.www.authoring.html.
Lauren
--
print grep ord $_,map{y/a-zA-Z//d;$x.="+ $_";chr(eval $x)}
'J74u43-s2tA1-84n33o45th1er5-12-P3e13-82r48l21H13-a6-76
c40k25er2wx8-y6z13-81'=~m#([^!\n]{3})#g#tr/-0-9//d;print
------------------------------
Date: 26 Aug 2000 03:32:04 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: Stumped by Reg Exp Problem - help??
Message-Id: <eli$0008252327@qz.little-neck.ny.us>
In comp.lang.perl.misc, jason <elephant@squirrelgroup.com> wrote:
> Eli the Bearded <elijah@workspot.net> wrote ..
> >I was under the impression that this was not an HTML document.
> >I don't want to think what kind of breakage HTML::Parser could
> >do to non-HTML documents. (Imagine an news or email followup
> >where the author used '<' instead of '>' to quote lines.)
>
> but the originator specifically said that some of the URLs are already
> contained within anchor tags .. that would suggest that it's an HTML
> document
It suggests to me that he is writing a filter, which may
sometimes be used for HTML and may sometimes be used for something else.
It might be my bias spoeaking, but the things
that often come to my mind for this sort of thing
are Usenet Posts, Email, and random <TEXTARA> content.
(Although accepting HTML in <TEXTAREA>s is a bad idea.)
Elijah
------
has seen html used in .sigs of plain text posts
------------------------------
Date: Sat, 26 Aug 2000 02:53:46 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Stumped by Reg Exp Problem - help??
Message-Id: <39ab2ec9.3404054@news.newsguy.com>
Eli the Bearded <elijah@workspot.net> wrote:
> s!(https?:// # scheme
> (?: [^:]+ (?: : [^@]+ )? @ ) ? # username/password
> (?: [a-z0-9] (?: [a-z0-9]+ | -[a-z0-9] )* \. )+ # hostname fragment
The RFCs do allow consecutive hyphens in domain names, and some
people apparently consider such names worth registering:
Registrar: Dotster (http://www.dotster.com)
Domain Name: GOT--MILK.COM
Created on: 22-JUL-00
Expires on: 22-JUL-01
Last Updated on: 22-JUL-00
I'd have thought they'd be about as valuable as
"isc9uhejei.com", since people are unlikely to type them
correctly.
Anyway, it does simplify the line slightly:
(?: [a-z0-9] (?: [a-z0-9-]* [a-z0-9] )? \. )+
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: Sat, 26 Aug 2000 10:41:49 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: stupid question probably
Message-Id: <slrn8qe4id.5ap.mgjv@martien.heliotrope.home>
On Fri, 25 Aug 2000 10:18:40 GMT,
Thierry <info@ezboo.com.xx> wrote:
> My Perl script works alone, but
> How the hell can I insert a small Perl script within my existing HTML page.
> For exemple to write date....
One noticeable thing in this thread: All the posts that are discussing
the problem are posted in jeopardy style. All the posts that point out
correctly that this has nothign to do with Perl, and should therefore be
discussed somewhere else, are formatted correctly, i.e. response after
quoted text.
People here do not like offtopic posts, and they don't like jeopardy
posts. Association of the two, however common, will only make people
more hostile towards either of the two. So please, do not do it. Don't
post offtopic question. Don't continue offtopic discussions. Do not
format articles in reverse order that they are read in.
Martien
PS. Before some poor wounded soul starts arguing that this is offtopic
as well, it isn't.
--
Martien Verbruggen |
Interactive Media Division | Think of the average person. Half of
Commercial Dynamics Pty. Ltd. | the people out there are dumber.
NSW, Australia |
------------------------------
Date: 26 Aug 2000 03:54:28 GMT
From: abigail@foad.org (Abigail)
Subject: Re: stupid question probably
Message-Id: <slrn8qefq7.tj3.abigail@alexandra.foad.org>
Martien Verbruggen (mgjv@tradingpost.com.au) wrote on MMDLII September
MCMXCIII in <URL:news:slrn8qe4id.5ap.mgjv@martien.heliotrope.home>:
-:
-: One noticeable thing in this thread: All the posts that are discussing
-: the problem are posted in jeopardy style. All the posts that point out
-: correctly that this has nothign to do with Perl, and should therefore be
-: discussed somewhere else, are formatted correctly, i.e. response after
-: quoted text.
I've made it a habit to permanently killfile anyone who posts Jeopardy
style. Without second chances. And I'm seriously considering to killfile
anything written from Mozilla and Outlook.
Abigail
--
perl -we 'eval {die ["Just another Perl Hacker\n"]}; print ${${@}}[$#{@{${@}}}]'
------------------------------
Date: Sat, 26 Aug 2000 02:39:34 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Win32 Registry and IP addresses.
Message-Id: <39aa2a59.2267996@news.newsguy.com>
H C <carvdawg@patriot.net> wrote:
>> > Most of the info you want to add to the Registry is located in:
>> >
>> > HKLM\System\CurrentControlSet\Services\[device]\Parameters\Tcpip
>> >
>> > Some is in:
>>
>> This should be: "Some are in"
>
>Wow. Okay. So the syntax and grammar Nazi's abound. I guess I shouldn't
>try posting on just one cup of coffee...
No more coffee was necessary, since you got it right. People
who think "info" is plural shouldn't set themselves up as
grammar experts -- but we're used to ignorant grammar experts
around here.
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: Sat, 26 Aug 2000 01:56:10 GMT
From: "Cel" <bop@mypad.com>
Subject: Re: Wrong @INC in Apache
Message-Id: <_sFp5.179605$1h3.3364201@news20.bellglobal.com>
you could have the old path in your path try changing te old path to the new
one
"Gabe" <grichards@flashcom.net> wrote in message
news:39A62925.4CC8E4EA@flashcom.net...
> I realize this might not be a Perl issue, but I'm not sure so I'm
> posting to both groups.
>
> After installing 5.6.0 I deleted all the 5.00503 directories and
> programs. Upon boot, Apache tells me it can't find Cwd.pm in @INC and
> it displays the contents of @INC. The @INC Apache is working with is for
> the 5.00503 distribution (i.e. /usr/lib/perl5/5.00503). Well, that
> directory doesn't exist anymore and @INC should contain things like
> /usr/lib/perl5/5.6.0/. Funny thing is, when I have Perl print out @INC
> it prints out what I expect. So apparently, somehow Apache is operating
> with the prior distribution's @INC, how do I get it to see the @INC for
> 5.6.0?
>
> Thanks,
>
> Gabe
>
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 4137
**************************************