[16730] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4142 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 27 03:05:27 2000

Date: Sun, 27 Aug 2000 00:05:11 -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: <967359911-v9-i4142@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 27 Aug 2000     Volume: 9 Number: 4142

Today's topics:
    Re: Combining Strings (Gwyn Judd)
        Counting across multiple lines? <pnavarro@uswest.net>
    Re: Counting across multiple lines? <tina@streetmail.com>
    Re: Counting across multiple lines? <tina@streetmail.com>
    Re: DBM Trouble 08/26/00 <bwalton@rochester.rr.com>
        Development Tools jsaintc@my-deja.com
    Re: Development Tools <tina@streetmail.com>
    Re: Development Tools <jaz@zsolv.com>
    Re: Form Question <superman183@hotmail.com>
        How to obtain information about shares Win NT <mdyzio@kki.net.pl>
    Re: Internet Protocol was(Re: stupid question probably) (Martien Verbruggen)
    Re: Internet Protocol was(Re: stupid question probably) <elephant@squirrelgroup.com>
    Re: my($a)=shift or warn; (Eric Kuritzky)
    Re: Parsing a Excell table - or - a "Tab New_Line" text <bwalton@rochester.rr.com>
    Re: Perl DBI Database Worries - any suggestions ? <bwalton@rochester.rr.com>
    Re: Read and Write in same session <bwalton@rochester.rr.com>
    Re: Replace "XYZ" but not "ABCXYZ"??? - HELP!! <elephant@squirrelgroup.com>
    Re: searching client site cookie script or tutorial.. <jaz@zsolv.com>
    Re: Self-Answering Questions (Was Re: Flipflop matching (Martien Verbruggen)
    Re: selling perl to management (Martien Verbruggen)
    Re: selling perl to management (Steve Leibel)
    Re: selling perl to management (Steve Leibel)
    Re: selling perl to management (Martien Verbruggen)
    Re: selling perl to management (Homer Simpson)
    Re: What is a Linux file type of 'application/x-cgi' ? <philipg@atl.mediaone.net>
    Re: Why does while(<>) not localize $_? (Randal L. Schwartz)
    Re: Why does while(<>) not localize $_? <tina@streetmail.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 27 Aug 2000 02:44:34 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Combining Strings
Message-Id: <slrn8qh04e.f4e.tjla@thislove.dyndns.org>

I was shocked! How could Jonathan Palley <jpalley@jps.net>
say such a terrible thing:
>Just as I speak, i figure it out.......you use a . (dot)
>$S1 = $S2 . $S3;
>
>someone correct me if i'm wrong!

That is one way, however, as in all things Perl, There Is More Than One
Way To Do It :)

1)

$s1 = "$s2$s3";

2)

$s1 = join '', $s2, $s3;

3)

$s1 = sprintf "%s%s", $s2, $s3;

4)

$s1 = <<END_OF_STRING;
$s2$s3
END_OF_STRING

chomp $s1;

Which method you choose to use will depend on your situation.

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Fortune's real live weird band names #670:

Stiff Richards


------------------------------

Date: Sat, 26 Aug 2000 23:24:59 -0500
From: Pedro A Navarro <pnavarro@uswest.net>
Subject: Counting across multiple lines?
Message-Id: <39A8981B.47000002@uswest.net>

Hi:
	I'm new to Perl and programming in general, so I'm stumped by a simple
problem. I'm trying to write a program that counts the number of
characters in a file, such as 

>header
TADSTWTASRTDRAFTARSGRQWTS
AGSTDRASGATFSASDGTASTTAGS
TQTRAEWSTATSGATSGTASTATST

That is for a protein sequence file, in case you are wondering. When I
use

$count=tr/A-Z//;
print "$count\n";

I get the number of characters for each line, instead of for the whole
thing. I have tried to get rid of the newline character with

$count=tr/\n//d;

but that gives me a count of "1" for each line, and I still have
multiple lines!
How do I get rid of the newline character, or at the very least, how do
I join the multiple lines so I have one single string? I'm fairly sure
this is a simple thing to do, but so far I don't know what else to try!

Thanks for your time,
Pedro A Navarro
pnavarro@uswest.net


------------------------------

Date: 27 Aug 2000 04:50:01 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: Counting across multiple lines?
Message-Id: <8oa6gn$a5m89$2@ID-24002.news.cis.dfn.de>

hi,
Pedro A Navarro <pnavarro@uswest.net> wrote:
> 	I'm new to Perl and programming in general, so I'm stumped by a simple
> problem. I'm trying to write a program that counts the number of
> characters in a file, such as 

