[13745] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1155 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 22 20:06:10 1999

Date: Fri, 22 Oct 1999 17:05:12 -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: <940637112-v9-i1155@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 22 Oct 1999     Volume: 9 Number: 1155

Today's topics:
    Re: Apache/mod_perl/ApacheDBI problem (David Henry)
    Re: authentification with perl/cgi? <rootbeer@redcat.com>
        Can't do "make" on perl module <dutch@mindspring.com>
    Re: Card shuffling <pavese@chem.columbia.edu>
        file sorting <spyder@pikesville.net>
    Re: formatting text with filling '.'s <Frank.Mower@East.sun.com>
        FTP <altpet@westel900.net>
        getting mail from local account c_zarrella@my-deja.com
        Getting Parent directory from path!!!!!!!!!!!!!!!!!!!!! krun@my-deja.com
    Re: How can I join two hashes? <rootbeer@redcat.com>
    Re: How can I join two hashes? <newsposter@cthulhu.demon.nl>
    Re: How can I join two hashes? <lr@hpl.hp.com>
        how do you run cgi scripts on a NT <viper@hal-pc.org>
    Re: how do you run cgi scripts on a NT <rootbeer@redcat.com>
    Re: How to round a number? <rootbeer@redcat.com>
    Re: How to round a number? <skilchen@swissonline.ch>
    Re: Ignore the idiots <flavell@mail.cern.ch>
    Re: Is there a module to parse a HTML-file like this? <skilchen@swissonline.ch>
        need suggestion for data logging setup <mkreutzer@my-deja.com>
    Re: New short cut assignment operators? <flavell@mail.cern.ch>
    Re: Newbie - Help on installing perl <hal_mounce@amdahl.com>
    Re: Oh god! Not another Net::ftp question! (Kenneth Herron)
        passing an array as a hash value? (Ran Shoham)
        Regular Expression problem <jperkins@mail.wtamu.edu>
    Re: seeking past 4GB <elaine@chaos.wustl.edu>
    Re: seeking past 4GB <rootbeer@redcat.com>
        string question <aerial@online.no>
        Thanks for the Array help (Joe Zelwietro)
        tough regex problem <@mdo.net>
    Re: tough regex problem <lr@hpl.hp.com>
    Re: Unlink <sswaminathan@micron.com>
    Re: Unlink <lr@hpl.hp.com>
    Re: Unlink <sswaminathan@micron.com>
        Where do perl scripts get their environment from? (David Henry)
    Re: Where do perl scripts get their environment from? <rootbeer@redcat.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 22 Oct 1999 20:24:16 GMT
From: henryd@netvision.net.il (David Henry)
Subject: Re: Apache/mod_perl/ApacheDBI problem
Message-Id: <3810c73f.600234@tvroom>

On Mon, 18 Oct 1999 16:45:58 GMT, "Daniel W. Burke" <dwb1@home.com>
wrote:

>
>
>Hello,
>
>I seem to be running into a problem with the ApacheDBI module.  When I
>try to use the module in httpd.conf, on startup I get an error from
>DynaLoader.pm, that it cannot load the DBI module.
>
I had a similar problem, but with the Informix DBD. I got around it by
adding a line to the %ENV hash for the correct LIBRARY_PATH e.g.
%ENV = { %ENV,"LIBRARY_PATH","/opt/informx/lib");
In fact there were also other essential bits of the enviroment missing
that I added via the same trick;


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

Date: Fri, 22 Oct 1999 14:07:47 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: authentification with perl/cgi?
Message-Id: <Pine.GSO.4.10.9910221405560.29843-100000@user2.teleport.com>

On Fri, 22 Oct 1999, Alexander Knack wrote:

> i want a perl-CGI application to send an authorisationrequest to the
> client.
> i don't want to create a .htaccess file or something like this - the
> perlscript
> should handle the authentification. my problem is: i don't actually know
> how
> to do this. 

Use the protocol the browser is expecting. If you're not sure what this
is, you should probably search out information on browsers and their
protocols. Start with comp.infosystems.www.authoring.cgi.

Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Fri, 22 Oct 1999 19:33:29 -0400
From: "Dutch McElvy" <dutch@mindspring.com>
Subject: Can't do "make" on perl module
Message-Id: <7uqrpa$ipj$1@nntp2.atl.mindspring.net>

Subject: Can't do "make" on perl module

I can run perl programs on my linuxppc distribution but for some reason when
I try to install a perl module, I can do a "Makefile.PL" but when I try to
do a make for the perl module I get a bash "make" command not recognized.

I can install the same module fine on an SGI box. The linux is running perl
5.005

Can anyone tell me what I can do to get this module installed?

An email reply is apppreciated,

Thanks,

dutch@mindspring.com


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

Date: 22 Oct 1999 17:54:37 -0400
From: Marc Pavese <pavese@chem.columbia.edu>
Subject: Re: Card shuffling
Message-Id: <s1u2njvz6q.fsf@flash46.i-did-not-set--mail-host-address--so-shoot-me>

