[7917] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1542 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Dec 28 07:07:19 1997

Date: Sun, 28 Dec 97 04:00:24 -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           Sun, 28 Dec 1997     Volume: 8 Number: 1542

Today's topics:
     Craig Patchett and Matt Wright: CookBook-Windows Instal (Hans Schrader)
     DOS & Perl <andrew.spiers@virgin.net>
     Effective Perl Programming is shipping <joseph@5sigma.com>
     file locking and dbmopen databases <jgoerzen+usenet@complete.org>
     Re: Finding the TITLE to a HTML page <joseph@5sigma.com>
     Re: Finding the TITLE to a HTML page <joseph@5sigma.com>
     Re: Finding the TITLE to a HTML page <joseph@5sigma.com>
     Re: Finding the TITLE to a HTML page (Abigail)
     flock v.s. Sun OS <use@reply.address.com>
     Re: Good HTTPd logfile analysis script? nospam@domain.com
     How do I efficiently match many patterns at once? <bugaj@bell-labs.com>
     Re: How do I efficiently match many patterns at once? <joseph@5sigma.com>
     Re: How to sort a set of records ? <joseph@5sigma.com>
     Re: Is there a perl function eq to cut in bash? nospam@domain.com
     Re: Merry XMas perl monsters nospam@domain.com
     need some help (Ted Fiedler)
     Re: need some help <joseph@5sigma.com>
     Re: overloading in function <joseph@5sigma.com>
     Passing shell objects as arguments to perl scripts <smills@lewiston.com>
     Re: Passing shell objects as arguments to perl scripts <joseph@5sigma.com>
     Perl 5.004_4 (Sarayu Balu)
     Re: Perl 5.004_4 <adavid@netinfo.com.au>
     Sorting files <andrew.spiers@virgin.net>
     Re: Which language pays most 17457 -- C++ vs. Java? (Charles F Hankel)
     Re: Which language pays most? Smalltalk, not C++ nor Ja (Robert Dewar)
     Re: y2k compliant perl <tchrist@mox.perl.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sun, 28 Dec 1997 10:06:21 GMT
From: hans.schrader@geol.uib.no (Hans Schrader)
Subject: Craig Patchett and Matt Wright: CookBook-Windows Installation
Message-Id: <6858av$s8v$2@toralf.uib.no>

I have been able to manage to install ALL scripts mentioned in the CGI/Perl 
CookBook into my Windows Box with ActiveState Perl32 and WebSite Pro. 
Experience, changes needed, bugs etc are contained in a series of pages 
that are located at this 
URL="http://hjs.geol.uib.no/SandBox/CookBook/ToolBox/"

Hans Schrader from Bergen in Norway "Web-Eureka"
hans.schraderSPAMbigfoot.com = http://hjs.geol.uib.no/
[SPAM="@"]  


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

Date: Sun, 28 Dec 1997 10:01:19 +0000
From: Andrew Spiers <andrew.spiers@virgin.net>
Subject: DOS & Perl
Message-Id: <34A6236F.CBB6C1EF@virgin.net>

I running PERL under DOS to do my development before putting the script
on the server (save on phone bills). Can I run a DOS perl script from a
web page ? If so how ?

Many Thanks



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

Date: Sun, 28 Dec 1997 00:56:24 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Effective Perl Programming is shipping
Message-Id: <34A60622.568114F8@5sigma.com>

I received a few author copies the day after Christmas.  What a
great post-Christmas present!  It looks great, I've already found
a few (very very minor) bugs, and I'm looking forward to reorganizing
my Perl website as soon as the holiday confusion dissipates.  I'm
still a little stunned that it's a book, it's done, and it's on
its way to the shelves.

Many thanks to all of you who helped with the project, and especially
those of you responsible for all the backorders.

Happy holidays, and watch the web site over the next month for changes
and updates,

	-joseph
     http://www.effectiveperl.com


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

Date: 28 Dec 1997 02:26:53 -0600
From: John Goerzen <jgoerzen+usenet@complete.org>
Subject: file locking and dbmopen databases
Message-Id: <874t3tx48i.fsf@garfield.complete.org>

Hi,