>>header
> TADSTWTASRTDRAFTARSGRQWTS
> AGSTDRASGATFSASDGTASTTAGS
> TQTRAEWSTATSGATSGTASTATST

> $count=tr/A-Z//;
> print "$count\n";

> I get the number of characters for each line, instead of for the whole
> thing. I have tried to get rid of the newline character with

> $count=tr/\n//d;

use s///g instead.

tna

-- 
http://tinita.de    \  enter__| |__the___ _ _ ___
tina's moviedatabase \     / _` / _ \/ _ \ '_(_-< of
search & add comments \    \__,_\___/\___/_| /__/ perception
please don't email unless offtopic or followup is set. thanx


------------------------------

Date: 27 Aug 2000 05:18:41 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: Counting across multiple lines?
Message-Id: <8oa86f$a5m89$4@ID-24002.news.cis.dfn.de>

hi,
Tina Mueller <tina@streetmail.com> wrote:
> hi,
> Pedro A Navarro <pnavarro@uswest.net> wrote:
>> 	I'm new to Perl and programming in general, so I'm stumped by a simple
>> problem. I'm trying to write a program that counts the number of
>> characters in a file, such as 

>>>header
>> TADSTWTASRTDRAFTARSGRQWTS
>> AGSTDRASGATFSASDGTASTTAGS
>> TQTRAEWSTATSGATSGTASTATST

>> $count=tr/A-Z//;
>> print "$count\n";

>> I get the number of characters for each line, instead of for the whole
>> thing. I have tried to get rid of the newline character with

>> $count=tr/\n//d;

> use s///g instead.

sorry. tr// should work, of course,
if you have all the lines in one scalar.
otherwise it can't work.
read about the $/ variable in
perldoc perlvar
how to read in all the lines of
a file in a scalar (if that file
isn't too big).

tina

-- 
http://tinita.de    \  enter__| |__the___ _ _ ___
tina's moviedatabase \     / _` / _ \/ _ \ '_(_-< of
search & add comments \    \__,_\___/\___/_| /__/ perception
please don't email unless offtopic or followup is set. thanx


------------------------------

Date: Sun, 27 Aug 2000 03:06:24 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: DBM Trouble 08/26/00
Message-Id: <39A885D9.543A5BE1@rochester.rr.com>

invinfo@my-deja.com wrote:
> 
> Why am I having so much trouble with DBM files ???

I don't know.  Maybe if you told us exactly what trouble you are having,
someone could tell you.  I personally have been using them for years,
and, as long as I pay attention to what the docs say (including file
locking for CGI applications), I have no trouble at all.  The one
exception is SDBM on Windoze with a FAT or FAT32 filesystem, which
doesn't work properly. 

Note carefully the key and value length limitations of some of the
DBM-like access methods.  DB_File is a good choice, as it does not have
such limitations. 

Also note that DBM-like tied hashes store only strings as values. 
References don't work.  See the MLDBM module for one way to get around
this.
 ...
-- 
Bob Walton


------------------------------

Date: Sun, 27 Aug 2000 04:05:54 GMT
From: jsaintc@my-deja.com
Subject: Development Tools
Message-Id: <8oa42p$74e$1@nnrp1.deja.com>

What is a good PERL Development tool?  I have
Visual Studio Eenterprise edition, but I don't
know if and don't think that it has any kind of
PERL compiler.  Are there any popular programs,
and besides that, programs from popular vendors
that are worth checking out, or do I just have to
be in a UNIX enviornment with a PERL compiler to
find what I want?...


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: 27 Aug 2000 05:00:04 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: Development Tools
Message-Id: <8oa73i$a5m89$3@ID-24002.news.cis.dfn.de>

hi,
jsaintc@my-deja.com wrote:
> What is a good PERL Development tool?  I have
> Visual Studio Eenterprise edition, but I don't
> know if and don't think that it has any kind of
> PERL compiler.  Are there any popular programs,
> and besides that, programs from popular vendors
> that are worth checking out, or do I just have to
> be in a UNIX enviornment with a PERL compiler to
> find what I want?...

use an editor of your choice (vi, emacs, or
for windows, textpad, ...)
and a perl distribution of your choice
(ActivePerl for windows, ...). then edit your
perl program and type
perl -c script

that's all you need.

tina

-- 
http://tinita.de    \  enter__| |__the___ _ _ ___
tina's moviedatabase \     / _` / _ \/ _ \ '_(_-< of
search & add comments \    \__,_\___/\___/_| /__/ perception
please don't email unless offtopic or followup is set. thanx


------------------------------

Date: Sun, 27 Aug 2000 05:41:53 GMT
From: "Andy Zeneski" <jaz@zsolv.com>
Subject: Re: Development Tools
Message-Id: <BS1q5.73255$rd1.12685988@typhoon-news1.southeast.rr.com>


In a Windows environment check out PerlBuilder or UltraEdit. I personally
love UltraEdit, its a great tool.

http://www.ultraedit.com

And like Tina said, ActiveState for windows.

http://www.activestate.com

Andy Zeneski
jaz@zsolv.com

"Tina Mueller" <tina@streetmail.com> wrote in message
news:8oa73i$a5m89$3@ID-24002.news.cis.dfn.de...
> hi,
> jsaintc@my-deja.com wrote:
> > What is a good PERL Development tool?  I have
> > Visual Studio Eenterprise edition, but I don't
> > know if and don't think that it has any kind of
> > PERL compiler.  Are there any popular programs,
> > and besides that, programs from popular vendors
> > that are worth checking out, or do I just have to
> > be in a UNIX enviornment with a PERL compiler to
> > find what I want?...
>
> use an editor of your choice (vi, emacs, or
> for windows, textpad, ...)
> and a perl distribution of your choice
> (ActivePerl for windows, ...). then edit your
> perl program and type
> perl -c script
>
> that's all you need.
>
> tina
>
> --
> http://tinita.de    \  enter__| |__the___ _ _ ___
> tina's moviedatabase \     / _` / _ \/ _ \ '_(_-< of
> search & add comments \    \__,_\___/\___/_| /__/ perception
> please don't email unless offtopic or followup is set. thanx




------------------------------

Date: Sat, 26 Aug 2000 21:05:55 -0400
From: "Dave" <superman183@hotmail.com>
Subject: Re: Form Question
Message-Id: <39a86aa9_4@news1.prserv.net>

You could do it three ways that I know of.....

1) instead of having a submit button, change it to a normal button with an
"onClick" action of processing a JavaScript routine which works out which
options are selected and then actions the required script.....

2) using a little DHTML you could have an "onChange" event associated with
each option, which changes the "Action" attribute of the form to point to a
different script url.....

3) and the best idea, not only because this is a Perl Newsgroup, but also
because not all browsers support DHTML, is of course to use a Perl script to
process the values....which you could maybe just use separate sub-routines
rather than entirely different scripts, although you could of course do that
if you wanted.....

hope that helps you at least a little,
Good luck,
Dave




richie wrote in message <39A83DA7.9A767A1@sympatico.ca>...
>Is there an easy way for me to have a selection menu like this:
>
>        print "<select name='place'>";
>        print "<option selected value'garbage'> Please click here";
>        print "<option value='maps'>Use the Maps ";
>        print "<option value='location'> Specify a location";
>        print "<option value='street'> Specify a street";
>        print "</select>";
>
>and then when I hit the button:
>
>  print "<input type='submit' value='&nbsp; Go To Location &nbsp;'>";
>        print "</FORM>\n";
>        print "<TD>\n";
>
>depending, on what option is selected it will pass it to one of three
>different scripts, and perform the following:
>
>$string1="origin_index_x=$coordx&origin_index_y=$coordy&>";
>$string1 =~ s/\=/\~/g;
>
>print "\n <INPUT TYPE = hidden NAME = string VALUE= $string1>\n";
>
>Or will I have to pass the selection into a script and then decide what
>script it has to go to next?
>
>Thanks, Richie
>




------------------------------

Date: Sun, 27 Aug 2000 08:58:53 +0200
From: "Marek Kozniewski" <mdyzio@kki.net.pl>
Subject: How to obtain information about shares Win NT
Message-Id: <8oae56$uof$1@portraits.wsisiz.edu.pl>

How to obtain information about share permission in Win NT (network
permission and file permission)

Marek




------------------------------

Date: Sun, 27 Aug 2000 12:14:13 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Internet Protocol was(Re: stupid question probably)
Message-Id: <slrn8qgqr5.3fr.mgjv@martien.heliotrope.home>

On Sat, 26 Aug 2000 11:35:56 -0400,
	Albert Dewey <timewarp@shentel.net> wrote:
> WTF???
> 
> Who wrote the book on newsgroup posting ethics that demanded that the
> reply be posted after the quoted text?

The Usenet community did, before AOL, Dejanews, Netscape and Microsoft
ruined it. Long before you had even heard of the Internet, which you
probably still confuse with the Web.

> and refers to the original post as a whole, I see no problem with posting it
> before the quoted text. This way it is easier for others to get to the part that

You are one of those people that goes into a restaurant, sits at a
table, and loudly farts whenever he feels like it, right? No matter that
it annoys other people. No matter that by a longstanding convention that
is not a done thing. You feel like it, and hey, that guy over there does
it too, so it must be ok.

Well. It's not.

> Go ahead and flame me. Ignore me. Add me to your kill list.

One entry, especiall for you.

*plonk*

> have done for the past 7 years since I first started reading
> newsgroups.

Then you are a very pathetic figure. If you after 7 years (and I
sincerely doubt that) still haven't read the usenet FAQs, then you have
a behavioural problem.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | 
Commercial Dynamics Pty. Ltd.   | "Mr Kaplan. Paging Mr Kaplan..."
NSW, Australia                  | 


------------------------------

Date: Sun, 27 Aug 2000 01:27:00 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: Internet Protocol was(Re: stupid question probably)
Message-Id: <MPG.14130bd84669db14989702@localhost>


  < snipped useless drivel >

now that was a real shame .. I'd enjoyed a few of Albert's posts up to 
that point - looked like he had the potential to be a worthwhile 
contributor .. oh well .. I'll never know now

-- 
  jason -- elephant@squirrelgroup.com --


------------------------------

Date: 27 Aug 2000 06:55:39 GMT
From: kuritzky@math.berkeley.edu (Eric Kuritzky)
Subject: Re: my($a)=shift or warn;
Message-Id: <8oae1b$p7t$1@agate.berkeley.edu>

In article <Pine.OSF.4.10.10008261910090.3848-100000@albert.karlin.mff.cuni.cz>,
Hans Ginzel  <Hans@kolej.mff.cuni.cz> wrote:
>
>	Hello.
>
>   What does the assignmen my($a)=shift return?
>

It returns a _list_ of length one.  The list's element is whatever
shift returned;  however, a list of length one is always considered
true, even when its element has the undefined value.

Try this:

       sub test {
                print @_, "\n";
                (my $a=shift) or print "A\n";
                (my $b=shift) and print "B\n";
        }

        test;
        test "X";
        test "X", "Y";

The output is:

A
X
XY
B

More like what you expected, isn't it?

--Eric Kuritzky
echo JAPH


------------------------------

Date: Sun, 27 Aug 2000 03:51:28 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Parsing a Excell table - or - a "Tab New_Line" text file?
Message-Id: <39A89069.19CFB345@rochester.rr.com>

Etienne Laverdiere wrote:
 ...
> I need to parse in a 2 dimentional array from an Excell document through a
> Perl script that will isolate all the colonnes and the rows of this Excell
> table.
> 
> I don't think I can extract it by parsing it in the ASCII format, it seems
> very complicated.
> 
> But with a simple manipulation I can generate a plain TAB separated file
> (with New_Line for each record and a TAB for each field).
> 
> Is there a Perl formula (with some RegEx maybe?) that could scan all this
> Tab separated file and put all the value in a 2 dimentional array :
> @array[x][y]?
> I doubt that this can be very tricky to do.
> 
> In Mastering Regex (p. 290) I've found a formula that seems to work with a
> Comma Separated File (CVS).
> 
> @fields = ();
> push(@fields, $+) while $text =~ m{
>         "([^"\\]*(?:\\.[^"\\]*)*)",?
>     |    ([^,]+),?
>     |    ,
> }gx;
> #add a final empty field if there's a trailing comma
> push (@field, undef) if substr(text, -1, 1) eq ',';
> 
> One thing I know is that a TAB can be represente by a '\t' and a new_line by
> a '\n'. Is this true in a Tab separated file?
> 
> I would like, finaly to access my ODBC database with each value, and build a
> database table (I have already done that with DBI).
> 
> Where could I start to finish my work?
 ...
> Etienne Laverdiere
> Montreal

Assuming you are running on Windoze, you could accomplish what you want
with a single statement like:

     $ref=$worksheet->Range("B2:E10")->Value;

for example.  A complete example would be:

     use Win32::OLE;
     use Data::Dumper;
     # use existing instance if Excel is already running
     eval {$ex = Win32::OLE->GetActiveObject('Excel.Application')};
     die "Excel not installed" if $@;
     die "Excel not running" unless defined $ex;
     $wb=$ex->Workbooks(1);
     $ws=$wb->Worksheets(1);
     $ref=$ws->Range("B2:E10")->Value;
     print Dumper($ref);

which will print out the values in cells B2 through E10 (as a
rectangular range) in an already-open Excel spreadsheet.  That way you
don't have to fuss around with writing and parsing files, and the values
that you get are exact, rather than rounded off.
-- 
Bob Walton


------------------------------

Date: Sun, 27 Aug 2000 03:33:10 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Perl DBI Database Worries - any suggestions ?
Message-Id: <39A88C1F.8E638B17@rochester.rr.com>

Andy wrote:
 ...
> 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.
> 
> Does anyone have any insight into this ?  Any helps appreciated.
 ...
> Andy
I think you're on the right track, but you'll need the lock when you
*read* the file as well -- consider what would happen if one process
were writing the file while a second started an attempt to read it, for
example.
-- 
Bob Walton


------------------------------

Date: Sun, 27 Aug 2000 03:20:03 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Read and Write in same session
Message-Id: <39A8890C.9B14D687@rochester.rr.com>

Jonathan Palley wrote:
> 
> Thanx for all the help you've given me for the last two Q's I've
> asked....I'm new to PERL (know other languages).....so i'm trying to get
> the stuff down.....
> Alright, now my question is, is there a way to read and write to a file
> in the same session......sure i can open, read, close, open, write,
> close.....but it seems redundant.
See:

   perldoc -f open
   perldoc perlopentut
   perldoc -f seek

for the information you need to open a file for both reading and
writing.  The section "mixing reads and writes" in perlopentut should be
quite helpful.  You will need "seek" in order to specify where in the
file you want to start reading or writing.  Hope that helps.
-- 
Bob Walton


------------------------------

Date: Sun, 27 Aug 2000 01:24:50 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: Replace "XYZ" but not "ABCXYZ"??? - HELP!!
Message-Id: <MPG.14130b54f68bc576989701@localhost>

Keith Calvert Ivey <kcivey@cpcug.org> wrote ..
>jason <elephant@squirrelgroup.com> wrote:
>>Keith Calvert Ivey <kcivey@cpcug.org> wrote ..
>
>>>One possibility is
>>>
>>>    s{(\w+@\w+\.\S+)}
>>>     { substr($1, 0, 3) eq 'XYZ' ?
>>>           $1 :
>>>           'WHATEVERTEXT' }e;
>>
>>eww .. that's a smelly WTDI .. even if you're trying to conform to some 
>>sort of "everything must be done within a s///" then you've already got 
>>everything in the regex in $_ (or something else assuming the =~ 
>>operator somewhere) so why capture it to test it ?
>>
>>I don't know why everyone would try to cram everything into the regex 
>>when Perl maps so perfectly onto the pseudo-code of
>>
>>  make the substitution unless it begins with 'XYZ'
>>
>>with
>>
>>  s/\w+@\w+\.\S+/WHATEVERTEXT/ unless substr( $_, 0, 3) eq 'XYZ';
-
>You're assuming that $_ *is* the (possible)
>e-mail address, in which case I think you should anchor your
>regex at the start.

yes .. I did make that assumption actually .. how silly

-- 
  jason -- elephant@squirrelgroup.com --


------------------------------

Date: Sun, 27 Aug 2000 05:41:53 GMT
From: "Andy Zeneski" <jaz@zsolv.com>
Subject: Re: searching client site cookie script or tutorial..
Message-Id: <BS1q5.73256$rd1.12685827@typhoon-news1.southeast.rr.com>

If what you are asking for is some examples or suggestions on how to set the
cookies and/or retrieve them, check out CGI::Cookie or cookie-lib.pl both
will do what I think you are looking to do.

Andy Zeneski
jaz@zsolv.com

"Daniel van den Oord" <danielxx@bart.nl> wrote in message
news: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: Sun, 27 Aug 2000 12:16:24 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Self-Answering Questions (Was Re: Flipflop matching)
Message-Id: <slrn8qgqv8.3fr.mgjv@martien.heliotrope.home>

On Sat, 26 Aug 2000 19:46:23 GMT,
	Bart Lateur <bart.lateur@skynet.be> wrote:
> Martien Verbruggen wrote:
> 
> >One of
> >the ugliest things that I think Perl has is the elsif.
> 
> As an aside: why doesn't perl have an "elsunless"?

Oh, bah. That's obscene.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Can't say that it is, 'cause it
Commercial Dynamics Pty. Ltd.   | ain't.
NSW, Australia                  | 


------------------------------

Date: Sun, 27 Aug 2000 12:33:01 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: selling perl to management
Message-Id: <slrn8qgrud.3fr.mgjv@martien.heliotrope.home>

On Fri, 25 Aug 2000 15:11:55 -0700,
	Steve Leibel <stevel@bluetuna.com> wrote:
> 
> Management is right to be concerned.  

The only have to be concerned about their pointy hair getting less
pointy.

> 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?"  

Say you have a bundle of Java programs running on JRE 1.1x. YOu want to
upgrade to JRE 1.2 or 1.3. Does management ask that question? Do they
have the right to ask that same question? Why is this perl specific?

You upgrade your commercial C compiler, same issues apply.
You upgrade your commercial OS. Same issues apply.

How is this specific to Perl. How is it specific to non-commercial
products, even?

> And if you are an honest engineer you must answer, "Yes.   Perl upgrades
> are generally messy.  The Perl community regards new features as more

No more messy than anything else I've needed to upgrade. Where are you
getting this nonsense? I've been doing upgrades to production systems
for years, for all kinds of software. Perl is no worse or better than
anything else.

> important than guaranteed backward compatability.  Moreover, the Perl

Fallacy. Big fat fallacy. And it shows that you have no idea about how
the Perl development cycle works. One of the biggest things during
discussions about new features for Perl or changes to perl is how much
it breaks. Backward compatibility is the number 1 concern almost.

> 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

Why are you making up crap that you won't be able to back up?  Who is
this 'perl community' that insists that standardising is evil? There may
be one or two people that believe that, but that's not the community.
And besides that, what guarantee is a standard going to give you? There
is only 1 implementation of the language Perl. Once there are more,
standards may become a real necessity.

And your example of dropping while loops is clearly designed to
artificially give your argument any strength, which it lacks on its own.

> 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."

That's again, a blatant lie. The Perl developers are very, very worried
about features that break backwarsd compatibility.

> And management will rightly conclude that C++ or Java are better choices
> from the standpoint of production stability, which equates to revenue. 

Java more stable than Perl? You must be kidding, right? Have you made a
list of how many changes Java and its ebvironments went through in the
last few years?

[snip of the rest, just as infuriatingly and blatantly wrong]

Please, Steve, before you start spreading nonsense like this, make sure
that you can back it up correctly. here is no need to try to scare
people with untruths. 

For pointy haired bosses it's enough to say that you don't pay for Perl,
and there's no big company that puts a nametag on it[1]. 


Martien

[1] Java is in the same class of product as Perl, not officially and
contractually supported. However PHB's don't seem to have a problem with
it. Double standards indeed.

PS. For your reference, read archives of the p5p mailing list.
-- 
Martien Verbruggen              | 
Interactive Media Division      | Never hire a poor lawyer. Never buy
Commercial Dynamics Pty. Ltd.   | from a rich salesperson.
NSW, Australia                  | 


------------------------------

Date: Sat, 26 Aug 2000 21:29:17 -0700
From: stevel@bluetuna.com (Steve Leibel)
Subject: Re: selling perl to management
Message-Id: <stevel-2608002129170001@192.168.100.2>

In article <39a827dc@cs.colorado.edu>, tchrist@perl.com (Tom Christiansen)
wrote:

> In article <stevel-2508001512240001@192.168.100.2>,
> Steve Leibel <stevel@bluetuna.com> wrote:
> >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."
> 
> Whether this untruth comes down to an intentional lie or an intentional
> error, the fact remains that this is not merely spectacularly false,
> it is also an excercise in needlessly hysterical fear-mongering.
> It is destructive and evil--and full of shit.


I'll plead guilty to hyperpole, but I stand by what I wrote.  I was
greatly influenced by some of the sentiments in the "ASCII Perl" thread a
while back, and also by what I've personally seen and experienced over the
past several years.

If I'm full of shit, please correct me by pointing me to the Perl language
standard.

Steve L


------------------------------

Date: Sat, 26 Aug 2000 22:33:48 -0700
From: stevel@bluetuna.com (Steve Leibel)
Subject: Re: selling perl to management
Message-Id: <stevel-2608002234160001@192.168.100.2>

In article <stevel-2608002129170001@192.168.100.2>, stevel@bluetuna.com
(Steve Leibel) wrote:

> In article <39a827dc@cs.colorado.edu>, tchrist@perl.com (Tom Christiansen)
> wrote:
> 
> > In article <stevel-2508001512240001@192.168.100.2>,
> > Steve Leibel <stevel@bluetuna.com> wrote:
> > >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."
> > 
> > Whether this untruth comes down to an intentional lie or an intentional
> > error, the fact remains that this is not merely spectacularly false,
> > it is also an excercise in needlessly hysterical fear-mongering.
> > It is destructive and evil--and full of shit.



Each successive release of Perl alters and/or extends the definition of
the core language.   That choice has consequences in terms of stability
and maintainability.  Those are factors that management must consider when
choosing development tools.   

I did not mean to imply that the Perl developers don't care, and perhaps I
did choose inflammatory wording to express my point.  Nevertheless it is a
fact that when you keep changing the core language, that makes it harder
to sell Perl into large scale projects in which stability is important. 
I'd be happy to have people respond to this point.

Steve L


------------------------------

Date: Sun, 27 Aug 2000 17:09:48 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: selling perl to management
Message-Id: <slrn8qhc5c.3fr.mgjv@martien.heliotrope.home>

On Sat, 26 Aug 2000 22:33:48 -0700, Steve Leibel <stevel@bluetuna.com>
	wrote:
> In article <stevel-2608002129170001@192.168.100.2>,
> stevel@bluetuna.com (Steve Leibel) wrote:
> 
> > In article <39a827dc@cs.colorado.edu>, tchrist@perl.com (Tom
> > Christiansen) wrote:
> > 
> > > In article <stevel-2508001512240001@192.168.100.2>, Steve Leibel
> > > <stevel@bluetuna.com> wrote:
> > > >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."
> > > 
> > > Whether this untruth comes down to an intentional lie or an
> > > intentional error, the fact remains that this is not merely
> > > spectacularly false, it is also an excercise in needlessly
> > > hysterical fear-mongering.  It is destructive and evil--and full
> > > of shit.
> 
> Each successive release of Perl alters and/or extends the definition
> of the core language.   That choice has consequences in terms of
> stability and maintainability.  Those are factors that management must
> consider when choosing development tools.   

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. Some features are deprecated for
years, and are still part of the language. Even misfeatures that were
never _meant_ to be part of Perl often are maintained.

But, this is not something specific to Perl. Java has had its share of
this over the last years, and the new C99 standard changes a few things
from the C89 standard, and that changed several things in the K&R
standards. The various Unix-related standards also keep changing. Change
is an attribute of any language. Microsoft changes its platform all the
time, sometimes with the result that applications stop running. I've
done operating system upgrades (MS, Solaris) that broke certain setups
and applications.

Management has every right to ask for a decent upgrade path, and to ask
for a decent risk assessment. It is however misleading to suggest that
Perl would be riskier to upgrade than anything else that might be in
use.

> I did not mean to imply that the Perl developers don't care, and
> perhaps I did choose inflammatory wording to express my point.
> Nevertheless it is a fact that when you keep changing the core
> language, that makes it harder to sell Perl into large scale projects
> in which stability is important.  I'd be happy to have people respond
> to this point.

Perl's core language hasn't really changed that much over the last few
years. If anything, it has become richer. None of the code that I
maintain in a production sense, and some of that code was written for
perl 4, has needed any major changes for new perl releases. There were a
few easily identifiable changes between 4 and 5, but none of the 5
versions needed me to review code in a time-consuming manner. The last
(5.6.0) release has only caused some work in some of the XS modules (no
more pollution), and even that can be circumvented with a backward
compatibility switch (perl Makefile.PL POLLUTE=1).

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.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Never hire a poor lawyer. Never buy
Commercial Dynamics Pty. Ltd.   | from a rich salesperson.
NSW, Australia                  | 


------------------------------

Date: 27 Aug 2000 06:55:01 GMT
From: homer.simpson@springfield.nul (Homer Simpson)
Subject: Re: selling perl to management
Message-Id: <8oae05$i7m$0@216.39.130.49>

In article <8o621i$ojp$1@nnrp1.deja.com>, reg_exp@my-deja.com wrote:
>hi,
>
>i am working on a project where we manipulate lots of text data that is
>in a structured format.
[snip]
>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
Nearly any code can be hard to read or maintain.  That's why good project 
managers set standards for production code.  Comments help too...
I recently had to port a Perl 4 script to Active Perl on Win32.  The script 
was basically a "shell script" that made extensive use of "system" to access 
Unix programs.  I ended up rewriting all but one sub routine.  It took me two 
days.  I'd been programming in Perl for almost a month... so it's not that 
hard if the person who wrote it bothers to comment things.

>* it's going to be tough getting people to maintain perl code and tough
>to train people in perl.
I have found Perl to be the simplest programming language to become productive 
in (compared with VB, Delphi, Turbo BASIC, C and WinBatch) but they're not 
likely to believe me...

It's quite easy to write readable, maintainable Perl code as long as the 
person managing the project does their job.


------------------------------

Date: Sun, 27 Aug 2000 02:17:59 GMT
From: "Philip Garrett" <philipg@atl.mediaone.net>
Subject: Re: What is a Linux file type of 'application/x-cgi' ?
Message-Id: <rT_p5.72702$rd1.12610976@typhoon-news1.southeast.rr.com>

hi,
<gevens@my-deja.com> wrote in message news:8o8imm$i9t$1@nnrp1.deja.com...
[snip]
> The home/website/cgi directory contains what I hoped to be cgi scripts
> in a plain text format, but instead contains cgi scripts in a format
> that almost look like they have been compiled in some way.
>
> 1) Is it possible to compile a perl script ?

Yes, but not generally recommended.  Run perldoc perlcc  (new in version
5.005)

> 2) If so does this mean you don't need the perl interpreter on the
> server ie. usr/bin/perl ?

Correct, although you'll probably need libraries and/or modules that come
with the installation.

> 3) Is there a way I can revert them to plain text ?

