[6596] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 221 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 2 15:16:38 1997

Date: Wed, 2 Apr 97 12:00:23 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 2 Apr 1997     Volume: 8 Number: 221

Today's topics:
     ***WHO IS AGENT ACTION!?*** agent@agent.com
     accessing sqlplus or oracle through perl <jsmith@dbtinc.com>
     Re: Common Blocks in text files <rootbeer@teleport.com>
     Re: Date (Simon Hyde (aka Jeckyll))
     Re: dont know to fix <rootbeer@teleport.com>
     Re: Filter: Latex to SGML problem (regular expressions) (Simon Hyde (aka Jeckyll))
     Re: Form post to Sendmail fails (Simon Hyde (aka Jeckyll))
     HELP: case insensitivity <aagha@cis.ohio-state.edu>
     Re: Microsoft Running Naked Through the Streets? (Clinton Pierce)
     Re: Multiplication9s <rootbeer@teleport.com>
     Re: my STDOUT is dying <rootbeer@teleport.com>
     Re: New Microsoft Perl Product (fwd) <harald.joerg@mch.sni.de>
     Re: New Microsoft Perl Product (fwd) <ajohnson@gpu.srv.ualberta.ca>
     Re: New Microsoft Perl Product (fwd) (Matthew Cravit)
     Re: New Microsoft Perl Product (fwd) (Simon Hyde (aka Jeckyll))
     New to PERL <gilbertb@ns.flipag.net>
     Re: Ousterhout and Tcl lost the plot with latest paper <bill@rfa.org>
     Re: Ousterhout and Tcl lost the plot with latest paper <erik@naggum.no>
     Re: Passing an array (@abc) to a Perl extension routine (Simon Hyde (aka Jeckyll))
     PERL Training Course <dhayden@netcomuk.co.uk>
     Re: Perl502 on Os/2? - How? (Ilya Zakharevich)
     Re: Quick Help <jdane@honlab.nmfs.hawaii.edu>
     Suggestions: notation for RE lookbehind (Ilya Zakharevich)
     Re: Suggestions: notation for RE lookbehind (Ilya Zakharevich)
     Re: Where do I get 'h2n' perl script for unix (Simon Hyde (aka Jeckyll))
     Re: wherefrom? (Simon Hyde (aka Jeckyll))
     Re: Who makes more $$ - Windows vs. Unix programmers? (Tim Smith)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 2 Apr 1997 11:33:22
From: agent@agent.com
Subject: ***WHO IS AGENT ACTION!?***
Message-Id: <5hu9lf$epb@chronicle.concentric.net>

1
      **  "CLONING" MOVIE MAY PROVOKE THEATER RIOTS!  **

      Anticipation is so high for the new sci-fi action movie AGENT ACTION!
  that international theater owners are worried.   Some feel their venues may be the 
  magnet for riots.   One of the movies main themes is human cloning.  With cloning 
  as a red-hot topic and the movies anticipated big budget look with gorgeous nude
  US playmates, the number of moviegoers is predicted to be record breaking!  

      AGENT ACTION! is reported to be a sci-fi flick in the secret agent                
  "Bond" Style.  It sports exotic locations, impressive cinematography, and the
   aforementioned naked, big-breasted actresses.  (Including Erika Olsen / Playboy
   Mar 97)  The movie stars and is directed by charismatic and multi talented new 
   leading man William Blair.   It features celebrity guest villains and co-stars the
   talented Jerry Lee Kmiec.

       AGENT ACTION! is currently in the middle of a heated bidding war by international 
   distributors.  The winner may have more than just an ordinary hit on its hands.  
   It may have the milestone catalyst of an international event.

***************************************************************************************************

 2

                      OSCAR PICK FAVE FOR 97 ?   AGENT ACTION!

    Talk for the next Oscars has already started.  And the news is overwhelming for
 one film:  AGENT ACTION!

    What "ACTION" seems to have is what the current Oscar picks lacked:  both 
great directing, great acting, and great writing all in one.    And the lions credit is
aimed at one man; multi -talented star and director William Blair.l

      Insiders are predicting Blair may receive the most multiple Oscar wins ever:
As best actor, best director, and best writer.   What's more: as producer and special 
effects director of photography consultant: he might also nab the best picture Oscar 
and cinematography Oscars, too!   Can Blair and AGENT ACTION! pull off this
 unprecedented feat?

       It would certainly be a day for the all time record books.   Of course this is
 just speculation at this point.  One thing is certain, though, 1997 is the year for 
moviegoers to enjoy AGENT ACTION!


------------------------------------------------------------------------------------------------------------------------------------
3

                     CAN AGENT ACTION! CRUSH SCHWARZENEGGER?


       One fact seems clear:  William Blair is the world's hot new action star!