I am writing a program that uses databases via the dbmopen interface.
This program has a potential to be run multiple times and it is
desirable to have the databases be locked (via flock, fcntl, whatever)
to prevent problems & race conditions.

Do dbmopen and friends automatically do that?  If not, what is a good
way to do so?  It seems that Perl creates differently-named files on
different systems (even different between RedHat Linux and Debian
GNU/Linux, for instance).

Thanks,
John

-- 
John Goerzen          | Developing for Debian GNU/Linux (www.debian.org)
Custom Programming    | Debian GNU/Linux is a free replacement for
jgoerzen@complete.org | DOS/Windows -- check it out at www.debian.org.
----------------------+----------------------------------------------
Find out how to avoid all those pesky crashes, lockups, application errors,
and slow applications at http://www.debian.org -- Debian can replace Windows
95 with a much more stable operating system.


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

Date: Sun, 28 Dec 1997 01:54:41 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Finding the TITLE to a HTML page
Message-Id: <34A613CA.2A820667@5sigma.com>

It will, that is, if you also add the s flag to the match.  Doh!

  use LWP::Simple;
  $_ = get "http://www.effectiveperl.com";
  ($title) = m{<title>\s*(.*?)\s*</title>}is;
  print "Title is: $title\n";

Must be bedtime now!

	-joseph

Joseph N. Hall wrote carelessly:
> 
> Either approach handles titles appearing on multiple HTML lines.


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

Date: Sun, 28 Dec 1997 01:51:12 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Finding the TITLE to a HTML page
Message-Id: <34A612FA.6DAD7BD5@5sigma.com>

Something like this, maybe:

  use LWP::Simple;
  $_ = get "http://www.effectiveperl.com";
  ($title) = m{<title>\s*(.*?)\s*</title>}i;
  print "Title is: $title\n";

Or if you are reading from a file, slurp it in all at once
by clearing the input separator variable $/:

  open HTML, "my_html_file" or die $!;
  {
    local $/;
    $_ = <HTML>;
    ($title) = m{<title>\s*(.*?)\s*</title>}i;
    print "Title is: $title\n";
  }

Either approach handles titles appearing on multiple HTML lines.

	-joseph
     http://www.effectiveperl.com

psullivan wrote:
> 
> How would I find the title from a html file? I tried...


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

Date: Sun, 28 Dec 1997 01:55:40 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Finding the TITLE to a HTML page
Message-Id: <34A61405.822FAA71@5sigma.com>

It's not!

	-joseph

> why is this better than:
> 
> { local $/; $html = <HTML> };
> Frank


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

Date: 28 Dec 1997 10:25:04 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Finding the TITLE to a HTML page
Message-Id: <slrn6acab4.50c.abigail@betelgeuse.wayne.fnx.com>

Joseph N. Hall (joseph@5sigma.com) wrote on 1580 September 1993 in
<URL: news:34A612FA.6DAD7BD5@5sigma.com>:
++ Something like this, maybe:
++ 
++   use LWP::Simple;
++   $_ = get "http://www.effectiveperl.com";
++   ($title) = m{<title>\s*(.*?)\s*</title>}i;
++   print "Title is: $title\n";

Eeck. That goes wrong as soon as the page does something like
<!-- <title>Got you</title> -->

You can't extract information from HTML documents with simple regexes.

Try something like:

use LWP::Simple;
use HTML::Parser;

package Extract;
use vars qw /@ISA/;
@ISA = qw /HTML::Parser/;

sub start ($$$$$) {
    my $self = shift;
    my ($tag, $attributes, $attrseq, $origtext) = @_;
    $self -> {title_flag} = 1 if $tag eq 'title';
}
sub end ($$) {
    my $self = shift;
    my $tag  = shift;
    $self -> {title_flag} = 0 if $tag eq 'title';
}
sub text ($$) {
    my $self = shift;
    my $text = shift;
    $self -> {title} .= $text if $self -> {title_flag};
}
sub parse ($$) {
    my $self = shift;
    my $text = shift;
    $self -> {title} = "";
    $self -> SUPER::parse ($text);
    $self -> {title};
}

package main;

