[16731] in Perl-Users-Digest
Perl-Users Digest, Issue: 4143 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 27 09:05:24 2000
Date: Sun, 27 Aug 2000 06:05:09 -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: <967381509-v9-i4143@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 27 Aug 2000 Volume: 9 Number: 4143
Today's topics:
Re: alt in img tags <gellyfish@gellyfish.com>
Re: clearing a file <gellyfish@gellyfish.com>
DB_File Problem: HELP!!! <paul@pco.iis.nsk.su>
Global symbol "$dbh" requires explicit package name at <bGhassemlou@home.com>
Re: Good companion book to Programming Perl? (Bill Feidt)
Re: Good companion book to Programming Perl? <tabs_paradise@yahoo.com>
Re: Good companion book to Programming Perl? <speed.demon9999@virgin.net>
Re: Good companion book to Programming Perl? (Martien Verbruggen)
Re: help i'm stuck!!! (M.J.T. Guy)
How can I find an images size?? <speed.demon9999@virgin.net>
Re: How can I find an images size?? (Martien Verbruggen)
Re: Kill Me! <gellyfish@gellyfish.com>
Re: Kill Me! (Martien Verbruggen)
Newsreaders (was Re: [OT] Re: stupid question probably) <gellyfish@gellyfish.com>
Re: Perl DBI Database Worries - any suggestions ? <gellyfish@gellyfish.com>
Re: Preserving HTML entities when HTML:: parsed <gellyfish@gellyfish.com>
problem with the system() function <vincent.picard@animanet.com>
Re: problem with the system() function (Martien Verbruggen)
Re: Replace "XYZ" but not "ABCXYZ"??? - HELP!! <bart.lateur@skynet.be>
Re: Replace "XYZ" but not "ABCXYZ"??? - HELP!! (Randal L. Schwartz)
Re: selling perl to management (Logan Shaw)
Re: selling perl to management <bart.lateur@skynet.be>
Re: selling perl to management (Ilya Zakharevich)
Re: selling perl to management <o_dehon@my-deja.com>
Re: selling perl to management (Martien Verbruggen)
Re: Why does while(<>) not localize $_? <bart.lateur@skynet.be>
Re: would you recommend buying a book <bart.lateur@skynet.be>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 27 Aug 2000 00:46:31 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: alt in img tags
Message-Id: <8o9ksn$3lp$1@orpheus.gellyfish.com>
On Fri, 25 Aug 2000 11:43:38 -0700 Samay wrote:
> I am looking for utility to check alt value in img tag of
> an html page. please point me to correct module if you can.
HTML::Parser.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 27 Aug 2000 00:42:22 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: clearing a file
Message-Id: <8o9kku$3js$1@orpheus.gellyfish.com>
On Sat, 26 Aug 2000 15:24:44 -0700 Michael Cook wrote:
> Hi folks,
> I have been using this:
>
> open (TEMP, ">db/members.tmp") || die("Unable to open db/members.tmp");
> flock(TEMP, $LOCK_EX);
> print TEMP $null;
> flock(TEMP, $LOCK_UN);
> close (TEMP);
>
> to clear a file - is there a better way (I would like results similar to
> using cat /dev/null > file) at the command line?
> Thanks,
Infact with the open mode you are using you only need to open the file
and close it again - no locking or printing is required.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Sun, 27 Aug 2000 18:07:58 +0600
From: "Paul Dortman" <paul@pco.iis.nsk.su>
Subject: DB_File Problem: HELP!!!
Message-Id: <8oastu$24qj$1@news.itfs.nsk.su>
Hello,
I have problem with my *.db database. Please, help me.
I want to port my *.db database to another unix server. To simplify problem
I created the s.db file with only one key by script:
use DB_File;
$db = '/home/paul/temp/s.db';
tie(%db, 'DB_File', $db) or die "Could not open $db : $!";
$num = $db{'num'};
$num++;
$db{'num'}=$num;
print $num;
untie %db;
The result s.db file has 32768 byte long for one server, and has 8192 byte
long for another server. I think It's because of some internal settings such
as size of field. But how can I change them to port my database from one
server to another?
I should done it quickly, So Please help me or give me links to
documentation that can be helpful.
Thank you,
Paul
------------------------------
Date: Sun, 27 Aug 2000 11:26:36 GMT
From: "bjg" <bGhassemlou@home.com>
Subject: Global symbol "$dbh" requires explicit package name at d:\...\Behzad.pl line 17.
Message-Id: <MV6q5.121895$c5.2733020@news2.rdc1.on.home.com>
I am trying to write a small program to use DBI and I get "Global symbol
require...." error
I am running Perl on Win-NT, I installed MySql on the same.
I appreciate if anyone could give me instruction to get rid of the errors.
Thanks
Here is the source code, error :
===========================
require "subparseform.lib";
&Parse_Form;
use DBI;
use strict;
my $database = "OpenTraders";
my $data_source = "DBI:mySQL:$database";
my $username = "Administrator";
my $password = "********";
##############################
## check VHD DB for Jobs and status
##
my $dbh = DBI->connect($data_source, $username, $password) or die "cant
connect to $data_source : $dbh->errstr\n";
my $sth = $dbh->prepare("select * from jobs"); # <- insert the "from"
keyword or your select will fail
$sth ->execute or die " unable to execute query ";
$sth ->finish;
$dbh->disconnect;
================
here is the error messages???
Global symbol "$dbh" requires explicit package name at
d:\Xitami\webpages\cgi-bin\Behzad.pl line 17.
Global symbol "$OtUsrID" requires explicit package name at
d:\Xitami\webpages\cgi-bin\Behzad.pl line 26.
Global symbol "%formdata" requires explicit package name at
d:\Xitami\webpages\cgi-bin\Behzad.pl line 26.
------------------------------
Date: Sun, 27 Aug 2000 10:46:50 GMT
From: wfeidt@cpcug.org (Bill Feidt)
Subject: Re: Good companion book to Programming Perl?
Message-Id: <8F9D40F09wfeidthiscom@207.126.101.97>
slipgun@desertsnake.abelgratis.com (Slip Gun) wrote in
<39A82E82.FB76B00C@desertsnake.abelgratis.com>:
>I have just bought a copy of the 3rd edition of Larry Wall + co's
>"Programming Perl", and although it is a v.good book, it is more of a
>reference book than a learning one. I am considering buying "The Perl
>Cookbook" as a companion - is this a good idea? I have heard that
>together, these books are great for learning perl.
To a great extent it depends on your learning style. Apart from
offering solid approaches to common Perl tasks, "Programming Perl"
excels in its detailed explanation of how and why the approaches
work. If you like to learn by studying solutions to specific
problems, it's an excellent choice.
OTOH, if you prefer to learn in a more traditional "concept building"
fashion, I'd recommend Andrew Johnson's "Elements of Progamming
with Perl".
Good luck,
Bill
------------------------------
Date: Sat, 26 Aug 2000 23:00:58 +0100
From: "Gonçalo" <tabs_paradise@yahoo.com>
Subject: Re: Good companion book to Programming Perl?
Message-Id: <39a83e96@212.18.160.197>
>I have heard that together, these books are great for learning perl.
If you want to learn, why don't you try "Learning Perl" by Larry Wall and
Tom C.? It's very good to get you into the perl stuff (though it doesn't
focus everything)
If you want to learn, try that one. Start by the begining and not by the end
with "Programming Perl".
That's all. Good luck with your perl programming.
--
Gonçalo - The Metallica Source
http://www.themetsource.com
webmaster@themetsource.com
Slip Gun <slipgun@desertsnake.abelgratis.com> wrote in message
news:39A82E82.FB76B00C@desertsnake.abelgratis.com...
> Hi,
> I have just bought a copy of the 3rd edition of Larry Wall + co's
> "Programming Perl", and although it is a v.good book, it is more of a
> reference book than a learning one. I am considering buying "The Perl
> Cookbook" as a companion - is this a good idea? I have heard that
> together, these books are great for learning perl.
> Cheers,
> Ed
> --
> Those who trade away their privacy in favour of security will soon find
> that they have neither.
------------------------------
Date: Sun, 27 Aug 2000 12:44:41 +0100
From: "Speed Demon" <speed.demon9999@virgin.net>
Subject: Re: Good companion book to Programming Perl?
Message-Id: <8oav02$4gs$2@uk21.supernews.com>
Perl for Dummies is AMAZING. Ok, its a dummies book but it teaches you
everything you need to know, I have created an searchable Only database,
admin scripts, cookies + loads more from this book alone. Well worth it, it
goes through alot of advanced perl and you don't even fell the pressure :))
Regards SD
"Slip Gun" <slipgun@desertsnake.abelgratis.com> wrote in message
news:39A82E82.FB76B00C@desertsnake.abelgratis.com...
> Hi,
> I have just bought a copy of the 3rd edition of Larry Wall + co's
> "Programming Perl", and although it is a v.good book, it is more of a
> reference book than a learning one. I am considering buying "The Perl
> Cookbook" as a companion - is this a good idea? I have heard that
> together, these books are great for learning perl.
> Cheers,
> Ed
> --
> Those who trade away their privacy in favour of security will soon find
> that they have neither.
------------------------------
Date: Sun, 27 Aug 2000 23:43:44 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Good companion book to Programming Perl?
Message-Id: <slrn8qi37v.3fr.mgjv@martien.heliotrope.home>
On Sat, 26 Aug 2000 23:00:58 +0100,
Gonçalo <tabs_paradise@yahoo.com> wrote:
> If you want to learn, why don't you try "Learning Perl" by Larry Wall and
> Tom C.? It's very good to get you into the perl stuff (though it doesn't
> focus everything)
That would be 'Learning Perl' by Randal Schwartz and Tom Christiansen,
with a foreword by larry Wall.
Martien
--
Martien Verbruggen |
Interactive Media Division | I took an IQ test and the results
Commercial Dynamics Pty. Ltd. | were negative.
NSW, Australia |
------------------------------
Date: 27 Aug 2000 12:05:29 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: help i'm stuck!!!
Message-Id: <8ob069$a5t$1@pegasus.csx.cam.ac.uk>
Larry Rosler <lr@hpl.hp.com> wrote:
>
>With older perls that used the C qsort function, an stochastic sortsub
>could lead to meltdown. I don't know if this has been fixed in the
>reimplementation using internal C code.
Yes it has. That was the main reason for Perl having its own code.
Mike Guy
------------------------------
Date: Sun, 27 Aug 2000 12:41:51 +0100
From: "Speed Demon" <speed.demon9999@virgin.net>
Subject: How can I find an images size??
Message-Id: <8oav00$4gs$1@uk21.supernews.com>
Hi, using either Perl or Javascript is it possible to find out the
dimensions of an image.
So I feed the script the image and it out outs the dimensions, (eg 40 x 60)
etc..
Is this possible? Images are all .GIF files but I hope this shouldn't be a
problem
Cheers, best regards T.Mistry
------------------------------
Date: Sun, 27 Aug 2000 23:45:43 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: How can I find an images size??
Message-Id: <slrn8qi3bn.3fr.mgjv@martien.heliotrope.home>
On Sun, 27 Aug 2000 12:41:51 +0100,
Speed Demon <speed.demon9999@virgin.net> wrote:
> Hi, using either Perl or Javascript is it possible to find out the
> dimensions of an image.
This question gets asked quite a lot on this group, and was actually
asked in the last week. You should consider using archives like
www.deja.com to do searches against. It might save you waiting for
answers.
You want the Image::Size module. Available from CPAN:
http://www.cpan.org/
Martien
--
Martien Verbruggen |
Interactive Media Division | Can't say that it is, 'cause it
Commercial Dynamics Pty. Ltd. | ain't.
NSW, Australia |
------------------------------
Date: 27 Aug 2000 00:45:21 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Kill Me!
Message-Id: <8o9kqh$3lm$1@orpheus.gellyfish.com>
On Sat, 26 Aug 2000 13:39:34 -0400 Albert Dewey wrote:
> To all the self proclaimed 'News Group Gods' out there -
>
> You are hereby instructed to add me to your 'Kill List' as an annoying
> poster for the following reasons :
>
OK fine.
*plonk*
I really dont know what you are trying to achieve here.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Sun, 27 Aug 2000 21:31:50 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Kill Me!
Message-Id: <slrn8qhrgm.3fr.mgjv@martien.heliotrope.home>
On Sat, 26 Aug 2000 18:04:27 -0400,
Albert Dewey <timewarp@shentel.net> wrote:
I saw a few followups to your stuff, so I temporarily removed the kill.
I believe I can help you out here.
> I would like to see this charter. Since you are so damn sure of yourself -
> point me to it and show me a SINGLE place in it where my comments above are
> in violation of your so called charter - I'll bet you can't! Or maybe you
> just aren't up to the challenge.
>
> As they say - "Put up or shut-up!"
Any newsgroup that does not have a charter, or that does not mention
a point specifically in their charter is assumed to follow the general
Usenet guidelines, which have been established over more than 20 years
of use.
I'll include some URLs for you, so you can click on them and go and have
a good read of what this is all about. This is not about you. It's not
about newbies. It's not even about this particular newsgroup.
Read, learn, and then, hopefully, realise why you are wrong.
http://www.newsreaders.com/guide/netiquette.html
http://www.ptialaska.net/~kmorgan/
http://dir.yahoo.com/Computers_and_Internet/Internet/\
Information_and_Documentation/Beginner_s_Guides/Netiquette/
http://www.vonl.com/vtab24/news102.htm
Especially this one is very appropriate for you:
http://www.hut.fi/u/jkorpela/usenet/dont.html
But of course, with your seven years of experience on Usenet, you
already know all these links. BTW, Since you were already jeopardy
posting on Usenet before abominations like Netscape and Outlook
encouraged this sort of crud, you may actually be the first person to
ever have done this. I hope you're proud of that.
In a killfile no one can hear you scream, but they still hear the
echoes.
Martien
--
Martien Verbruggen |
Interactive Media Division | The gene pool could use a little
Commercial Dynamics Pty. Ltd. | chlorine.
NSW, Australia |
------------------------------
Date: 27 Aug 2000 01:10:00 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Newsreaders (was Re: [OT] Re: stupid question probably)
Message-Id: <8o9m8o$3om$1@orpheus.gellyfish.com>
On Sat, 26 Aug 2000 20:36:23 GMT Michael Carman wrote:
> Abigail wrote:
>>
>> 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.
>
> Well, then you wouldn't see any of my posts, which may or may not
> concern you. :)
>
> Mozilla has been "good enough" for me, though I've considered looking
> for something better. At any rate, it's not the product that forces the
> behavior.
>
Unix/Linux users in this thread are using slrn or tin on the whole and
the cognoscenti amongst the windows users are using Forte Agent or Gravity.
There are also newsreaders for Gnome and KDE that some favour but they dont
tend to work as well off-line.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 27 Aug 2000 01:48:39 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl DBI Database Worries - any suggestions ?
Message-Id: <8o9oh7$3rf$1@orpheus.gellyfish.com>
On Sat, 26 Aug 2000 09:17:45 +0100 Andy wrote:
> Hello,
>
> I'm using perl 5 DBI on NT to cobstruct a CSV database, but i've got a
> few worries.
>
> Everything seems to work fine on my machine, but i;m worried that when I
>
> get it on the web, and two people try to write to it at the same time,
> that something will go pear shaped.
>
> I've looked around for references to how DBI handles these situations,
> but can't find very much. Short of creating a lock file every time the
> write takes place I don't know what else to do.
>
The module DBD::File that is a base class for DBD::CSV does use flock()
however this wont work on OS that dont have flock() ...
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 27 Aug 2000 00:54:07 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Preserving HTML entities when HTML:: parsed
Message-Id: <8o9lav$3ni$1@orpheus.gellyfish.com>
On Fri, 25 Aug 2000 15:54:43 +0100 Ian McDonald at No Fuss Websites.com wrote:
> This deletes the HTML entities;
>
> $tree = HTML::Parse::parse_html( $text );
> $text = $tree->as_HTML;
>
> What can I do to preserve them?
>
use traverse() from HTML::TreeBuilder to make your own arrangement for
printing out the document.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Sun, 27 Aug 2000 11:12:12 +0200
From: "vincent picard" <vincent.picard@animanet.com>
Subject: problem with the system() function
Message-Id: <8oam20$64l$1@wanadoo.fr>
hi,
i have writen a script whisc use the system function :
#!/usr/bin/perl
print "Content-type: text/html\n\n";
@cmd=("vnewvirtmaps");
$a=system("@cmd");
unless ($a==0)
{
print "ERREUR DANS @cmd ===> $a";
exit;
}
the system function never works. it send back a 65280 error level, even if i
use thue complete path of the system called function.
the problem is the same with any system command (echo, ls, ....)
i 'm working under a freebsd system.
can anybody help me ?
vincent picard
------------------------------
Date: Sun, 27 Aug 2000 21:10:33 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: problem with the system() function
Message-Id: <slrn8qhq8p.3fr.mgjv@martien.heliotrope.home>
On Sun, 27 Aug 2000 11:12:12 +0200,
vincent picard <vincent.picard@animanet.com> wrote:
> hi,
> i have writen a script whisc use the system function :
>
> #!/usr/bin/perl
This is CGI, right? Then you should include -T, even for trivial
programs, especially when you make calls to shells. You also always
should use -w and the strict pragma.
#! /usr/bin/perl -wT
use strict;
> print "Content-type: text/html\n\n";
> @cmd=("vnewvirtmaps");
You build an array with one element,
> $a=system("@cmd");
and here you interpolate that into a string, of the form
"vnewvirtmaps"
In other words, you have done precisely nothing, and I am not sure that
you understand why...
An array interpolated in a double-quoted string, becomes string, which
is the concatenation of the elements of the array, joined by $", which
normally contains a space. The system function takes a list, but a
scalar there is ok as well.
$a = system('cnewvirtmaps');
BTW, you shouldn't get in the habit of using $a for anything else except
one of the variables in a sort sub.
> unless ($a==0)
> {
> print "ERREUR DANS @cmd ===> $a";
> exit;
> }
>
> the system function never works. it send back a 65280 error level, even if i
> use thue complete path of the system called function.
system returns whatever the exit status of your program is, multiplied
by 256. If your program decides to return 12 for success, then $a should
be 12 * 256. Anything else sould be considered an error. Now, _normally_
programs exit with a status of 0, and on error conditions they signal
that with a status of non-zero. But you will have to read the
documentation of your program to figure out what it means. But...
> the problem is the same with any system command (echo, ls, ....)
>
> i 'm working under a freebsd system.
As your perl documentation tells you:
$exit_value = $? >> 8;
$signal_num = $? & 127;
$dumped_core = $? & 128;
I see an exit value of 255.
Now, since this is happening with _all_ your calls, maybe your perl
hasn't been compiled correctly? Is it trying to invoke a shell when it
shouldn't? Can it find the program at all? Is that program in your
search path?
Try something like:
system('/bin/ls');
$exit_value = $? >> 8;
$signal_num = $? & 127;
$dumped_core = $? & 128;
print "$exit_value : $signal_num : $dumped_core\n";
Try running a truss or trace on your process to see what it invokes.
Martien
--
Martien Verbruggen |
Interactive Media Division | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd. | cynical. It's perfectly easy to be
NSW, Australia | cynical.
------------------------------
Date: Sun, 27 Aug 2000 09:09:52 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Replace "XYZ" but not "ABCXYZ"??? - HELP!!
Message-Id: <93mhqsckt4cseujaa9oghesoleafhndljp@4ax.com>
Marcus wrote:
>I am having some trouble using regular expressions to search and
>replace. The problem is that I want to replace the occurrence
>of "\w+@\w+\.\S+" (i.e. any email address like jack@whatever.com) with
>some other text, but if "\w+@\w+\.\S+" is preceded by "XYZ"
>(i.e. "XYZjack@whatever.com") then I DO NOT want the replacement to
>take place. Is this possible with regular expressions?
Yes; although your regex for matching an email address really sucks.
As pointed out, negative lookbehind doesn't work. This does: try
matching your "XYZ" thing followed by your thing, or, if that fails,
your thing. Do the replacement only if the XYZ wasn't matched.
Otherwise, replace by what you matched.
Like this:
s/(XYZ\w+\@\w+\.\S+)|(\w+\@\w+\.\S+)/$1 || "XYZ$2"/ge;
This alternative is similar, but doesn't require repetition of the
pattern:
s/(?:XYZ)?(\w+\@\w+\.\S+)/XYZ$1/g;
(Replace the "XYZ" prefix, or an empty prefix, with "XYZ".)
--
Bart.
------------------------------
Date: 27 Aug 2000 05:18:30 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Replace "XYZ" but not "ABCXYZ"??? - HELP!!
Message-Id: <m1itsmnbhl.fsf@halfdome.holdit.com>
>>>>> "Marcus" == Marcus <holysmokes99@hotmail.com> writes:
Marcus> I am having some trouble using regular expressions to search and
Marcus> replace. The problem is that I want to replace the occurrence
Marcus> of "\w+@\w+\.\S+" (i.e. any email address like jack@whatever.com) with
Marcus> some other text,
This is already flawed. Please see the countless threads on "what
is an email address", probably even occurring in parallel with this
post. :)
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: 27 Aug 2000 02:20:44 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: selling perl to management
Message-Id: <8oafgc$n7d$1@provolone.cs.utexas.edu>
In article <stevel-2608002129170001@192.168.100.2>,
Steve Leibel <stevel@bluetuna.com> wrote:
>If I'm full of shit, please correct me by pointing me to the Perl language
>standard.
Or the Visual Basic standard, or the C standard before ANSI came
along, or the SQL standard (oh wait -- it exists, it's just
ignored), or the Excel standard, or standards for lots of other
languages that people don't seem to have a problem using.
The question (to me at least) is not whether a standard exists;
instead, it's whether your scripts will continue to work as
designed with upgrades of Perl. So far, the record seems
pretty good to me. It may not be perfect, but the implementers
have paid attention to backwards compatibility. For instance,
"@" is still allowed in double-quoted strings, but a warning is
generated. This is more than you can say for some languages.
Furthermore, this same issue applies to other aspects of the platform
and nobody seems to care. Operating systems change, APIs change,
utility libraries get obsoleted, and everyone regards this as
basically just a fact of life. So why is it so different if something
like this happens with a computer language? I think it's possible
perl is suffering from feeping creaturism -- experimental features
that are there mostly because they're neat, not because anyone needs
them -- but I don't think that this endangers the stability of Perl.
- Logan
------------------------------
Date: Sun, 27 Aug 2000 09:19:55 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: selling perl to management
Message-Id: <kumhqs04kdcpjvrinrtlbir9t676ir5o1i@4ax.com>
reg_exp@my-deja.com wrote:
>i did some prototypes with perl and found :
>
>* perl code is about 10 times smaller than the c code
>* perl code is actually 2 times faster than the c code (the c code isnt
>very good, i admit it !!)
Gee. Did you even use Perl's special features, such as regexes and
hashes? If you do string manipulation at all, these are a BIG WIN over
anything you have to handcode in C.
>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
Compared to C? Bollocks.
I'm sorry, but C must be one of the most tricky languages to maintain
programs in there are. Just look at the PC-Lint problems in the
advertisements in DDJ, just to see how tricky C can be.
How good at programming are these managers? If they are not even
programmers, it's not their concern how difficult a language may look
like. It's the programmers who have to find it readable.
>* it's going to be tough getting people to maintain perl code and tough
>to train people in perl.
Hey, we're talking about Perl, not about some obscure language like,
say, er... Sather, for example. Perl is one of the most widely used
languages in the world. Definitely in the top 10.
Hmm... I'm not doing a good job here. Well, I do hope I gave you some
ideas you can use.
--
Bart.
------------------------------
Date: 27 Aug 2000 10:00:55 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: selling perl to management
Message-Id: <8oaosn$6m6$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was NOT sent to Martien Verbruggen
<mgjv@tradingpost.com.au>],
who wrote in article <slrn8qhc5c.3fr.mgjv@martien.heliotrope.home>:
> While that may be so, the Perl developers take extreme care in making
> sure that Perl is as backward compatible as possible. Before any
> 'feature' or part of the language is removed, long discussions and long
> periods of deprecation are the norm.
Having discussions does not guarantie anything. Since Perl has no
documentation on the "this is guarantied to work" level of strictness,
any discussion like this degenerates into "subjective" estimates like
this worked, but was not documented to work;
this was documented to work differently, but did not work the way it
was documented anyway;
preserving this would be bug-for-bug-compatibility;
nobody in a sane mind would use a construction like this;
etcetcetc.
> Some features are deprecated for years, and are still part of the
> language.
Existence of a couple of examples where backward compatibility was
preserved does not preclude hundreds of examples when changes broke
(intentionally or not) previously working scripts.
> The problem is not as much with you stating that Perl changes, but with
> the implication that _only_ Perl changes, and that it is because of it
> not being a standardised language.
The problems with this is that you imply that Perl is a standardised
language. It is not. Very little [my estimates are 60%] of essential
behavior is documented at all, of those documented things very little
is documented unambiguously. [Existence of widely used languages with
a worse record is not always a hot argument...]
Preserving backward compatibility in such a situation is a nightmare.
[Especially true wrt DWIM: a change in the behaviour of the component
A may change what you expect from the component B. Given that the
behaviour of the component B may be described as "it will DWYM" (if
any), how would you preserve backward compatibility?]
Ilya
------------------------------
Date: Sun, 27 Aug 2000 10:05:11 GMT
From: Olivier Dehon <o_dehon@my-deja.com>
Subject: Re: selling perl to management
Message-Id: <8oap4k$t8r$1@nnrp1.deja.com>
In article <8oafgc$n7d$1@provolone.cs.utexas.edu>,
logan@cs.utexas.edu (Logan Shaw) wrote:
> "@" is still allowed in double-quoted strings, but a warning is
> generated.
Bad example, it is not a warning, but a fatal error (trappable)...
From the perldiag manpage:
In string, @%s now must be written as \@%s
(F) It used to be that Perl would try to guess whether you wanted
an array interpolated or a literal @. ...
-Olivier
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 27 Aug 2000 21:51:01 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: selling perl to management
Message-Id: <slrn8qhskl.3fr.mgjv@martien.heliotrope.home>
On 27 Aug 2000 10:00:55 GMT,
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
> [A complimentary Cc of this posting was NOT sent to Martien Verbruggen
> <mgjv@tradingpost.com.au>],
> who wrote in article <slrn8qhc5c.3fr.mgjv@martien.heliotrope.home>:
> > While that may be so, the Perl developers take extreme care in making
> > sure that Perl is as backward compatible as possible. Before any
> > 'feature' or part of the language is removed, long discussions and long
> > periods of deprecation are the norm.
>
> Having discussions does not guarantie anything. Since Perl has no
> documentation on the "this is guarantied to work" level of strictness,
> any discussion like this degenerates into "subjective" estimates like
Nope. It doesn't, And I know that you have been calling for more formal
standardising documentation for Perl for a while now. And we have talked
about this before as well. And we do agree that standardisation is
wanted.
But I can turn the argument around again. No standard out there
guarantees anything either. And again I can point to the java language
as well as the C language standards, and the various Unices. They change
too when necessary. No standard will stop that. What a standard does is
formalise what a given application should behave like during the
lifetime of that standard. It does hardly ever guarantee anything about
how long that lifetime is.
> > Some features are deprecated for years, and are still part of the
> > language.
>
> Existence of a couple of examples where backward compatibility was
> preserved does not preclude hundreds of examples when changes broke
> (intentionally or not) previously working scripts.
Yes, obscure things broke. Abigail had one or two things break in her
one-liners againts 5.6.0. Most things will keep working. Hardly any
production code that has been written for maintainability breaks.
> > The problem is not as much with you stating that Perl changes, but with
> > the implication that _only_ Perl changes, and that it is because of it
> > not being a standardised language.
>
> The problems with this is that you imply that Perl is a standardised
> language. It is not. Very little [my estimates are 60%] of essential
I do not imply that, never have, and never will, until it _is_
standardised. Please do not put words in my mouth. In fact, if you read
that paragraph again, you will note that I _explicitly_ state that Perl
is not standardised.
> behavior is documented at all, of those documented things very little
> is documented unambiguously. [Existence of widely used languages with
> a worse record is not always a hot argument...]
And again, as before in the past, we agree on this. Perl needs better
and more formal documentation. But that is a point that is beside the
discussion at hand. perl is in no more or less danger of breaking things
between versions than other pieces of software are. Even standardised
pieces of software.
And that last bit was the only point I was making.
Martien
--
Martien Verbruggen |
Interactive Media Division | In a world without fences, who needs
Commercial Dynamics Pty. Ltd. | Gates?
NSW, Australia |
------------------------------
Date: Sun, 27 Aug 2000 08:02:40 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Why does while(<>) not localize $_?
Message-Id: <3kihqssc306nirq5ev05s8g33gn8bi6rf4@4ax.com>
Randal L. Schwartz wrote:
>And what would happen to this:
>
> while (<>) {
> last if /^foo/;
> }
> ... do something with $_
>
>That'd really be impossible, and yet I do stuff like that all the time.
You'd have to rewrite this to:
while (<>) {
if(/^foo/) {
... do something with $_
last;
}
}
Your version is a bit dangerous, as you don't seem to distinguish
between "/^foo/ found" and "not found, eof". Well, there are ways around
it, but it's not dead easy.
--
Bart.
------------------------------
Date: Sun, 27 Aug 2000 08:54:51 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: would you recommend buying a book
Message-Id: <fjlhqsk2ia00esv6809j6ff2s00d0hukga@4ax.com>
Albert Dewey wrote:
>Books are my primary reference
>source for anything that I do with a computer. They are my first line of
>defense when faced with a problem that I need to solve, Perl or otherwise.
Not for me. My references are online (perldoc, output captuerd in a
window of my text editor). But for me, books definitely are the way to
*learn* about things, as opposed to lookup references. I found the
learning ramp for Perl a lot less steep with Randal Schwartz' book
"Learning Perl". But that is several years ago, some worthwile
alternatives may have been published since then.
--
Bart.
------------------------------
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 4143
**************************************