dwilgaREMOVE@mtholyoke.edu (Dan Wilga) writes:

> In article <38108BD7.4915FA02@earthlink.net>, andrew_lee
> <andrew_lee@earthlink.net> wrote:
> 
> > Mikko Saari wrote:
> > 
> > > I need a perl script to handle decks of cards. My first and most
> > > obvious problem is shuffling, a problem which has bothered me
> > > previously. How do I arrange an array in random order?

[snip]

FYI, there is a module that does this on CPAN - Games::Cards.

			--- Marc.


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

Date: Fri, 22 Oct 1999 23:49:09 GMT
From: "V.B." <spyder@pikesville.net>
Subject: file sorting
Message-Id: <3810F6CE.B4906BF0@pikesville.net>

HI!
im still in the "newbie" learning stages,,
i have a file,,, myfile.ext, it contains multiple single line entries,
each entry contains 7 ";" delimited values,,, id like to sort the file
by the 5th value of each entry,,,.
if read the sort faq and perlman , but it only confused me ,,, if anyone
can point me in the direction of a good example, id be overjoyed!
thankyou!



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

Date: Sat, 23 Oct 1999 00:44:22 GMT
From: Frank Mower <Frank.Mower@East.sun.com>
Subject: Re: formatting text with filling '.'s
Message-Id: <19991023.442200@broken.Ecd.East.Sun.COM>

Well...I posted this once, but apparently not all news servers
and/or news readers can handle the base64 formatted reply that
netscape spits out.  Here goes again, hopefully in plain text:

Jared Evans wrote:

> Hi,
>
> Is there an easy way to produce this output:
>
> Eggs..............$2.00
> Bacon.............$3.00
> One gallon Milk...$4.00
>
> As you can see the prices are all lined up and the area between the
> item and prices are filled with '.' instead of spaces.
>
> I could do character counting and add the right number of dots to each=
=20
line,
> but am wondering if there was a dirty n' easy trick to do with with=20
something
> like Format?
>
> Jared

How about using the maximum string width option in printf:

printf "%.18s%s\n", $item . "." x 18, $price;

Regarding using   tr/ /./   as others have suggested, the output would
look like "One.gallon.Milk...$4.00" which Is not what Jared is=20
seeking.

Frank

--My opinions are my own and I do not speak for Sun Microsystems.--





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

Date: Fri, 22 Oct 1999 23:53:27 +0200
From: "Altorjai Péter" <altpet@westel900.net>
Subject: FTP
Message-Id: <7uqmto$eke$1@newsgate.elender.hu>

Hi there

I am a 'green-headed' newbie to PERL , but not only computing. Please help
me in the following :

I would need to have a HTML , within a FORM to fill , and FIELD would get
the content of a BROWSER Button - a file name.
I would like to know the way of writing the PERLcode of FTPing this file to
a certain account (ftp.xyz.com ; xyz/xyz ) .

That would really help me solving a problem with my website about MIDI
music. Thanx for All of Your help in advance .)

Bye

--
Altorjai     Peter

GSM:+36 30 9191360
altpet@westel900.net
cyberion@technologist.com





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

Date: Fri, 22 Oct 1999 21:42:09 GMT
From: c_zarrella@my-deja.com
Subject: getting mail from local account
Message-Id: <7uqlnh$i5v$1@nnrp1.deja.com>



I am writing a routine that works on a local account's mail.  Currently
it just parses the /var/spool/mail/user file directly and then removes
the file after it finishes.  Unfortunately this could create a
contention problem if the perl routine attempts to zero out the file
while the account is receiving mail.

Ideally, I want to use a mail client interface to mark and delete the
mail.  I've looked at the POP3 client module and the Mailtools module
but they do not seem to be what I'm looking for which is this:  read the
first message, process it then delete it; continue with the next
message.  (Just like using /bin/mail but automatically).  Any tips or
suggestions?

Use /bin/mail itself, or is there a Perl module that can do this task?

--
serge@io.com
Christopher Zarrella


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


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

Date: Fri, 22 Oct 1999 20:58:27 GMT
From: krun@my-deja.com
Subject: Getting Parent directory from path!!!!!!!!!!!!!!!!!!!!!!
Message-Id: <7uqj5i$ge3$1@nnrp1.deja.com>

We have a file with a lot of paths. We are trying to get the parent of
these path's into an array called @parent.  If no parent exists in the
case of ".\foo" a zero should be placed in that spot of the array so we
know that no parent exist at that location.