Not only that, he appears to be a World-Class director as well.  It is this multi-talent 
capability- and freshness- that has Schwarzeneger and Stallone scared - yes, the 
world seems to be saying, replace these old fogies with new talent!

        William Blair, and AGENT ACTION!  seem to be the cure for the movie goers
case of tired old action star Blues!    Arnold / Sly - next stop is the old folks rest home
 for you!

       We're William Blair fans now!  Long live # 1 action star William Blair! - AGENT 
ACTION!

//////////////////////////////////////////////////////////////////////////////////

4

                             SEX, NUDITY, AND AGENT ACTION!

      For the many curious to see big breasted naked actresses in AGENT ACTION!,-
there is good news.   A preview/trailer is now reportedly in the cutting stages. 
 This minute and a half of selected scenes should wet the palate of the curious. 

       AGENT ACTION!, a "Bond" type thriller set in the near future, is highly anticipated. 
It reportedly features the aforementioned Big breasted actresses ( including Erika 
Olsen/ Playboy Mar 97 ) among several other ravishing beauties.

        The movie is said to star and be directed by multi talented new leading man
William Blair.   Celebrity guest villains round out the colorful cast.

          The movie apparently also features lush exotic locations from around the world.
Excellent cinematography and a tight nit thriller story round out this highly anticipated 
production.

         This is probably the most anticipated movie on the planet today.   And the 
thought of a trailer - possibly soon downloadable on the net - is fantastic.   But hurry 
please!  The wait is almost more than curious movie buffs can bear!


******************  ///////////////////////////  ************************* ///////////////

5

                            JAPANESE "ABREAST" OF AGENT ACTION!

       Tokyo.   If there's one group of moviegoers clamoring to see AGENT ACTION! -
It's the Japanese.   They certainly have a yen for big breasted naked blondes - and
AGENT ACTION! will supply that - and more!   

        Nippon theater owners apparently are in a rare fight to obtain the first prints of
 AGENT ACTION!   It is said to be the most anticipated movie in the Orient.
       
 
------------------------------------------------------------------------------------------------------------------------------------
6

                     WHY DOES AGENT ACTION FEATURE NUDE BREASTS?

    'Cause Secret Agents love them!   How could Sean Connery, Roger Moore, or
Pierce Brosnan battle villains without a little jiggle?   And the same goes for new Agent
extraordinaire William Blair - AGENT ACTION!


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

7

                                RUSH - FOR WORLD WIDE RELEASE

             IS AGENT ACTION! THE GREATEST MOVIE EVER MADE?


     Film fans, critics, and cinephiles the world over are engaged in a heated debate. 
 Is the new Sci-fi action film AGENT ACTION! the greatest movie ever made?

     Opposition is fierce.   Names such as Welles, Kubrick, Scorsese, Spielberg, and 
Oliver Stone are of course getting huge support.

     Movies such as Citizen Kane, 2001, Goodfellas, ET, and Platoon are being 
heralded as the all time champs.

     And yet, the new found furor won't subside.  AGENT ACTION! now has its own
 legions of rising vocal fans.   And its star/ director William Blair is receiving the lion's
 share of the credit.
											
        Can this new group of fans, of a movie not yet even released be right?  Can 
the few purportedly bootlegged copies of an advance rough cut be enough proof? 
Is AGENT ACTION! such a highly commendable piece of celluloid?  

       History be damned these new fans seem to be saying.   Forget the work of the
 "old fogies", William Blair Is the brilliant purveyor of cinema's future!

        And AGENT ACTION! is proof - at 24 frames per living color second!

===============================================================

8
                SEX,  ROMANCE,   AND AGENT ACTION - WILLIAM BLAIR! 

     Girls, Good News - William Blair is single!   Yes the 6 ft, 185 lb. leading man is
available!  And if his blue eyes don't get you - his charming and suave manner will!
Check him out in AGENT ACTION!  Then in his exciting new upcoming feature
THE RIDE!  