Not that I know of.

> Forgive me please if I have somehow missed the point of something
> somewhere !
>
> Any help is most appreciated.

Use the "file" command to determine what type of file the program is, e.g.
file program.cgi.
If file reports that the program is a binary executable (usually something
like " ELF 32-bit LSB executable", use the "nm" command to determine if it
has any symbols with the word "perl" in it, e.g. nm program.cgi | grep -i
perl.  If it does, then it's probably a compiled perl script.

It is possible that these programs are written in perl, albeit unlikely.
They're probably written in C or C++.

hth,
Philip




------------------------------

Date: 26 Aug 2000 20:39:50 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Why does while(<>) not localize $_?
Message-Id: <m1ya1jmkxl.fsf@halfdome.holdit.com>

>>>>> "Daniel" == Daniel Chetlin <daniel@chetlin.com> writes:

Daniel> Why not 'while (defined(local $_ = <ARGV>))'? Those familiar
Daniel> with the localizing behavior of foreach won't be surprised
Daniel> that the while(<>) magic doesn't do the same.

Because if you want that, you can type that.  Can't change it now,
because it'd break existing programs that counted on other things.

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.

print "Just another Perl hacker,"

-- 
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 04:08:27 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: Why does while(<>) not localize $_?
Message-Id: <8oa42o$a5m89$1@ID-24002.news.cis.dfn.de>

hi,
Daniel Chetlin <daniel@chetlin.com> wrote:
> [~/dev/bleadperl] $ ./perl -l
> for (qw/foo bar baz/) {
>     print;
>     while (<>) {
>         print "\t$_";
>     }
> }
> __END__
> foo
> Modification of a read-only value attempted at - line 3.

can't reproduce this. which version do you have?

> [~/dev/bleadperl] $ ./perl -MO=Deparse
> for (qw/foo bar baz/) {
>     print;
>     while (<>) {
>         print "\t$_";
>     }
> }
> __END__
> foreach $_ ('foo', 'bar', 'baz') {
>     print $_;
>     while (defined($_ = <ARGV>)) {
>         print "\t$_";
>     }
> }
> - syntax OK

22:13:57 tmueller@mail2:~/beta/cgi-bin > perl -v
This is perl, version 5.005_03 built for i386-linux

22:14:57 tmueller@mail2:~/beta/cgi-bin > perl -MO=Deparse
for (qw/foo bar baz/) {    print;
    while (<>) {
        print "\t$_";
    }
 }
__END__
- syntax OK
foreach $_ (split(/\s+/, 'foo bar baz', 0)) {
    print $_;
    while (defined($_ = <ARGV>)) {
        print "\t$_";
    }
}

tina


-- 
http://tinita.de    \  enter__| |__the___ _ _ ___
tina's moviedatabase \     / _` / _ \/ _ \ '_(_-< of
search & add comments \    \__,_\___/\___/_| /__/ perception
please don't email unless offtopic or followup is set. thanx


------------------------------

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 4142
**************************************


home help back first fref pref prev next nref lref last post