Example of a few paths in the file:

 .\foo
 .\ppc603\delivery\release\static\Measurement\Sequence\libSBB@@
 .\ppc603\delivery\release\static\Measurement\Sequence\libSDD@@
 .\ppc603\delivery\release\static\Measurement\Sequence\libSSL@@
 .\ppc603\delivery\release\static\medmake_ppc@@
 .\vxworks603@@
 .\vxworks603\delivery@@
 .\vxworks603\delivery\bin@@
 .\vxworks604@@
 .\vxworks604\delivery@@
 .\vxworks604\delivery\bin@@
 .\x51@@
 .\x51\delivery@@
 .\x51\delivery\bin@@
 .\x86@@
 .\x86\delivery@@
 .\x86\delivery\bin@@

Thank you

Krun


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


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

Date: Fri, 22 Oct 1999 14:14:39 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: How can I join two hashes?
Message-Id: <Pine.GSO.4.10.9910221412010.29843-100000@user2.teleport.com>

On 22 Oct 1999, Erik van Roode wrote:

> my %hash = (%hash1, %hash2);

For larger hashes, this should be equivalent, but (potentially much)
faster.

    my %hash = %hash1;
    @hash{ keys %hash2 } = values %hash2;

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 22 Oct 1999 21:58:29 GMT
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: How can I join two hashes?
Message-Id: <7uqmm5$end$1@internal-news.uu.net>

Tom Phoenix <rootbeer@redcat.com> wrote:
> On 22 Oct 1999, Erik van Roode wrote:

>> my %hash = (%hash1, %hash2);

> For larger hashes, this should be equivalent, but (potentially much)
> faster.

>     my %hash = %hash1;
>     @hash{ keys %hash2 } = values %hash2;

I did some comparing:
----------------------------------------------------------------
use Benchmark;

my $hash1 = ();
my $hash2 = ();
for (my $i = 0; $i<10000; $i++) { 
    $hash1{$i} = $i % 100;
    $hash2{20000 - $i} = $i % 100;
}
 
timethese(100, {
  add1  => sub { my %hash = (%hash1, %hash2); },
  add2  => sub { my %hash = %hash1; @hash{ keys %hash2 } = values %hash2; },
});
----------------------------------------------------------------
dantest0, perl5.00404
Benchmark: timing 100 iterations of add1, add2...
      add1: 16 secs (16.91 usr  0.03 sys = 16.94 cpu)
      add2: 21 secs (20.02 usr  0.01 sys = 20.03 cpu)

dantest0, perl5.00502
Benchmark: timing 100 iterations of add1, add2...
      add1: 13 wallclock secs (12.80 usr +  0.02 sys = 12.82 CPU)
      add2: 16 wallclock secs (16.00 usr +  0.00 sys = 16.00 CPU)

  At first I had hash1 and hash2 contain exactly the same set
of keys, and execution times were virtually identical. Am I
making some mistake(s) that are messing up my measurements?

Erik



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

Date: Fri, 22 Oct 1999 15:55:46 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: How can I join two hashes?
Message-Id: <MPG.127a8b4f893e392398a106@nntp.hpl.hp.com>

In article <7uqmm5$end$1@internal-news.uu.net> on 22 Oct 1999 21:58:29 
GMT, Erik van Roode <newsposter@cthulhu.demon.nl> says...

 ...

> use Benchmark;
> 
> my $hash1 = ();
> my $hash2 = ();
> for (my $i = 0; $i<10000; $i++) { 
>     $hash1{$i} = $i % 100;
>     $hash2{20000 - $i} = $i % 100;
> }
>  
> timethese(100, {
>   add1  => sub { my %hash = (%hash1, %hash2); },
>   add2  => sub { my %hash = %hash1; @hash{ keys %hash2 } = values %hash2; },
> });

Just a nit, because my tests run like yours.  Because you didn't 'use 
strict;', you didn't notice that those hash declarations should be 
%hashX, not $hashX.  Nothing changes, of course.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 22 Oct 1999 15:56:09 +0100
From: "frank velasquez" <viper@hal-pc.org>
Subject: how do you run cgi scripts on a NT
Message-Id: <7uqiu5$uar$1@news.hal-pc.org>

i'm have some problems running cgi scripts on my server, they are
in the cgi director  but when i run the script i get an error message that
says

%1 this is not a valid NT application
help me i don't know what to do
reply by email greatly appreciated
pakix2000@hotmail.com





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

Date: Fri, 22 Oct 1999 16:21:38 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: how do you run cgi scripts on a NT
Message-Id: <Pine.GSO.4.10.9910221620510.29843-100000@user2.teleport.com>

On Fri, 22 Oct 1999, frank velasquez wrote:

> i'm have some problems running cgi scripts on my server, 

Perhaps you should search for docs, FAQs, and newsgroups about servers, or
about your server in particular. Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Fri, 22 Oct 1999 15:25:28 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: How to round a number?
Message-Id: <Pine.GSO.4.10.9910221521320.29843-100000@user2.teleport.com>

On Fri, 22 Oct 1999, Samuel Kilchenmann wrote:

> What is the recommendation if you need non-system-dependent rounding
> behavior?