(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((

9

                            WAR!  - BIDDING BATTLE BREWING

   Major movie distributors are sharpening their pens.  Agents and Lawyers are taking
sides.  Telephone faxes are arming for duty.

    Why?  For the bloody battle over the international distribution rights to AGENT
ACTION!

    The movie world landscape is now upside down.  How?  Witness ancient releases 
like Star Wars now doing first run BlockBuster business.  Plus expensive new releases 
are bombing.  With this confusion its a new war out there.  And formerly defended 
movie turf is up for grabs!

   Which studio army can capture the anticipated blockbuster AGENT ACTION!?

   Will it be a major battaliion force like UNIVERSAL?  Of can a rising guierrila army
like Miramax or Gramercy capture the goods?

   No one can predict the battle's outcome yet.  But one victor is certain: the
Audience.   The World Audience - millions of popcorn and action loving troops who
will be the happy victors as they embrace viewing AGENT ACTION!


^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10

         WILLIAM BLAIR - TRUE INDEPENDENT - NOT SUNDANCE  ASS- KISSER

     While most Independent filmmakers nowadays are just shameless ass kissers - of 
Sundance "god" Robert Redford, William Blair stands alone.

         The so called Independent movie movement is sickening.   Independent - 
Independent of what?

        Most of these films are undisguised "auditions" for studio jobs.  And the cast 
lists of these movies  look exactly like their Studio cousins:   Tori Spelling for godsakes!

         And most of these butt-kiss directors need to start living a life - rather than 
patterning these grotesque homages to angst populated by the ever tiring Steve 
Buscemi ( Whoever said this guy could act? )

          The real barfola however, is how the "intelligensia" and "psuedo hip" are
pronouncing Oscar kudos on these lightweight nothing movies.

         Lets face if folks:  Ransom was a much better film than Fargo.  Wake up you 
morons.   Can anyone even sit through Fargo twice without falling into a deep coma.

     And last years Spitfire Grill - what a joke that was!    It had all the thrills and 
technique of a bad TV movie of the week!

     Is there hope?  Damn tootin! 

      And my vote for movie of the year is AGENT ACTION!   It cuts the sprocket holes 
off those "independent" lemming-ized ass-kisser  movies .

       


///////////////////////////////////////////////////////////////////////////////





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

Date: Wed, 02 Apr 1997 11:48:56 -0500
From: Jeffrey Smith <jsmith@dbtinc.com>
Subject: accessing sqlplus or oracle through perl
Message-Id: <33428DF8.179C@dbtinc.com>

I'm writing a perl script where I have a loop that requires accessing a
sequence that is stored in oracle. How can I directly/quickly access the
sequence without having to log on to sqlplus each time ?


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

Date: Wed, 2 Apr 1997 11:18:10 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: lmsilva@cygnus.lnec.pt
Subject: Re: Common Blocks in text files
Message-Id: <Pine.GSO.3.96.970402111141.12964K-100000@kelly.teleport.com>

On 31 Mar 1997 lmsilva@cygnus.lnec.pt wrote:

> I would like to compare two files and find common blocks of text between
> them. When I say common I mean at least 5 lines of text that are the
> same ( ignoring case and spaces/tabs). I don't have a clue about which
> blocks are similar. 
> 
> I've been trying to use "diff", but it is too much info for such a small
> thing (I've got many files to compare). 

Maybe this would work: For each line in the first input file, convert the
line to a canonical form (lower case with spaces and tabs stripped out).
Calculate a checksum of this line, and use that as a hash key. Into the
hash, store the line number and the offset into the file where the line
starts (from tell()). (If two lines have the same checksum, you'll need to
improve your algorithm in one way or another.)

For the second file, you can calculate the checksum for each line. When
you find a match, you can go back and compare the actual lines to see how
they look.

To make this faster at the expense of memory, use each line as its own
"checksum". To conserve memory, you should select the file with fewer
lines as the "first" one. 

Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Wed, 02 Apr 1997 19:27:58 GMT
From: shyde@poboxes.com (Simon Hyde (aka Jeckyll))
Subject: Re: Date
Message-Id: <33487d00.7664293@news.uni-stuttgart.de>

On Tue, 01 Apr 1997 01:17:48 +0200, Panason <panason@usa.net> wrote:

>How do I get my program to let me know todays date?

print localtime;

Take a look at
http://www.perl.com/perl/nmanual/pod/perlfunc/localtime.html
and http://www.perl.com/perl/nmanual/pod/perlfunc/gmtime.html for more
information.


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

Date: Wed, 2 Apr 1997 11:24:23 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Michael Engel <engel@carmel.cc.huji.ac.il>
Subject: Re: dont know to fix
Message-Id: <Pine.GSO.3.96.970402112102.12964L-100000@kelly.teleport.com>

On Tue, 1 Apr 1997, Michael Engel wrote:

> Newsgroups: comp.lang.perl, comp.lang.perl.misc

Ask your favorite news admin to read the frequent posting in
news.announce.newgroups about bogus newsgroup names to learn why your
system should discontinue comp.lang.perl.

>   foreach $j (0..$npl) {
>   print FNOTIFY "\n",$fldpl[$j]," x ",$plen{$fldpl[$j]};}

> only $j=0 is printed, but not the other $j.

Try adding this line of code for debugging purposes, just before that
code, and see whether you get the answer. 

    print FNOTIFY "\n#### About to print $npl + 1 items.\n";

Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Wed, 02 Apr 1997 19:27:55 GMT
From: shyde@poboxes.com (Simon Hyde (aka Jeckyll))
Subject: Re: Filter: Latex to SGML problem (regular expressions)
Message-Id: <3344730f.5119169@news.uni-stuttgart.de>

On Wed, 2 Apr 1997 11:52:42 GMT, ebohlman@netcom.com (Eric Bohlman)
wrote:

>Andreas Olsson (cie95aol@lustudat.student.lu.se) wrote:
[snip]
>[snip]
>
>: $patt =~ s|\\section(.*)\\section|<chapter>$1</chapter>|gs;
>
>: The code above only matches the first and last "\\section" and if I use the
>: ? inside the paranthesis I only get a match for the two first "//section".
>: How should I write my expression so that it goes through the whole $patt?
>
>The reason for your problem is that after you've done your first 
>substitution, you've zapped the second "\\section" which means that the 
>next attempt to match won't see anything beginning with "\\section" and 
>therefore will be skipped, so you'll only convert every other section.
>
>The solution is to use a lookahead assertion:
>
>s|\\section(.*?)(?=\\section)...
>
[snip]
>
>BTW, neither your original pattern nor this modification will properly 
>convert the last section in your text.
>
however, I think the following will:
$patt =~ s#\\section(.*)(?=(?:\\section)|$)#<chapter>$1</chapter>#gs;


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

Date: Wed, 02 Apr 1997 19:27:54 GMT
From: shyde@poboxes.com (Simon Hyde (aka Jeckyll))
Subject: Re: Form post to Sendmail fails
Message-Id: <33436f87.4214711@news.uni-stuttgart.de>

On 2 Apr 1997 10:38:00 GMT, Jonathan.J.Forster@lloydsoflondon.co.uk
(Jonny Golden Bollocks) wrote:

>I've got a simple form that posts data to a perl script which in turn
>sends the data to a user via Sendmail.
>
>The problem is: running the script from a command line as root works fine
>but submitting data via a web page 
                           ^^^^^^^^ Sounds like a CGI problem, not a
perl problem, and therefore belongs in
comp.infosystems.www.authoring.cgi, not comp.lang.perl.misc. But i'll
have a go at directing you as to what you might want to ask in there
>fails (the Web server is not running as  root). I realise that Sendmail
>is fussy about it's trusted users.
How does it fail, a copy of the error message produced by the server
to the browser and what the server put in the error logs might help
them a lot, anything that gives a slightly better description of
what's actually going on then just that it "fails".
>
>Other than running the webserver as root, is there any way of getting around
>this problem?

I know that isn't the only way to get round this, if sendmail
requiring the user to be root is the problem at all(which i seriously
doubt). Most CGI scripts i've seen that send emails use sendmail, and
I know that not many people are stupid enough to run a web server and
CGI as root, this would allow any user with CGI access to have root
acces, allowing them to do anything to your system, not a very good
idea at all.


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

Date: Wed, 02 Apr 1997 12:30:30 +0000
From: "Aurangzeb M. Agha" <aagha@cis.ohio-state.edu>
Subject: HELP: case insensitivity
Message-Id: <33425165.5D03@cis.ohio-state.edu>

Sorry this is a bit long winded.  I'm using perl5.003 to grab zipcodes
from a flat file.  The problem is that I initially wrote the code to
handle numeric zipcodes only, and now I'm confronted with using Canadian
zipcodes too.  I used:

    # if $zipcode is a substring of $zip starting at position 0
    if ($zipcode eq substr($zip, 0, $length)) {
       # get $zip record
    }

which works fine for numerical and EXACT alpha-numeric matches.  How can
I modify this code so that if $zipcode is 'V6k7y6' and $zip is 'v6k7y6',
the if-statement is found true?

I tried:

    if (/$zipcode/i eq substr($zip, 0, $length))

but this would obviosuly only match if I was doing a pattern search.

*ANY* help would be appreciated.  Please eMail me at: 

	aagha@cis.ohio-state.edu

	Thanks,
	Aurangzeb

PS -- I use '$zipcode eq substr($zip...)' instead of '/$zip/ #match'
because the length of $zipcode changes on a regular basis.  Thx.


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

Date: 1 Apr 1997 15:49:27 GMT
From: cpierce1@cp501.fsic.ford.com (Clinton Pierce)
Subject: Re: Microsoft Running Naked Through the Streets?
Message-Id: <5hraq7$3me2@eccws1.dearborn.ford.com>

In article <5hc0e7$ger$1@bob-marley.nfic.com>,
	nvp@bill-graham.nfic.com (Nate Patwardhan) writes:
>I've heard rumours that Microsoft is running naked through the
>streets.  Well I suppose it's their perogative, as they own the
>streets they're running naked through.

Bill Gates running through the streets naked?

  (*take a glance out the window*)

Now I know why it's called "MicroSoft".



-- 
+------------------------------------------------------------------------+
|  Clinton A. Pierce    |   "If you rush a Miracle Man,   | http://www.  |
|  cpierce1@ford.com    |     you get rotten miracles"    | dcicorp.com/ |
|   cpierce@mica.net    |--Miracle Max, The Pricess Bride | ~clintp      |
+------------------------------------------------------------------------+
GCSd-s+:+a-C++UALIS++++P++++L++E---t++X+b+++DI++++G++e+>++h----r+++y+++>y*



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

Date: Wed, 2 Apr 1997 11:31:15 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Steven Sajous <steve@golf.com>
Subject: Re: Multiplication9s
Message-Id: <Pine.GSO.3.96.970402112945.12964N-100000@kelly.teleport.com>

On Wed, 2 Apr 1997, Steven Sajous wrote:

> Is there a way to keep this freom happening?
> 
> $value =19.95;
> $number = 1;
> 
> $total = $value * $number
> 
> I get $total = 19.950000000000000698

Method number one: Give up programming and take up meditation instead.

Method number two: Use (s)printf to specify the output format you desire. 

Either one may work for you, but the first one may give you more peace of
mind. Hope this helps! 

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Wed, 2 Apr 1997 11:10:46 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: SMS/Christian Fowler <sms@magenta.com>
Subject: Re: my STDOUT is dying
Message-Id: <Pine.GSO.3.96.970402110954.12964J-100000@kelly.teleport.com>

On 1 Apr 1997, SMS/Christian Fowler wrote:

> System is ULTRIX running PERL 4.0.1.8. 

Your problem is probably fixed in current versions of Perl. Hope this
helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Wed, 02 Apr 1997 17:27:03 -0100
From: Harald Joerg <harald.joerg@mch.sni.de>
To: Paddy Spencer <paddy.spencer@parallax.co.uk>
Subject: Re: New Microsoft Perl Product (fwd)
Message-Id: <3342A4F7.E2B@mch.sni.de>

Paddy Spencer wrote:
 
> Obj(Newbie)Perl:
> 
> I know you can do this:
>         $arg eq "-n" || die "Use -n you moron!!\n";
> and if you try doing
>         $arg eq "-n" || $arg = "-n";
> it complains about modifying logical or operator. Any way around this
> or does one have to use the incredibly passe if(...){} construct?

Just two of many ways:
1) Use   or   instead of   ||   (Operator precedence)
2) Write  $arg = "-n";          (which is what you want to achieve)

--haj--


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

Date: Wed, 02 Apr 1997 09:33:25 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: New Microsoft Perl Product (fwd)
Message-Id: <33427C45.250A5528@gpu.srv.ualberta.ca>

Paddy Spencer wrote:
> 

> Obj(Newbie)Perl:
> 
> I know you can do this:
> 
>         $arg eq "-n" || die "Use -n you moron!!\n";
> 
> and if you try doing
> 
>         $arg eq "-n" || $arg = "-n";
> 
> it complains about modifying logical or operator. Any way around this
> or does one have to use the incredibly passe if(...){} construct?
> 

you could do:
($arg eq "-n")||($arg="-n");

or

$arg eq "-n" or $arg="-n";


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

Date: 2 Apr 1997 10:35:59 -0800
From: mcravit@best.com (Matthew Cravit)
Subject: Re: New Microsoft Perl Product (fwd)
Message-Id: <5hu8uf$3sr@shellx.best.com>

In article <859989020.901493@red.parallax.co.uk>,
Paddy Spencer <paddy.spencer@parallax.co.uk> wrote:
>	$arg eq "-n" || $arg = "-n";
>
>it complains about modifying logical or operator. Any way around this

I would probably write it as:

	$arg = "-n" unless ($arg eq "-n");

But, if you always want the argument to be "-n", why not just do

	$arg = "-n";

and be done with it? :)

/MC
-- 
--
Matthew Cravit, N9VWG               | Experience is what allows you to
E-mail: mcravit@best.com (home)     | recognize a mistake the second
        mcravit@taos.com (work)     | time you make it.


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

Date: Wed, 02 Apr 1997 19:27:56 GMT
From: shyde@poboxes.com (Simon Hyde (aka Jeckyll))
Subject: Re: New Microsoft Perl Product (fwd)
Message-Id: <33457569.5721286@news.uni-stuttgart.de>

On Wed, 02 Apr 1997 14:50:59 GMT, paddy.spencer@parallax.co.uk (Paddy
Spencer) wrote:

[snip all stuff to do with M$]
>Obj(Newbie)Perl:
>
>I know you can do this:
>
>	$arg eq "-n" || die "Use -n you moron!!\n";
>
>and if you try doing 
>
>	$arg eq "-n" || $arg = "-n";
>
try sticking brackets round one or both of the sides, this should fix
it.
>it complains about modifying logical or operator. Any way around this
>or does one have to use the incredibly passe if(...){} construct?
well...you could do:
$arg = "-n" if ($arg eq "-n"); #not quite as bad as if(...){}


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

Date: Wed, 02 Apr 1997 14:39:02 -0800
From: Banks Family <gilbertb@ns.flipag.net>
Subject: New to PERL
Message-Id: <3342E006.74C5@ns.flipag.net>

Hi Perlers,

I a total beginner to PERL ... actually I haven't started.  I've 
downloaded PERL5 for Win32.  How do I compile with it? What other things 
do I need to know before jumping in?

Also, I wanted to use PERL5 on a UNIX platform.  How do I get a copy ... 
the copy I say had the ".tar.gz" extension it.  Do I need a special 
application to open this file up?

Thank You,
Gilbert Banks
maito:gilbertb@ns.flipag.net


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

Date: Wed, 02 Apr 1997 11:52:07 -0500
From: Bill Eldridge <bill@rfa.org>
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <33428EB7.3F4F@rfa.org>

> >Various studies have shown
> >that programmers can write roughly the same number of lines of code
> >per year regardless of language[2], so system programming languages
> >allow applications to be written much more quickly than assembly
> >languages.

This is pretty doubtful - you can write and debug the same amount
of assembler & Python code in a year, including debugging?  How
about developing new related programs based on earlier work?
How about modifying/debugging someone else's code?  And completely
unrelated to the task you're trying to do?  (device drivers,
numerical methods, GUI's, databases, etc.)  

> >information from being used in any other way. In a weakly typed
> >language there are no a priori restrictions on how information can be
> >used: the meaning of information is determined solely by the way it is
> >used, not by any initial promises.

Occasionally, "weakly-typed" languages are actually "programmer-typed":
"Oh, it screwed up an interpreted this as an integer, well, I'll just
throw an ascii conversion function around it".

Actually, I thought C++ allows pretty generic function mapping on
whatever types you throw into a function.

> > Scripting languages are often used to extend the features
> >of components but they are rarely used for complex algorithms and data
> >structures;

I thought Perl was quite good at complex data structures.
Maybe I'm confusing something (perhaps Perl really does nothing,
it's all just Unix/C at heart.  Alas, we were fooled all along).


> >button .b -text Hello! -font {Times 16} -command {puts hello}
> >
> >This command creates a new button control that displays a text string
> >in a 16-point Times font and prints a short message when the user
> >clicks on the control. It mixes six different types of things in a
> >single statement: a command name (button), a button control (.b),
> >property names (-text, -foreground, and -command), simple strings
> >(Hello! and hello), a font name (Times 16) that includes a typeface
> >name (Times) and a size in points (16), and a Tcl script (puts
> >hello). Tcl represents all of these things uniformly with strings. In
> >the button example the properties may be specified in any order and
> >unspecified properties are given default values; more than 20
> >properties were left unspecified in the example.
> >
> >The button example requires about 25 lines of code in three procedures
> >when implemented in C++ with Microsoft Foundation Classes. Just
> >setting the font requires 7 lines of code:
> >
> >LOGFONT lf;
> >
> >memset(&lf, 0, sizeof(lf));
> >
> >lf.lfHeight = -16;
> >
> >strcpy(lf.lfFaceName, "Times New Roman");
> >
> >CFont *fontPtr = new CFont();
> >
> >fontPtr->CreateFontIndirect(&lf);
> >
> >buttonPtr->SetFont(fontPtr);


CButton* button1;
CButton* button2;
button1 = new CButton();
button1->Create("Push me", WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, r, this,
101)
button2 = new CButton();
button2->Create("Pull you", WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, r, this,
102)
font = new CFont;
font->CreateFont(16,0,0,0,700,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,
	DEFAULT_QUALITY,DEFAULT_PITCH|FF_DONTCARE,"times");
button1->SetFont(font)
button2->SetFont(font)

Basically 3 lines to create a font (reusable assuming you only 
what a few types of fonts, set up a function to handle size changes
if it's the same, you can also create a simple function to handle
defaults for everything but the size and type.

3 lines to create a Button.

I don't know where Oesterhout's reference on MFC comes from
(I'm just looking at Brain & Lovette's book).

>
> >The reason why object-oriented programming has not lived up to
> >expectations is that it doesn't raise the level of programming or
> >encourage reuse.  Programmers still work with small basic units that
> >must be described and manipulated in great detail. In principle,
> >powerful library packages could be developed, and if these libraries
> >were used extensively it could effectively raise the level of
> >programming. However, not many such libraries have come into
> >existence. 

> >The strong typing of object-oriented languages encourages
> >narrowly defined packages that are hard to reuse. Each package
> >requires objects of a specific type; if two packages are to work
> >together, conversion code must be written to translate between the
> >types required by the packages.

If you define the interface well in OOL's, you can handle a variety
of typed inputs.  It's much easier to extend that typing in OOL's than
with something like C (and have deterministic output).  I would guess
serious programmers do develop their own libraries, or work with
corporate standard ones (what does Adobe use? they can't be rewriting
every graphics routine from scratch).  Having classes inherit methods
and types is much nicer than having everything default to a string
and thinking that's sufficient.  MFC is a help for OOP exactly by
defining libraries that simplify programming.  The dangers on
simplification
include that it might come at the expense of too much speed, that
it might not provide the tools to do everything a lower level 
approach would, or that in doing more complex tasks, the "simpler"
language actually becomes more obfuscated than the lower-level
languages.


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

Date: 02 Apr 1997 17:36:10 +0000
From: Erik Naggum <erik@naggum.no>
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <3068991370338285@naggum.no>

* Bill Eldridge
| I don't know where Oesterhout's reference on MFC comes from
| (I'm just looking at Brain & Lovette's book).

considering that bad code can be written in any language, any language
comparison performed using examples must be judged by the quality of the
examples in each language.  it can't be all that hard to write a bad
example in language A and a good example in language B, and then proclaim
language B to be the winner -- this is how people compare languages all the
time, so either those who read them are bad programmers in any language (or
are not programmers at all) and don't know how to reject the bad examples,
or they already agree with the author of the comparison that language B is
better than language A.  in either case, it's a waste of anything but
marketing money.  it appears to me that this is indeed how Tcl is marketed.

in other words, prepare to see Tcl claim a significant market share.  also,
I'm sure people who read a paper with such a pompous title are unable to
detect any amount of false marketing.  "Scripting: Higher-Level Programming
for the 21st Century", indeed.

a language is only as good as the worst example in languages it claims to
win over.

#\Erik
-- 
I'm no longer young enough to know everything.


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

Date: Wed, 02 Apr 1997 19:27:57 GMT
From: shyde@poboxes.com (Simon Hyde (aka Jeckyll))
Subject: Re: Passing an array (@abc) to a Perl extension routine
Message-Id: <33477a8a.7034215@news.uni-stuttgart.de>

On 1 Apr 1997 00:07:14 GMT, "Wen Ting" <ting@platinum.com> wrote:

>Does anybody have successful experience of passing an array to a Perl
>extension?
>
>For example,
>in my Perl script:
>
>@stringary = ("abc", "def") ;
>Module::Function(stringary);
>
>in my Perl extension routine
>Function(stringary)
>   char ** stringary;
>
>I think it should work, but it does not.  Any advice is appreciated.
well...the second bit looks nothing like perl to me

You could:
1. change the first bit to:
  @stringary = ("abc", "def") ;
  Module::Function(@stringary);
  and the second bit to:
  sub Function{
	my(@stringary) = @_;

2. or if you are likely to be passing more than one parameter to the
function
  @stringary = ("abc", "def") ;
  Module::Function(\@stringary);
  and the second bit to:
  sub Function{
	my($stringary) = shift(@_);
	my(@stringary) = @$stringary;
	undef $stringary;
	#maybe this could be shortened to: my(@stringary) =
@{shift(@_)};


	



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

Date: 1 Apr 1997 13:52:51 GMT
From: "The Big Banana" <dhayden@netcomuk.co.uk>
Subject: PERL Training Course
Message-Id: <01bc3ea3$da656240$6502a713@fce04438.jubilee.ford.com>

I am looking for a training course in the UK, that covers PERL. Any help
would be much appreciated.



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

Date: 2 Apr 1997 17:29:33 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl502 on Os/2? - How?
Message-Id: <5hu51t$p4b$2@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Dan Ascheman
<asched1@medtronic.COM>],
who wrote in article <5hrbil$7kv$1@gazette.corp.medtronic.com>:
> that's my question - How do you compile/build Perl502b.zip on OS/2?
> I also need to use the Alpha compiler.  I have compiled Perl5.3 with the 
> Alpha compiler on UNIX, and successfully converted a Perl script into C
> code
> and then into a C executable - I need to do the same on OS/2 - Anyone know
> how?  I have everything I need, but how to you install Perl on OS/2 with
> patches?

Do not. Get a real port from CPAN. 

Ilya


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

Date: 02 Apr 1997 08:35:08 -1000
From: Joe Dane <jdane@honlab.nmfs.hawaii.edu>
Subject: Re: Quick Help
Message-Id: <29hghpclyb.fsf@honlab.nmfs.hawaii.edu>

>>>>> "Mark" == Mark C Seigle <mianzo+@cs.cmu.edu> writes:

    Mark> Hey all!  Look, I am new to perl, and I need a quick command
    Mark> that will take a scalar or an array and convert it to
    Mark> lowercase.  Subtracting 48 from the value, (for all of us
    Mark> old C programmers!), doesn't seem to work.  Any help will be
    Mark> grealy appreciated...

    Mark> 	Thanx,

    Mark> -- Mark C. Seigle School of Computer Science Operations
    Mark> Carnegie Mellon University

Use ``lc'', as in

@a = ("ALL CAPS", "Init Caps", "RanDoM CaPS", "no caps");
$b = "CAPS";

print lc $b, "\n";
print map { lc $_ } @a, "\n";


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

Date: 2 Apr 1997 18:15:09 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Suggestions: notation for RE lookbehind
Message-Id: <5hu7nd$s7m$1@mathserv.mps.ohio-state.edu>

Lookahead is currently (?=) and (?!), make suggestions for notations
for positive and negative lookbehind.

If you suggestions are good enough, it may be even implemented some
time ;-).

Ilya


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

Date: 2 Apr 1997 19:52:20 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Suggestions: notation for RE lookbehind
Message-Id: <5huddk$4am$1@mathserv.mps.ohio-state.edu>

> Lookahead is currently (?=) and (?!), make suggestions for notations
> for positive and negative lookbehind.
> 
> If you suggestions are good enough, it may be even implemented some
> time ;-).

The intermediate winner is Tom Phoenix, with his
	(?<=...) and (?<!...)

I doubt something better can be made :-(.

Ilya


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

Date: Wed, 02 Apr 1997 19:27:56 GMT
From: shyde@poboxes.com (Simon Hyde (aka Jeckyll))
Subject: Re: Where do I get 'h2n' perl script for unix
Message-Id: <334676e5.6100863@news.uni-stuttgart.de>

On 1 Apr 1997 09:52:19 GMT, "michael" <mike_hayden@inetuk.wang.com>
wrote:

>Dear All,
>
>I'm trying to locate the 'h2n' hosts-to-name perl tool for use in
>publishing DNS files on a Unix system.
>
>I've got Perl5 but this doesn't include the above script. I've looked on
>various sites, namely www.perl.hip.com and www.ora.com but without luck. I
>realise I could make use of the NT version of perl+scripts as this already
>has the 'h2n' script, but this requires me running NT Workstation and then
>transmitting the files generated onto the unix end system.
>
>It would be neater and more compact to keep averyting together under one
>OS.
>
>Anyone know any good perl-script library sites for unix??
>
>
You might want to try the perl web site at www.perl.com and also CPAN
at www.perl.com/CPAN


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

Date: Wed, 02 Apr 1997 19:27:58 GMT
From: shyde@poboxes.com (Simon Hyde (aka Jeckyll))
Subject: Re: wherefrom?
Message-Id: <33498091.8577593@news.uni-stuttgart.de>

On 31 Mar 1997 21:19:17 GMT, 0228462749-0001@t-online.de (Jens
Ostermann) wrote:

>Hi, maybe a stupid question, but
>
>where can i get the sources or a precompiled version of Perl5
>for a HP-Unix mashine?
>
>Netscape-search failed.
>
Just grab and compile the perl sources from
http://www.perl.com/CPAN/src/latest.tar.gz


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

Date: 2 Apr 1997 08:17:57 -0800
From: tzs@halcyon.com (Tim Smith)
Subject: Re: Who makes more $$ - Windows vs. Unix programmers?
Message-Id: <5hu0rl$hnm$1@halcyon.com>

In article <333A694D.BBF@ipgeek.com>, Albert Yang  <lithium@ipgeek.com> wrote:
>I think there is something that is missing from the discussion on this
>topic; mainly that the reason UNIX was designed was so that the average
>joe CAN'T use it.  It's like the internet, it's not for everybody... it

Are you seriously trying to claim that when ken and dmr acquired their
PDP-7, they considered the possibility that the system they were designing
specifically for that hardware (portability in operating systems was not yet
a concern) might still be around when consumer level computers became
powerful enough to need operating systems, and designed it so the average
joe would not be able to use it???

--Tim Smith


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 221
*************************************

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