my $parser = new Extract;
my $title  = $parser -> parse (get "http://www.effectiveperl.com");
print "Title is: $title\n";



Of course, this fails on:

        <![ IGNORE [ <title>Foo</title> ]]>

or with elements with CDATA declared content.



Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


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

Date: 28 Dec 1997 11:23:47 GMT
From: "John Bokma" <use@reply.address.com>
Subject: flock v.s. Sun OS
Message-Id: <01bd1383$52753b20$02521e0a@tschai>

Hi,

Because I've problems with flock on Sun OS, I used DejaNews to find more
info. I only found one posting mentioning that flock causes problems with
SunOS which are similar with my problems.

I've written a counter based on the famous "Web Techniques" (nr 4).
But sometimes the counter-file is cleared and, hence the counter is reset.

pseudo code:

open(FILE, "+>> ${COUNTER}") or return;

flock FILE, 2;
seek FILE, 0, 0;

#--- read the counter
    
seek FILE, 0, 0;
truncate "${COUNTER}", 0;

#--- write the counter

close(FILE);

Does anyone know what causes this problem? I've already tried to reread the
file when it is reported to be empty (I'll add a sleep(1) and test it
again).

Has it something to do with the truncate?

Should I try fcntl instead (any examples??)

perl -v and perl -V follows:

perl, version 5.004_01

Summary of my perl5 (5.0 patchlevel 4 subversion 1) configuration:
  Platform:
    osname=solaris, osvers=2.5.1, archname=sun4-solaris
    uname='sunos neptune 5.5.1 iss_1.0 sun4m sparc sunw,sparcstation-5 '
    hint=recommended, useposix=true, d_sigaction=define
    bincompat3=y useperlio= d_sfio=
  Compiler:
    cc='cc', optimize='-O', gccversion=2.7.2
    cppflags='-I/usr/local/include'
    ccflags ='-I/usr/local/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=8, usemymalloc=y, randbits=15
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -lndbm -lgdbm -ldbm -ldl -lm -lc -lcrypt
    libc=/lib/libc.so, so=so
    useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=, ccdlflags=' '
    cccdlflags='-fpic', lddlflags='-G -L/usr/local/lib'

Regards,

John



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

Date: Sun, 28 Dec 1997 04:55:56 GMT
From: nospam@domain.com
Subject: Re: Good HTTPd logfile analysis script?
Message-Id: <wZkp.32$OX1.474160@news2.voicenet.com>

Chris Charman (chris.charman@inference.com) wrote:
: Has anyone managed to put together a decent script 
: to do logfile analysis of HTTPd traffic?  Using Logfile:: or not?

: If you'd be willing to share, I'd appreciate it...

Your best bet is to ask on a newsgroup like 
comp.infosystems.www.servers.misc.  You could roll your own 
log analyzer in Perl, but if you don't know how to even 
begin doing this on your own, then your best bet 
is to use a prepackaged program. 

You might try a package called Analog, which gives
a nice HTML-formatted summary of log file data.
We run Analog in UNIX.  Analog is free.  
There's a similar free package called www-stat. 

On the Win32 side, you might have a look at WebTrends.
This is not free, but it's quite good.  Makes nifty pie charts. 
--
##--------------------------------
##  John Nolan  
##  jpn acm org
##--------------------------------


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

Date: Sun, 28 Dec 1997 00:10:37 -0500
From: Stephan Vladimir Bugaj <bugaj@bell-labs.com>
Subject: How do I efficiently match many patterns at once?
Message-Id: <34A5DF4D.167E@bell-labs.com>

FAQ sez:
"How do I efficiently match many patterns at once?
 ...
 Instead, you either need to use one of the experimental Regexp
extension modules from CPAN (which might
well be overkill for you purposes)..."
---

Well, I looked on CPAN and found only 

Devel::RegExp
Text::DelimMatch
 
Which don't seem to have extended functionality for matching
quickly against large arrays of patterns as a replacement for
the:

The following is super-inefficient: 

    while (<FH>) {
        foreach $pat (@patterns) {
            if ( /$pat/ ) {
                # do something
            }
        }
    }

Example in the FAQ... 