Use a non-system-dependent function.

> What if you can't tolerate the fact that on some systems (where "round
> half to even" is implemented)
> printf("%.0f", 0.5) prints 0
> and on some other systems (where "round half up" is implemented)
> printf("%.0f", 0.5) prints 1

If you don't like what's available, write your own. But perl's printf is
not the system's printf, so it should be the same everywhere.

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Fri, 22 Oct 1999 23:53:16 GMT
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: How to round a number?
Message-Id: <MN6Q3.26154$m4.94455905@news.magma.ca>

Tom Phoenix <rootbeer@redcat.com> wrote in:
news:Pine.GSO.4.10.9910221521320.29843-100000@user2.teleport.com...
>
> > What if you can't tolerate the fact that on some systems (where
> > "round half to even" is implemented)
> > printf("%.0f", 0.5) prints 0
> > and on some other systems (where "round half up" is implemented)
> > printf("%.0f", 0.5) prints 1
>
> If you don't like what's available, write your own. But perl's printf
> is not the system's printf, so it should be the same everywhere.
>
But it isn't. From perldoc -f sprintf:
  Perl does its own `sprintf()' formatting -- it emulates
  the C function `sprintf()', but it doesn't use it
  (except for floating-point numbers, and even then only
  the standard modifiers are allowed).

The rounding behavior of Perl's (s)printf is effectively platform
dependent, at least on the systems i have access to. On Linux and on
NCR's MP-RAS i get "round half to even" and on Win32 i get "round half
up" as shown in the examples above.




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

Date: Fri, 22 Oct 1999 22:59:11 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Ignore the idiots
Message-Id: <Pine.HPP.3.95a.991022225718.25992B-100000@hpplus01.cern.ch>

On 22 Oct 1999, Malcolm Ray wrote:

> That's all I'm going to say, because this discussion has been repeated
> a million times in clpm, and I'm sure nothing new has been said on the
> subject for years...

You could be right on that, but I thought Eric Bohlman's remark just a
few f'ups back put it so very succintly and perceptively that it bears
repeating: 

|  splitting a group only works when the group
|  is being overwhelmed with *signal*, not noise.



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

Date: Fri, 22 Oct 1999 21:16:37 GMT
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: Is there a module to parse a HTML-file like this?
Message-Id: <Vu4Q3.26147$m4.94389152@news.magma.ca>

Markus Hasenöhrl <MHasenoehrl@de.lhsgroup.de> wrote in:
news:381062c1@news.lhsgroup.com...
>
> I'am looking for a simple way to extract links from a HTML-file in
> such a way that a Text/HREF- hash is build, i.e. from a HTML file
> containing links like
>
> <A HREF=/location1>Link1</A> ...  <A HREF=/location2>Link2</A> ... <A
> HREF=/location3>Link3</A>
>
> I want to generate a hash (lets say) %Links with
>
> $Links{Link1}="/location1",
> $Links{Link2}="/location2",
> $Links{Link3}="/location3"...
>
> Is there a module to do such a thing?
>
You may want to try HTML::TokeParser with something like:

#!wherever/perl -w
use strict;
use HTML::TokeParser;

# if you pass the html file name on the command line
# my $p = HTML::TokeParser->new(shift||"index.html");

# if you use it as a filter
# my $p = HTML::TokeParser->new(\*STDIN);

my $x='<A HREF=/location1>Link1</A> ...
<A HREF=/location2>Link2</A> ... <A
HREF=/location3>Link3</A>';


# if you pass it the html as a string
my $p = HTML::TokeParser->new(\$x);

my %Links = ();
while (my $token = $p->get_tag("a")) {
  my $url = $token->[1]{href} || "-";
  my $text = $p->get_trimmed_text("/a");
  $Links{$text} = $url;
}

foreach my $LinkText (sort keys %Links) {
  print "\$Links{$LinkText} = $Links{$LinkText}\n";
}

which prints:
$Links{Link1} = /location1
$Links{Link2} = /location2
$Links{Link3} = /location3




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

Date: Fri, 22 Oct 1999 22:18:25 GMT
From: Michiel Kreutzer <mkreutzer@my-deja.com>
Subject: need suggestion for data logging setup
Message-Id: <7uqnrg$jor$1@nnrp1.deja.com>

Hi,

I am setting up a system that logs several experimental data in a
sql-database. To save space, I will only log measured data. Some
variables change rapidly, and are measured frequently, say every second
or so, and some data is measured infrequently, say every 2 minutes or
so. The data will be stored in a table (id, type, value, date/time)

No I want to build a perl script to ease postprocessing. For this a want
to create a table of all the variables with the highest possible time
resolution. For infrequently logged data, I want to take the last
available value to interpolate.

Although this is not strickly related to perl, I wondered if anybody has
a clue on how to implement this efficiently.

Any help is appreciated.

thanks in advance.

michiel


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


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

Date: Fri, 22 Oct 1999 22:53:14 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: New short cut assignment operators?
Message-Id: <Pine.HPP.3.95a.991022225231.25992A-100000@hpplus01.cern.ch>

On 22 Oct 1999, Jonathan Stowe wrote:

> No thats stupid - of course the white spice is important 

Variety is the white spice of life, eh?

(sorry, couldn't resist that).



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

Date: Fri, 22 Oct 1999 14:06:14 -0700
From: Hal Mounce <hal_mounce@amdahl.com>
To: N.Hadi@motorola.com
Subject: Re: Newbie - Help on installing perl
Message-Id: <3810D1C6.8EEFF21F@amdahl.com>

Noira Hadi wrote:
> 
> I am installing perl on a Sun machine running Solaris 2.6. I encountered
> error message below. Need to know where I can get the C compiler? And do
> I have to re-install the perl again?
> 

Funny you should ask.  I had the same problem a month ago and solved
it.  And took notes.  Use what you can...

root@mugwort   [/export/home/root/notes]
# cat install.perl.notes
A few stages here:
   install a precompiled GNU C compiler
   install GNU make
   use those to compile the current GCC suite
   use that to compile the current perl suite

Install a precompiled GNU C compiler
   logon to kroot
   mkdir software  (/export/home/root/software)
   whence gunzip (should say /opt/FSFgzip/bin/gunzip)
      if there is a problem, see install.e3500.notes
   cd software
   netscape &
   surf over to www.sunfreeware.com
   SPARC/Solaris 2.6
   gcc-2.8.1
   gcc-2.8.1-sol26-sparc-opt.gz
   download /export/home/rootsoftware/gcc-2.8.1-sol26-sparc-opt.gz
      (you may have to add the .gz yourself)
   gunzip gcc-2.8.1-sol26-sparc-opt.gz
   pkgadd -d gcc-2.8.1-sol26-sparc-opt
      all packages
      create /opt/GCC281 directory
      good message is "Installation of <FSFgcc> was successful."
   cd   (back to ~kroot)
   vi .profile
      change PATH from
PATH=/usr/sbin:/usr/bin:/usr/dt/bin:/usr/openwin/bin:/bin:/usr/ucb:/usr/ccs/bin:/opt/NSCPcom:/opt/FSFgzip/bin
                    to
PATH=/usr/sbin:/usr/bin:/usr/dt/bin:/usr/openwin/bin:/bin:/usr/ucb:/usr/ccs/bin:/opt/NSCPcom:/opt/FSFgzip/bin:/opt/GCC281/bin
      change MANPATH from MANPATH=$MANPATH:/opt/FSFgzip/man
                       to
MANPATH=$MANPATH:/opt/FSFgzip/man:/opt/GCC281/man
   exit out of everything and CDE and relogon as kroot
   whence gcc  (should say /opt/GCC281/bin/gcc)
   man gcc (should cough up a gcc man page)

Install GNU make
   cd software
   which make
      should say /usr/ccs/bin/make, if not check PATH variable
      we need this make to make the real make
   netscape &
   surf over to www.gnu.com
   find a link to ftp.gnu.org
   surf over to ftp://ftp.gnu.org/pub/gnu/make/
   get make-3.77.tar.gz
   put it in /export/home/root/software/make-3.77.tar.gz
   gunzip make-3.77.tar.gz
   tar -xvf make-3.77.tar
   cd make-3.77
   mkdir /opt/GNUmake
   ./configure --prefix=/opt/GNUmake
   make
   which make
      we should still be /usr/ccs/bin/make.  If we picked up ./make, 
      we will have trouble.  Take . out of PATH
   make install
   cd  (back to /export/home/root)
   vi .profile
      put /opt/GNUmake/bin ahead of /usr/ccs/bin in PATH
      change MANPATH from
MANPATH=$MANPATH:/opt/FSFgzip/man:/opt/GCC281/man
                       to
MANPATH=/opt/GNUmake/man:$MANPATH:/opt/FSFgzip/man:/opt/GCC281/man
   exit out of everything and CDE and relogon as kroot
   which make  (should say /opt/GNUmake/make)
   man make   (should get the GNU version of the documentation)

Install the "real" GNU C compiler
   surf over to egcs.cygnus.com
   download Releases GCC 2.95.1, gzip format, 12.3Meg
   gunzip gcc-2.95.1.tar.gz
   tar -xvf gcc-2.95.1.tar
   cd gcc-2.95.1
   mkdir /opt/GCC295
   ./configure --prefix=/opt/GCC295
   make
   make install
   cd  (back to /export/home/root)
   vi .profile
      change GCC281 to GCC295 in PATH and MANPATH
      remove /opt/GNUmake from PATH and MANPATH
   pkgrm FSFgcc
   rmdir /opt/GCC281
   exit out of everything and CDE and relogon as kroot
   which make (should be /usr/ccs/bin/make)
   man make (should NOT be GNU make)
   which gcc (should be /opt/GCC295/bin/gcc)
   man gcc (should be the 2.95 man page)

Install perl
   cd software
   netscape &
   surf over to www.cpan.org
      source code 
      stable.tar.gz
      save as /export/home/root/software/stable.tar.gz
   gunzip stable.tar.gz
   tar -xvf stable.tar
   cd perl5.005_03
   mkdir /opt/perl5
   which make (should be /usr/ccs/bin/make)
   which gcc (should be /opt/GCC295/bin/gcc)
   sh Configure
      answer <return> for everything but:
      Installation prefix to use? (~name ok) [/opt] /opt/perl5
      Use which C compiler? [cc] gcc
      Directory /opt/perl5/bin doesn't exist.  Use that name anyway? [n]
y
      Directory /opt/perl5/bin doesn't exist.  Use that name anyway? [n]
y
   make
   make test
   make install
   cd  (back to /export/home/root)
   vi .profile
      add /opt/perl5/bin to the end of PATH
      add /opt/perl5/man to the end of MANPATH
   exit out of everything and CDE and relogon as kroot
   which perl (should be /usr/bin/perl)
   ls -l /usr/bin/perl (should be a link to /opt/perl5/bin/perl)
   perl -v (should be This is perl, version 5.005_03 built for
sun4-solaris)
   man perl (should end with 28/Mar/1999     Last change: perl 5.005,
patch 03)

That's it.  You can rm everything left laying around in
/export/home/root/software now.



root@mugwort   [/export/home/root/notes]
# 

Regards,

Hal


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

Date: 22 Oct 1999 23:39:09 GMT
From: kherron@sgum.mci.com (Kenneth Herron)
Subject: Re: Oh god! Not another Net::ftp question!
Message-Id: <7uqsit$df8$0@dosa.alt.net>

In article <1c31fd54.5b0d28db@usw-ex0106-041.remarq.com>,
Tim Diller  <t.dillerNOt.SPAM@xpres.com.invalid> wrote:
>In article <7uhghq$26i$1@nnrp1.deja.com>, Richard Lawrence
><ralawrence@my-deja.com> wrote:
>> the problem is that it reports busy FTP servers as having a bad
>> username or password. Is there any way I can make it report them as
>> busy instead?
>> Regards
>> Rich
>
>I suppose you could look at the response from the FTP server and look
>for a string like 'anonymous user limit reached' or something.  I don't
>know if there is a standard for a busy response, so it may be hard to
>catch.

Actually, that's a big peeve I have with Net::FTP.  Your script *can't*
look at the response from the FTP server, because the module doesn't
make server responses available to the script, at least not in any
documented way.
-- 
Kenneth Herron -- kherron@sgum.mci.com
"Netscape pollution must be eradicated."
    -- Jeff Raikes, Vice president, Microsoft


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

Date: 22 Oct 1999 23:12:08 GMT
From: rshoham@acs5.acs.ucalgary.ca (Ran Shoham)
Subject: passing an array as a hash value?
Message-Id: <7uqr08$e5g$1@nserve1.acs.ucalgary.ca>

Hello,

another question for a newbie  (where are the FAQ's for Perl anyways?)

if I have an item, value pair to be hashed.
and the value is actually an array of several values.

how is this added to the hash table?

that is, 

would I do something like
   $hash{$word} = @array;

?  

how is this really done?



Thanks in advance,



Ran
(send comments to rshoham@acs.ucalgary.ca)


--
           -----------------
           | Cat's Ass man!|
           -----------------


         ("`-''-/").___..--''"`-._
          `0_ 0  )   `-.  (     ).`-.__.`)
          (_Y_.)'  ._   )  `._ `. ``-..-'
        _..`--'_..-_/ /--'_.' ,'
       ((('   (((-(((''  (((( 


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

Date: Fri, 22 Oct 1999 16:48:21 -0500
From: Justin Perkins <jperkins@mail.wtamu.edu>
Subject: Regular Expression problem
Message-Id: <3810DBA5.ADAAF198@mail.wtamu.edu>

I'm parsing html file searching for <img src="foo BAR.gif"> links so I
can change foo BAR.gif to foo bar.gif.  My problem is when there is more

than one per line.
Here is my regex:

/((<img src\s*=\s*")([-a-zA-Z0-9.\/: ~]*)("[a-zA-Z0-9= ]*>))+/iog;

Here is one of the lines it hangs up on:

<center><img SRC="girl whorse.GIF" height=135 width=179><img SRC="soil
profile2.JPG" HSPACE=15 BORDER=0 height=130 width=189
align=ABSCENTER></center>


That's all one line.  The thing it matches on apparently is this:

<img SRC="girl whorse.GIF" height=135 width=179><img SRC="soil
profile2.JPG" HSPACE=15 BORDER=0 height=130 width=189 align=ABSCENTER>

when I want it to match them individually

Any suggestions?

Justin Perkins





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

Date: Fri, 22 Oct 1999 19:18:47 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: seeking past 4GB
Message-Id: <3810F067.65E9873E@chaos.wustl.edu>

Hal Mounce wrote: 
> $devinfo = `/usr/sbin/devinfo -i $source_file`;

devinfo works for devices, not files...why bother when you already know
that your block size, with solaris, is going to be 512. Hmm...does this
even work? Did you mean to use df perhaps? You might have a look at 'man
largefile and lf64' for fun. the cmd 'sum' will give you the number of
512-byte blocks for a file. Oh, but you give the raw device name...ok,
so it isn't a 'source_file' but 'source_fs' perhaps. 

> Any clues would be appreciated.

Have you tried a truss or run it through the debugger? What about the
actual file instead of the filesystem/disk?

e.


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

Date: Fri, 22 Oct 1999 16:20:09 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: seeking past 4GB
Message-Id: <Pine.GSO.4.10.9910221618301.29843-100000@user2.teleport.com>

On Fri, 22 Oct 1999, Hal Mounce wrote:

> Subject: seeking past 4GB

When you configure perl (before it is installed) one option is to allow
files larger than 4GB, if your system supports that. Is that what you're
looking for? Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Sat, 23 Oct 1999 01:41:35 +0100
From: "Michael Namm" <aerial@online.no>
Subject: string question
Message-Id: <MA6Q3.9494$7G2.53968@news1.online.no>

Simple question, how do I reduce the letters in a given string (for shorting
down filenames for description) from right to left?
longestfilenameiveeverseenthisyear.zip --> longest

On forehand, thanks.

M.N. (mnamm@usa.net)




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

Date: Fri, 22 Oct 99 23:37:04 GMT
From: deplib@citytel.net (Joe Zelwietro)
Subject: Thanks for the Array help
Message-Id: <3810f617@rsl2.rslnet.net>

Hello All:

A couple of days ago I posted a query about a an array problem I was having 
Thanks  to a couple of quick and capable perlers my script worked fine.
One day I hope to return the favour.

Keep well,
Joe Zelwietro


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

Date: Fri, 22 Oct 1999 18:26:43 -0400
From: "CS" <@mdo.net>
Subject: tough regex problem
Message-Id: <Zt5Q3.29397$E_1.1601040@typ11.nn.bcandid.com>

    $xyz="ab=='ab'";

    $xyz=~s/'ab'/blah/g;

    print $xyz;

outputs

    ab==blah

but if you try to find ab that does not have quotes:

    $xyz="ab=='ab'";

    $xyz=~s/[^']*?ab[^']*?/blah/g;

    print $xyz;

You get

    blah==blah

How would you identify a part of the string that does not have the single
quotes?  The output we are looking for is

    blah=='ab'

Thanx in advance, Chris S.





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

Date: Fri, 22 Oct 1999 16:05:11 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: tough regex problem
Message-Id: <MPG.127a8d7e168ddd3498a107@nntp.hpl.hp.com>

In article <Zt5Q3.29397$E_1.1601040@typ11.nn.bcandid.com> on Fri, 22 Oct 
1999 18:26:43 -0400, "CS" <@mdo.net> <"CS" <@mdo.net>> says...
>     $xyz="ab=='ab'";
> 
>     $xyz=~s/'ab'/blah/g;

 ...

> How would you identify a part of the string that does not have the single
> quotes?  The output we are looking for is
> 
>     blah=='ab'

I can think of two ways offhand.

1.  Leave the single-quotes and the /g off.  This then changes the first 
"ab" only.

    s/ab/blah/

2.  Use negative lookbehind and lookahead assertions.

    s/(?<!')ab(?!')/blah/g

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 22 Oct 1999 14:35:44 -0700
From: Shuba Swaminathan <sswaminathan@micron.com>
To: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Unlink
Message-Id: <3810D8B0.6C210EE8@micron.com>



Tom Phoenix wrote:

> On Thu, 21 Oct 1999, Shuba Swaminathan wrote:
>
> > Have you had any experience with "unlink" being
> > unreliable?
>
> Nope.

Even in Windows/DOS systems?I am trying to get it work on Windows 95 and
DOS6.0.

>
>
> > unlink("LOCK.$num") or eval {print ERROR "022
> > Could not delete lock file\n"; exit 1;};;
>
> Why are you using eval? You should rewrite this as an 'if' or 'unless', if
> that's what you want.

Please expand. Are 'if' and 'unless' more efficient than 'eval'? Is it always
true?
If it is, I need to go make some big changes in my code. Thanks for letting me
know.

>
>
>     unless (unlink "LOCK.$num") {
>         print ERROR "022 Couldn't delete lock file 'LOCK.$num': $!\n";
>         exit 1;
>     }
>
> > I want it to delete files with names like lock.001, lock.002 etc.
>
> Then you shouldn't be trying to delete files with names like 'LOCK.1',
> should you? :-)
>

But if $num is a variable I recieve from the command line in the form  of 001,
wont
it be treated as a string? i.e the command line to my script will be in the
form of:
serial  001 (I convert my perl script to exe before use)

If the cause of confusion is the name of my variable, I apologize. I actually
called it $xxx
but then found out that a lot of people have porn filters to filter out
messages containing xxx and
that my emails kept getting lost :)

Thanks,
Shuba.



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

Date: Fri, 22 Oct 1999 15:33:58 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Unlink
Message-Id: <MPG.127a8630b14b3a9398a105@nntp.hpl.hp.com>

In article <3810D8B0.6C210EE8@micron.com> on Fri, 22 Oct 1999 14:35:44 -
0700, Shuba Swaminathan <sswaminathan@micron.com> says...
> Tom Phoenix wrote:
> > On Thu, 21 Oct 1999, Shuba Swaminathan wrote:
> > > Have you had any experience with "unlink" being
> > > unreliable?
> >
> > Nope.
> 
> Even in Windows/DOS systems?I am trying to get it work on Windows 95 and
> DOS6.0.

On those systems, make sure the file you are trying to unlink is closed.  
You can unlink an open file (and keep on using it!) on Unix, but not on 
many other systems.  I haven't found where this is documented, though.

Didn't you get a useful diagnostic from $! on those failures? 

 ...

> > > I want it to delete files with names like lock.001, lock.002 etc.
> >
> > Then you shouldn't be trying to delete files with names like 'LOCK.1',
> > should you? :-)
> 
> But if $num is a variable I recieve from the command line in the form  of 001,
> wont
> it be treated as a string? i.e the command line to my script will be in the
> form of:
> serial  001 (I convert my perl script to exe before use)

Yes.  But you could use sprintf '%.3d' to be sure it isn't just a 
number.

> If the cause of confusion is the name of my variable, I apologize. I actually
> called it $xxx
> but then found out that a lot of people have porn filters to filter out
> messages containing xxx and
> that my emails kept getting lost :)

It's amazing how dumb some people are, to ask even dumber computers make 
these kinds of decisions for them!

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 22 Oct 1999 16:08:11 -0700
From: Shuba Swaminathan <sswaminathan@micron.com>
To: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Unlink
Message-Id: <3810EE5B.DFEE0C79@micron.com>

Larry et al,

Could you please also comment on the efficiency of if-then compared to eval? Which
is better programming style and more efficient?

My code line was:
unlink("LOCK.".$num) or eval {print ERROR "022 Could not delete lock file\n"; exit
1;};;

I have that eval mess  there instead of a clean "die"  because I didn't know how
else to return error levels to my DOS Batch file. There's got to be a better way to
do this. Let me explain myself better - I am converting this perl script into an exe
and calling that from a batch file. (Perl cannot be installed on that system for a
lot of reasons and hence the need to make an exe out of it).

If this script returns an error level 0, I need it to execute perl script A.If the
error level returned is 1, I need it to execute script B and if the level is 2, I
need it to execute script C. I don't know how to do this more elegantly and
efficiently. Any pointers to better programming techniques would be gratefully
acknowledged.

(Instead of having 4 seperate perl scripts, I originally tried one mega-perl script
with conditional testing and subroutines. Bad idea - the size of the exe was
unacceptable.)

> Didn't you get a useful diagnostic from $! on those failures?
>

No I did not! Perl gives me no error and I have tested it repeatedly (atleast a 1000

times, I am not exaggerating - I set up a batch file to test). Not once did I get a
squeak out of perl!

>
> Yes.  But you could use sprintf '%.3d' to be sure it isn't just a
> number.
>

I will do that. Thank you.

Regards,
Shuba.






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

Date: Fri, 22 Oct 1999 20:28:20 GMT
From: henryd@netvision.net.il (David Henry)
Subject: Where do perl scripts get their environment from?
Message-Id: <3810c802.795359@tvroom>

For Apache::DBI to work, the environment variable GATEWAY_INTERFACE
must be set, but how do I do this? Is it via the .cshrc or .bashrc of
the userid designated in httpd.conf as the user under which httpd
runs, usually 'nobody'.


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

Date: Fri, 22 Oct 1999 16:13:59 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Where do perl scripts get their environment from?
Message-Id: <Pine.GSO.4.10.9910221612000.29843-100000@user2.teleport.com>

On Fri, 22 Oct 1999, David Henry wrote:

> For Apache::DBI to work, the environment variable GATEWAY_INTERFACE
> must be set, but how do I do this? 

Environment vars are set by the calling program, which may inherit it in
turn from its calling program. This has nothing to do with perl, of
course; it's an OS matter. You may need to seek more information on your
system or the program involved. Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

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


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