Am I missing some deluxe functionality in some module that greatly
expands upon the functionality of the sub _bm_build bit in the FAQ?

Thanks.

LL+P,
Stephan
 

                    "Do computers think?"
---------------------------------------------------------------
Stephan Vladimir Bugaj, Multimedia Communication Research Dept.
Departmental Website:       http://www.multimedia.bell-labs.com
PGPkey from http://www.pgp.net/wwwkeys.html or other keyservers
Non-Lucent website:     http://www.cthulhu-dynamics.com/stephan
FAQs:     http://www.cthulhu-dynamics.com/tech/metametafaq.html 
---------------------------------------------------------------
    STANDARD DISCLAIMER:My opinions are NOT those of LUCENT
---------------------------------------------------------------
             "Do submarines swim?" - E.W. Dijkstra


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

Date: Sun, 28 Dec 1997 00:32:26 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: How do I efficiently match many patterns at once?
Message-Id: <34A60085.65F4B1E7@5sigma.com>

I'm assuming you're trying to determine, for each of many 
strings (like lines from a log file) in turn, whether one 
of several patterns matches the current string.

Basically, you need to precompile each regular expression.
The most direct way to do this is to create a separate
subroutine (a reference to a subroutine, actually) for each 
pattern.  It's a little complicated, since you have to mix 
eval and "closures" and /o together to get it right,and
mix them very carefully indeed.

Without much (probably necessary) explanation, here's a 
snippet from my book (thanks to Randal for the original
version).  It creates a subroutine reference
named $is_big that looks for one of big, large, or huge
in $_.  You can create and use additional functions just
by passing different arguments to make_match.

  sub make_match {
    my $pat = shift;
    eval 'sub { $_[0] =~ /$pat/o; }'
  }

  $is_big = make_match q/\b(big|large|huge)\b/;

  if ($is_big->($_)) { ... }

The example in the FAQ is interesting but seems overblown 
to me.

	-joseph
	 http://www.effectiveperl.com

Stephan Vladimir Bugaj wrote:
> 
> FAQ sez:
> "How do I efficiently match many patterns at once?
> ...
>  Instead, you either need to use one of the experimental Regexp
> extension modules from CPAN (which might
> well be overkill for you purposes)..."
> ---
> 
> Well, I looked on CPAN and found only
> 
> Devel::RegExp
> Text::DelimMatch
> 
> Which don't seem to have extended functionality for matching
> quickly against large arrays of patterns as a replacement for
> the:
> 
> The following is super-inefficient:
> 
>     while (<FH>) {
>         foreach $pat (@patterns) {
>             if ( /$pat/ ) {
>                 # do something
>             }
>         }
>     }
> 
> Example in the FAQ...
> 
> Am I missing some deluxe functionality in some module that greatly
> expands upon the functionality of the sub _bm_build bit in the FAQ?


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

Date: Sun, 28 Dec 1997 00:47:35 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: How to sort a set of records ?
Message-Id: <34A60412.A9CAE8EA@5sigma.com>

It's just a stylistic thing, but remember that the ->
between [0] and {string}, etc. is optional:

  $recordset[0]{string} = "name1";

If you're dropping the quotes around 'string' you might as well
go the full Monty.

	-joseph
     http://www.effectiveperl.com

Jim Bowlin wrote:
> 
> Andreas Mischke wrote:
> >
> > Hi there,
> >
> > I'm a bit confused about complex data structures in Perl 5.
> > I'm trying to sort a set of records by one field of the records:
> > ...
> 
> Try this:
> 
> $recordset[0]->{string}="name1"; $recordset[0]->{number}="4";
> $recordset[1]->{string}="name2"; $recordset[1]->{number}="2";
> $recordset[2]->{string}="name3"; $recordset[2]->{number}="1";
> $recordset[3]->{string}="name4"; $recordset[3]->{number}="5";
> 
> #sorting by field 'number'
> @recordset = sort { $a->{number} <=> $b->{number} } @recordset;
> 
> #output of sorted recordset
> 
> foreach( @recordset) {
>         print "String: $_->{string}\n";
>         print "Number: $_->{number}\n\n";
> }


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

Date: Sun, 28 Dec 1997 05:23:28 GMT
From: nospam@domain.com
Subject: Re: Is there a perl function eq to cut in bash?
Message-Id: <knlp.33$OX1.497630@news2.voicenet.com>

Patience (feng@haas.berkeley.edu) wrote:
: I would like to have the ability to cut columns in Perl.  Is this
: possible or do I have to use the command "cut" in bash?  Is it possible
: then to call bash shell while in Perl script?

Have a look at the "split" function.  It's useful in the 
same sorts of situations as "cut".  And it does more things.  

--
##--------------------------------
##  John Nolan  
##  jpn acm org
##--------------------------------


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

Date: Sun, 28 Dec 1997 04:40:03 GMT
From: nospam@domain.com
Subject: Re: Merry XMas perl monsters
Message-Id: <DKkp.30$OX1.474160@news2.voicenet.com>

brian d foy (comdog@computerdog.com) wrote:
: Gellyfish@btinternet.com (Jonathan Stowe) wrote:

: >  Santa  - a festive perl Module
: >
: >package Santa;
: >
: >sub new {
:       my $class = shift;
: #>   print "Ho, Ho, Ho\n";
: #>   print reverse(split("",$Message)),"\n";
: #>   bless $new_santa;

: >sub DESTROY {
:    my $self = shift;
:    undef $self;
: >  print "See you next christmas\n";


If you want information on destroying yourself this Christmas,
then you should post to a newsgroup which specializes 
on that topic, such as alt.suicide.holiday.

Hope this helps! 
--
##--------------------------------
##  John Nolan  
##  jpn acm org
##--------------------------------


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

Date: 28 Dec 1997 05:17:00 GMT
From: budo@news.ncx.com (Ted Fiedler)
Subject: need some help
Message-Id: <2C35E22BCB99EE05.E2687968E7279CC4.82E74842DBD2C467@library-proxy.airnews.net>


#!/usr/bin/perl

use CGI qw(:standard);

open(TESTBED, ">testbed") || die"cannot open testbed";
system("fortune > testbed");
while (<TESTBED>) {	
	@x = <TESTBED>;
	print header, start_html(fortunatii by budo);
	print p("@x");
	print end_html;
}

I am new to perl, and I want to say thanks again in advance for the help
everyone has given me already, but WHY wont this work? I am using perl 5.003
i am using apache server on a linux box - if that info is at all useful???

                                       Ted Fiedler


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

Date: Sun, 28 Dec 1997 00:42:07 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: need some help
Message-Id: <34A602CA.74E05A44@5sigma.com>

I really don't know where to begin here, but let's stick
to the basics.  First of all, if you're planning to read from
TESTBED you should open it for reading after you write to
it with system.

Of course, you could just run fortune like this:

  open FORTUNE, "fortune|" or die $!;

and then read directly from the output of the program.  Not a
bad idea since otherwise your program may be unable to create
a file anyway (if running as user nobody, or etc., etc.)

The stuff inside start_html must be quoted.

Why not just write 

  print p(<TESTBED>)

Or maybe pre() is more appropriate.

The output of fortune needs to be HTML entity escaped.

I could go on but that should get you started.

	-joseph
     http://www.effectiveperl.com

Ted Fiedler wrote:
> 
> #!/usr/bin/perl
> 
> use CGI qw(:standard);
> 
> open(TESTBED, ">testbed") || die"cannot open testbed";
> system("fortune > testbed");
> while (<TESTBED>) {
>         @x = <TESTBED>;
>         print header, start_html(fortunatii by budo);
>         print p("@x");
>         print end_html;
> }


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

Date: Sun, 28 Dec 1997 01:15:03 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: overloading in function
Message-Id: <34A60A81.A49BA0FE@5sigma.com>

(Perl here)

This is trivial in Perl, but it's fun to talk about anyway.

Let's not forget to point out specifically that the number of supplied
arguments comes from the scalar value of the argument list variable,
@_:

  sub how_many_args_have_i {
    $argc = @_;
    print "I'm a $argc-argument subroutine!\n";
  }

No humanitarian purpose is served by the following snippet, but here
it goes (5.004 only):

  sub way_too_much_technology_here {
    (${{
      1 => sub { print "One argument! (@_)\n" },
      2 => sub { print "Two arguments! (@_)\n" },
      3 => sub { print "Three arguments! (@_)\n" },
    }}{@_} or sub { print "I'm sorry Dave.  I can't do that.\n" })->(@_);
  }

  way_too_much_technology_here 1;
  way_too_much_technology_here 1,2;
  way_too_much_technology_here 1,2,3,4;
  way_too_much_technology_here;

	-joseph
     http://www.effectiveperl.com

brian d foy wrote:
> 
> In article <682e79$rjv$2@nntp1.ba.best.com>, "Xah" <xah@best.com> wrote:
> 
> > How can I write a function so that its behavior depends on the number of
> > arguments?
> 
> in such cases i write a "meta-routine" which figures out how many
> arguments there are then calls another routine to do the actual work.
> the meta-routine can supply default arguments or switch the order
> around if it likes:
> 
> >range[a_]:=range[1,a,1];
> 
>   return &work_routine(1,$[0],1) if scalar @_ == 1;
> 
> >range[a_,b_]:=range[a,b,1];
> 
>   return &work_routine($_[0],$[1],1) if scalar @_ == 2;
> 
> and so on.  good luck :)


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

Date: Sat, 27 Dec 1997 22:12:10 -0800
From: Harry Mills <smills@lewiston.com>
Subject: Passing shell objects as arguments to perl scripts
Message-Id: <34A5EDB8.398D@lewiston.com>

I expect this is a dumb question for this esteemed company, but...

You can pass arguments from perl scripts into shell scripts with the
system command, e.g., you could have the following line in a perl
script:

#!/usr/local/bin/perl

 ...
$foo="Pamela";
$bar="Anderson"

system("/path/to/progname $foo $bar");
 ...

, which passes "$foo" and "$bar" to the unix script "progname," and
executes progname, which might look like the following:

#!/bin/sh
foo="$1"    # Assign $foo to the 1st argument
bar="$2"	# Assign $bar to the 2nd argument

echo "You passed \"$foo\" and \"$bar\" to this script.\n"

And now "$foo" and "$bar" hold the requisite values (in the shell).  I
just don't know how pass variables from a shell script to a perl script.

Any help would be greatly undeserved and just as greatly appreciated.

Harry


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

Date: Sun, 28 Dec 1997 01:39:39 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Passing shell objects as arguments to perl scripts
Message-Id: <34A61044.F30800AC@5sigma.com>

The command line arguments to a Perl program come in via the
@ARGV array.

	-joseph
     http://www.effectiveperl.com

Harry Mills wrote:
> 
[...]  I
> just don't know how pass variables from a shell script to a perl script.


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

Date: 27 Dec 1997 03:33:32 GMT
From: g195115@hpux1.vtmednet.org (Sarayu Balu)
Subject: Perl 5.004_4
Message-Id: <681suc$r94$1@hpux1.vtmednet.org>

 I had the latest perl compiled on Linux 2.0.30. But,
 after that all my CGI.pm, GD.pm, Sprite.pm ,Msql.pm etc
 are broken and stopped working. Do I have to regenerate 
 these packages again ? Is there not a better procedure ?
 Thanks.
-- 
____________________________________________________________________________

Dr.Sarayu Balu,MD.,FAAP                    Tel. (802) 888-2448,2606
Ryder Brook Pediatrics                     sbalu@nyx.cs.du.edu
P.O.Box 608                                Sarayu.Balu@vtmednet.org
Morrisville,VT 05661                       http://www.vtmednet.org/~g195115/
____________________________________________________________________________


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

Date: Sun, 28 Dec 1997 19:03:01 +1100
From: Anthony David <adavid@netinfo.com.au>
To: Sarayu Balu <g195115@hpux1.vtmednet.org>
Subject: Re: Perl 5.004_4
Message-Id: <34A607B4.FD1F656@netinfo.com.au>



Sarayu Balu wrote:

>  I had the latest perl compiled on Linux 2.0.30. But,
>  after that all my CGI.pm, GD.pm, Sprite.pm ,Msql.pm etc
>  are broken and stopped working. Do I have to regenerate
>  these packages again ? Is there not a better procedure ?
>  Thanks.

Hmm. there isn't much to go on, however you may have compiled thenew perl into
/usr/local/bin when your original installation was in /usr/bin .

type perl -V then search for the modules in the library not mentioned eg
/usr/lib/perl5

Regards Anthony

--
Anthony David     |     Opinions expressed ARE
Anthony David & Associates |     those of my employer




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

Date: Sun, 28 Dec 1997 09:59:40 +0000
From: Andrew Spiers <andrew.spiers@virgin.net>
Subject: Sorting files
Message-Id: <34A6230C.A8F00267@virgin.net>

Heres the scenario ;

I have 5 files. I would like to read them in with the oldest file first.

Any ideas ?

Many Thanks




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

Date: Sun, 28 Dec 1997 09:45:20 GMT
From: charles@hankel.mersinet.co.uk (Charles F Hankel)
Subject: Re: Which language pays most 17457 -- C++ vs. Java?
Message-Id: <34a61f24.10392498@news.mersinet.co.uk>


Just to add to this debate, I had to look into the winsock.h file on
my PC the other day and the first glance showed why COBOL is so much
more easy to maintain.  Anyone with a grain of sense would prefer the
sheer readability of COBOL to the mess that I saw.


Charles F Hankel
------------------------------------------------------------------
COBOLs: IBM D, E, F, ANS v4, VS, COBOL 2, LE/370, AIX, S/38, OS/2,
        PC/MS-DOS, Honeywell GCOS, Burroughs 7000, Tandem, HP3000
        all to varying degrees over the past 25 years or so.


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

Date: 27 Dec 1997 23:48:48 -0500
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Which language pays most? Smalltalk, not C++ nor Java.
Message-Id: <dewar.883284068@merv>

G Shwarz replies to Kaz:

<<> A strictly conforming program may not define any external
> name that begins with 'mem' followed by any combination of letters,
> digits or underscores.
Ok. Define void memfoo() { } and see if it compiles.
It does.
>>


It is perhaps one of the most common serious misconceptions about what
language definitions mean to write a reply like this:

A standard specifies what strictly conforming programs do. The fact that
you can observe xyz behavior from a compiler when given a non-conforming
program is perhaps interesting, but has nothing whatsoever to do with the
standard.

I think this inability to understand the fundamental distinction between
the set of things that a standard defines, and the set of behaviors seen
experimentally from a given implementaqtion, is one of the most common
serious lapses of knowledge among programmers. Note that this understanding
must precede the realization that you cannot write correct programs in a 
given language without knowing the standard for that language well. It always
amazes me how badly many C programmers are acquainted with the standard.
Many C programmers have never even *seen* the standard, let alone studied it
carefully to know exactly what it says.

People often argue over the relative merits of languages from a portability
point of view. While it is true that there are some important technical
differences (e.g. dealing with varying size of integer types in C and Ada), 
these technical differences are often swamped in practice by the differences
in level of knowledge of the standard defining document, and very often
"portability" problems are just bugs where clearly non-conforming code has
been written.

OK, so your compiler can compile memfoo without compiling. Wunderbar! But
that does NOT mean that you can actually go ahead and call a routine memfoo
if the standard forbids it. To do so would be incompetent programming.



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

Date: 27 Dec 1997 22:51:19 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: y2k compliant perl
Message-Id: <6840p7$ndk$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    spidaman@well.com (Ian Kallen) writes:
:Enough of the jokes about reasons to ditch perl4 installations, anybody have
:a more elegant way to be y2kosher?

The FAQ, the perlfunc manpage, and the C function's localtime(3) manpage all 
clearly explain that you are supposed to add 1,900 to your annual returnal 
value.  It's not Perl -- or C -- with a y2k problem.  It's the programmers
who aren't y2k compliant.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
"Grant me the serenity to accept the things I cannot change, the courage
to change the things I can, and the wisdom to hide the bodies of the
people that I had to kill because they pissed me off." --Anonymous


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

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

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