[8449] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2065 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 10 17:14:47 1998

Date: Tue, 10 Mar 98 14:00:47 -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           Tue, 10 Mar 1998     Volume: 8 Number: 2065

Today's topics:
    Re: "newbie" problem with "reverse" <stackhou@elk.cray.com>
    Re: "newbie" problem with "reverse" <quentin@jihad.amd.com>
    Re: "newbie" problem with "reverse" <edwardj@webpromote.com>
        30-Line Perl Script Saves Weeks Of Work! (Steve Linberg)
        =?iso-8859-1?Q?=C1?= to lower case. <mario_soares@hotmail.com>
        Brand new and completely bewildered!!! <sarah@shiver.demon.co.uk>
    Re: c.l.p.mod and TPI (Chris Nandor)
    Re: c.l.p.moderated, TPI, and c.l.p.announce (John Stanley)
        Calculating DOW <heinz@platinum.com>
    Re: Calculating DOW <rkturner@us.ibm.com>
        Catching signals within the signal handler (Steve Shindle)
        CGI-Forms Question (Dave)
        counter for employees <walid@bignet.net>
    Re: DBD/oracle, and LD_LIBRARY_PATH <Jacqui.Caren@ig.co.uk>
    Re: deleting an element <jdporter@min.net>
    Re: deleting an element (Phil Hanna)
        Extracting binary data <krs28@columbia.edu>
    Re: Extracting binary data (Elf Sternberg)
    Re: Finding perl version with script <apb.freddyb@mailexcite.com>
    Re: Finding perl version with script <apb.freddyb@mailexcite.com>
    Re: Good Perl book bwb@acm.org
    Re: Happy with Perl? <Jacqui.Caren@ig.co.uk>
    Re: Help: avoiding eval() on a grep() function. <ajohnson@gpu.srv.ualberta.ca>
    Re: How do you reduce the size of DBM files? schwern@starmedia.net
        how to define @INC at runtime? e.g. $DEVBIN/lib/perl5 ? <rhubbell@aw.sgi.com>
    Re: how to define @INC at runtime? e.g. $DEVBIN/lib/per (Brian Wheeler)
    Re: How to read text files that contains variables? <rkturner@us.ibm.com>
    Re: How to read text files that contains variables? (John Klassa)
        Local File handles? <scotts@ptp.hp.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 10 Mar 1998 10:52:27 -0600
From: Mark P Stackhouse <stackhou@elk.cray.com>
To: "John C. Place" <placej@ctcdist.com>
Subject: Re: "newbie" problem with "reverse"
Message-Id: <35056FCB.1E4D@elk.cray.com>

John C. Place wrote:
> 
> Just a thought:
> It looks like the data is turned around INCLUDING the newline. Suggestion
> use chomp and put the line in yourself.
> 
> John

John,

Thanks for the reply.  So where do I put the chomp (I have to use chop
because we have an older version of Perl)?

-- 
 Mark Stackhouse
 x64704

 *********************************************************
 *							 
 * Senior Electrical-Mechanical Technician		 
 * Homepage - http://wwwmfg.cray.com/~stackhou	 
 * E-mail - stackhou@elk.cray.com				 
 *							 
 * Off site homepage - http://www.execpc.com/~stackhou
 *
 * Home E-mail - stackhou@execpc.com				 
 *				 			 
 * "The best things in life aren't things"		 
 *							 
 *********************************************************
> 
> Mark P Stackhouse wrote in message <3505619A.3F78@elk.cray.com>...
> >I am trying to reverse the order of data in a file.  I can open a test
> >file, write the data into an array and then reverse the data into
> >another array.  However, when I print the data to STDOUT, the data
> >appears to be off by one line.  Why?
> >
> >I'm also have trouble writing the reversed data back to file.  I have
> >included the code I have so far.  Can anyone see my problem?
> >
> >#!/usr/bin/perl -w
> >#
> ># Perl script written by Mark Stackhouse to reverse the order of a file
> >#
> ># 03/10/98
> >#
> >print "\n\n";
> >print "This program will reverse the order of a file\n\n";
> >print "Enter the name of the file to be reversed... ";
> >chop ($file_name=<STDIN>);
> >print "\n\n";  # skip 2 lines
> >open (INPUT_FILE,"$file_name") || die "Could not open file\n";
> >@data = <INPUT_FILE>;
> >close (INPUT_FILE);
> >
> >@reversed_data=reverse (@data);
> >
> >print "This is the original data...\n"; #Why do I need a "new line"
> >here?
> >print "@data";
> >
> >print "This is the reversed data...";  # but it isn't required here?
> >print "@reversed_data";
> >
> >#print "What name should be assigned to the file AFTER it has been
> >reversed... ";
> >#chop ($reversed_file=<STDIN>);
> >#open (OUTPUT_FILE,">$reversed_file") || die "Could not open file\n";
> >
> >#OUTPUT_FILE = @reversed_data;
> >
> >#while (<OUTPUT_FILE> != eof)
> ># {
> ># print OUTPUT_FILE $reversed_file;
> ># }
> >#
> >#close (OUTPUT_FILE);
> >


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

Date: 10 Mar 1998 12:58:44 -0600
From: Quentin  Fennessy <quentin@jihad.amd.com>
Subject: Re: "newbie" problem with "reverse"
Message-Id: <ximra4amkyj.fsf@jihad.amd.com>

>>>>> "MPS" == Mark P Stackhouse <stackhou@elk.cray.com> writes:

    MPS> I am trying to reverse the order of data in a file.  I can
    MPS> open a test file, write the data into an array and then
    MPS> reverse the data into another array.  However, when I print
    MPS> the data to STDOUT, the data appears to be off by one line.
    MPS> Why?

>From perlfunc(1), or perldoc -f reverse

    print reverse <>;

-- 
Quentin Fennessy			AMD, Austin Texas


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

Date: Tue, 10 Mar 1998 20:17:07 GMT
From: Ed Jamison <edwardj@webpromote.com>
To: Mark P Stackhouse <stackhou@elk.cray.com>
Subject: Re: "newbie" problem with "reverse"
Message-Id: <35059F95.1BAD06E0@webpromote.com>



Mark P Stackhouse wrote:

> John C. Place wrote:
> >
> > Just a thought:
> > It looks like the data is turned around INCLUDING the newline. Suggestion
> > use chomp and put the line in yourself.
> >
> > John
>
> John,
>
> Thanks for the reply.  So where do I put the chomp (I have to use chop
> because we have an older version of Perl)?

Get the newer version of Perl.  This way you can remove the \n, but not be in
danger of removing anything else....

HTH,
Edward Jamison



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

Date: Tue, 10 Mar 1998 16:31:51 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: 30-Line Perl Script Saves Weeks Of Work!
Message-Id: <linberg-1003981631510001@projdirc.literacy.upenn.edu>

Amazing But True!  Perl Saves Webmaster's Tuckuss Yet Again!
------------------------------------------------------------

(Philadelphia)  Webmaster Steve Linberg was frothing at the mouth recently
describing the situation of a 380-page website he inherited the
maintenance of.  He shuddered when describing the state of the HTML he
saw.  "First off, every file bore the .htm suffix," he says with obvious
pain.  "I said to myself, are we ever going to run this on a DOS server? 
What the hell is this?"  Thousands of reference to local .htm files were
scattered throughout the system.

Top-level references were not prefixed with slashes in any standard way,
either.  "Any file that got moved would lose half of its references
instantly," he said.  Case in filenames was also inconsistent - which
happened to work on the particular server they were using, but was a
sloppy habit to get into and one that would cause problems on other
servers.

Luckily, There Was Perl.

"Using this nifty little module called File::Recurse that I picked up at
CPAN recently," Linberg recalls, "I wrote a quick series of tests and
rewrites that parsed every file in the web hierarchy and corrected these
problems.  It took 10 minutes to write and test the script, and about 15
seconds to execute it."  Logging its results, the script made over 10,000
changes that would have had to be made by hand - and did them all with no
human error.

"I spent two hours manually testing all the links and pages this morning,
and they were all perfect," he recounts with glee.

It wasn't as simple as doing search-and-replace with .htm and .html,
Linberg explained, because what if a fully-qualified URL referenced a page
on a different site ending in .htm?  "Perl's regular expressions made
detecting the presence of a fully-qualified URL simple," he said.  "We
only fixed the ones that referenced pages on our site."

The renaming of all the .htm files to .html was done in the same pass. 
All that remained to to was to delete *.htm from the tree, and everything
was done.

Linberg seems delerious when he talks about his plan for creating other
webmastering tools.

"Should take all of 10 minutes to bang out a quick script that will use
associative arrays to find all of the local files each page reference -
and easily see which are orphans.  Most of this code has already been
written somewhere, and a quick look through CPAN shows up stuff that's so
insanely useful you can't believe it.  Then I write the script and
everybody's amazed at how smart I am!  Perl is the perfect tool for doing
all of this - fast, powerful, well-supported, and FREE!"

Immense vendors of bloated, proprietary, and buggy commercial tools and
operating systems could not be reached for comment.
_____________________________________________________________________
Steve Linberg                       National Center on Adult Literacy
Systems Programmer &c.                     University of Pennsylvania
linberg@literacy.upenn.edu              http://www.literacyonline.org


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

Date: Tue, 10 Mar 1998 20:54:40 +0100
From: Mario Soares <mario_soares@hotmail.com>
Subject: =?iso-8859-1?Q?=C1?= to lower case.
Message-Id: <35059A80.C35@hotmail.com>

Hi

How can I make the conversion of this characters with a simple search
script?

=C1 =C9 =CD =D3 =DA
=C3 =D5 =CA

to lower case.

=E1 =E9 =ED =F3 =FA
=E3 =F5 =EA

lc($FORM{'words'});

make the conversion ~ /[A-Z]/ to ~ /[a-z]/ in all submited query, =

but not for this kind of characters.

Thank you for help

Mario


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

Date: Tue, 10 Mar 1998 19:56:20 +0000
From: "Sarah Medway" <sarah@shiver.demon.co.uk>
Subject: Brand new and completely bewildered!!!
Message-Id: <889559883.17693.0.nnrp-01.9e984532@news.demon.co.uk>

Hello there

I am a graphic designer relatively new to the wonders of the web. I have a
few sites under my belt.
But, however, I am completely brand new to Perl.

I am doing a web site for a friend. She has a ftp download area for some
demo programs (this is all set up and working). But she doesn't know who is
downloading what! I have designed a form for her in Adobe Pagemill for
people to fill in before they download her demos. The information in the
form she wants emailed to her so she can build up a user database. 

I have bought 'Perl 5 for Dummies', 'The CGI/ Perl Cookbook' (which does
have a script, but I don't understand how to configure it!) and 'Perl CGI
Programming, no experience required'. All of them seem to go from ABC into
rocket science in the space of one page.

Am I being to ambitious to even contemplate doing this or is it a fairly
straight forward task, or am I being extremely cheeky as it is a skill that
takes years to master? I have no idea. However I would like to learn but
feel I'm getting nowhere.

Yours in anticipation

Sarah


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

Date: Tue, 10 Mar 1998 14:27:41 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: c.l.p.mod and TPI
Message-Id: <pudge-1003981427420001@ppp-32.ts-1.kin.idt.net>

In article <889525385.976597@cabal>, ? the platypus {aka David Formosa}
<dformosa@st.nepean.uws.edu.au> wrote:

# Then why is the bord of TPI acting as defacto moderators?  We already have
# a moderation panel, it should be there job to decide what is or is not
# apporate to a newsgroup.

Sigh.  Not one person on TPI's board was listed as one of the moderators. 
What, you mean the provision that TPI can post "ads" makes it a
moderator?  That is nonsensical.

--
Chris Nandor               pudge@pobox.com           http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==                    MacPerl: Power and Ease                     ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#


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

Date: 10 Mar 1998 18:41:39 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: c.l.p.moderated, TPI, and c.l.p.announce
Message-Id: <6e41h3$lij$1@news.orst.edu>

In article <8ciupmsd3e.fsf_-_@gadget.cscaper.com>,
Randal Schwartz  <merlyn@stonehenge.com> wrote:
>>>>>> "Eric" == Eric D Friedman <friedman@uci.edu> writes:
>If it's commercial, it's almost certainly not going to be in comp.*
>anyway (Usenet is non-commercial to begin with).  

That is the point. And that applies more to discussion groups than to
groups formed for other purposes.

>Go find the websites.  They're out there.  

Then there is a place for such announcements already?

>Wrong.  CLPA has a necessary non-commercial charter.

This is interesting. If the CLPA charter is non-commercial by necessity,
why is the clp.mod charter commercial by necessity? 

>The approved charter says "comp.lang.perl.announce will be a
>low-volume, moderated group for announcements of new releases of perl
>or its extensions (oraperl, sybperl, etc.) and periodic postings
>related to perl."
>
>I don't see anything in there that permits conference or book
>announcements.

I don't see anything in there that prohibits it, and since it is a
moderated group, it is pretty much up to the moderator to decide if this
addition is appropriate. In fact, "periodic postings related to perl"
pretty much fits exactly with "where is Larry this week?" That is, if
someone can claim that "where Randal is playing pool tonight" is
related to perl, then I think there is no question that "where is Larry
talking" is, too.

>... but you lost me here.  clp.mod-erators will have a strict
>non-commercial charter.  However, if the TPI board approves, a
>commercial posting may be posted.  

This is a contradiction. The moderators are in charge of the group. If
the group allows commercial postings, then the moderators do not have a
non-commercial charter.

>What exactly is your concern?

That dicussion groups are not the place for advertising.



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

Date: Tue, 10 Mar 1998 09:48:52 -0800
From: "Phil Heinz" <heinz@platinum.com>
Subject: Calculating DOW
Message-Id: <6e3ue2$m3v$1@news.platinum.com>

Hi,

I'm trying to determine a day of week for a particular date that is read in
via any date format by my program. I'm assuming I'll have to convert their
format into a gmtime type to do the localtime function? How can I accomplish
this task?

The code for translating this date is done, I just can't get a gmtime
variable created.

Thanks !!!!
Phil




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

Date: Tue, 10 Mar 1998 13:12:33 -0600
From: "Keith Turner" <rkturner@us.ibm.com>
Subject: Re: Calculating DOW
Message-Id: <6e43am$1v6c$1@ausnews.austin.ibm.com>

use the timelocal() function.  One thing to remeber, is that months go from
0 to 11... this gets me sometimes.

http://www.perl.com/CPAN-local/doc/manual/html/lib/Time/Local.html




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

Date: 10 Mar 1998 13:43:20 -0500
From: steves@cnj.digex.net (Steve Shindle)
Subject: Catching signals within the signal handler
Message-Id: <6e41k8$nkk@cnj.digex.net>


I've got a bug having to deal with signals.

I have a server that accepts messages via TCP/IP and forks a child to handle
each message that comes in.  The problem is that a situation arises where 
the server gets a segmentation fault and instead of exiting it just hangs.
I've looked at a stack trace of the server when it is hung and it looks like
it's catching a SIGCHLD while it's processing the SIGSEGV.  I know the SEGV
needs to be taken care of but I just want to know if the interpreter should
be ignoring all signals within it's signal handler.

Is this a known problem?



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

Date: Tue, 10 Mar 1998 20:09:38 GMT
From: dave@cybersigns.com (Dave)
Subject: CGI-Forms Question
Message-Id: <35069dff.423427115@news.newsguy.com>

Wondering how to access multiple values when using a multiple select
field.
Trying to access with $in{'name'} only returns the first value.
Want to avoid having to access element $in[0] and splitting off
key/value for each key with same name.
Using cgi-lib/Perl5 W32



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

Date: Tue, 10 Mar 1998 16:25:39 -0500
From: Walid Ezzedine <walid@bignet.net>
Subject: counter for employees
Message-Id: <3505AFD3.39509479@bignet.net>

Hi,

I need to write a counter that display the number of employees in a web
page.
If we have 12.000 new employees each year, we may have
12000/(365*24*3600)
employees per sec.
The application should run under NT and IIS 4.0

Can someone help me ?

Thank you.

Walid



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

Date: Tue, 10 Mar 1998 19:16:37 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: DBD/oracle, and LD_LIBRARY_PATH
Message-Id: <EpMAvq.3KJ@ig.co.uk>

In article <34F53FF0.6C158A1A@lwscpm.de>,
Frank Haefemeier  <fh@lwscpm.de> wrote:
>John D Groenveld wrote:
>> 
>> In article <6crcvh$2a3$1@delphi.et.tudelft.nl>,
>> T.J. Nijweide <tobias@socrates.et.tudelft.nl> wrote:
>> >DBD::Oracle was installed on a system with oracle in /oracle, and
>> >most other systems have oracle in /someotherhierarchy/oracle.
>> 
>> Relink DBD::Oracle with -R/someotherhierarchy/oracle/product/7.3.3/lib

>Or create a special mount point from /someotherhierarchy/oracle to /oracle
>(if you have root permissions). In my opinion, it is the better solution
>because you have a virtual
>access point to you oracle installation independend from your real
>installation.

Bad idea - some stuff such as SQL*Net uses path info ORACLE_BASE/HOME and
you can get unpredictable results.

You are far better off doing a relink/clean install.

Remember that oci changes with releases of oracle, so if you have a static
build, you should relink if and when you oracle is upgraded.

The common symptoms include

	*) fetch()s return an extra leading (gibberish) value.
	*) CREATE TABLE etc blocks and hangs perl and oracle...

Good Luck,
	Jacqui
-- 
Email: Jacqui.Caren@ig.co.uk  http://www.ig.co.uk/
Fax  : +44 1483 419 419       http://www.perlclinic.com/
Phone: +44 1483 424 424       http://www.perl.co.uk/
Paul Ingram Group Ltd,140A High Street,Godalming GU7 1AB United Kingdom



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

Date: Tue, 10 Mar 1998 12:04:04 -0500
From: John Porter <jdporter@min.net>
Subject: Re: deleting an element
Message-Id: <35057284.1006@min.net>

Bayweb Designs wrote:
> 
> --
> I need to delete a line, $match, out of an array.  Suppose my array was:
> @a = ("one","two","three","four","five");
> $match =3;
> I have to get element number 3 out of the array.  Can you give me some
> example code?

No, but the code is trivial when you know that the fuction you want is
called 'splice'.  To read about it, type

	perldoc -f splice

hth,
John Porter


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

Date: Tue, 10 Mar 1998 17:19:54 GMT
From:  (Phil Hanna)
Subject: Re: deleting an element
Message-Id: <350575ff.1190685921@newshost.unx.sas.com>

On 10 Mar 1998 17:45:12 +0100, Horowitz Joel <horowitz@ulb.ac.be>
wrote:

>Hye,
>
>> I need to delete a line, $match, out of an array.  Suppose my array was:
>> @a = ("one","two","three","four","five");
>> $match =3;
>> I have to get element number 3 out of the array.  Can you give me some
>> example code?

This is exactly what the splice function does:

@a = ("one","two","three","four","five");
$match = 3;
print "BEFORE: @a\n";
splice @a, $match-1, 1;
print "AFTER:  @a\n";


----------
Phil Hanna
saspeh at unx dot sas dot com


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

Date: Tue, 10 Mar 1998 13:57:48 -0500
From: Kaushal Shah <krs28@columbia.edu>
Subject: Extracting binary data
Message-Id: <35058D2C.9138EAAA@columbia.edu>

Hi,
    How would I go about extracting a binary file, specifically, gif
file.  I want to extract the resolution which happen to be bytes 7 & 8
and 9 & 10.  These bytes are in reverse order ie.  I have to concatenate
bytes 8 then 7 and 10 & 9 to get width and height.  how can I go about
extracting and concatenating the byes to get the resolution.  I am
working with Perl 4.  thanks.

-kaushal

--
----------------------------------------------------------
  Kaushal Shah
  Web Programmer

 Office: 212-305-5765         krs28@columbia.edu
   Home: 718-507-2162         kaushal@bigfoot.com
----------------------------------------------------------




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

Date: 10 Mar 1998 12:00:17 -0800
From: elf@halcyon.com (Elf Sternberg)
Subject: Re: Extracting binary data
Message-Id: <6e464h$ksr$1@halcyon.com>

In article <35058D2C.9138EAAA@columbia.edu>,
Kaushal Shah  <krs28@columbia.edu> wrote:
,
>    How would I go about extracting a binary file, specifically, gif
>file.  I want to extract the resolution which happen to be bytes 7 & 8
>and 9 & 10.  These bytes are in reverse order ie.  I have to concatenate
>bytes 8 then 7 and 10 & 9 to get width and height.  how can I go about
>extracting and concatenating the byes to get the resolution.  I am
>working with Perl 4.  thanks.

perldoc -f pack 
perldoc -f unpack

sub gifsize {
    local($type, $a, $b, $c, $d, $s, $size);

    read(FIMAGE, $type, 6);

    if(!($type =~ /GIF8[7,9]a/) || !(read(FIMAGE, $s, 4) == 4) ){
        print "Invalid or Corrupted GIF";
        $size="";
    } else {
        ($a,$b,$c,$d)=unpack("C"x4,$s);
        $size=join ("", 'width=', (($b << 8) | $a), ' height=', (($d << 8)|$c));
    }

    $size;
}




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

Date: Tue, 10 Mar 1998 16:05:11 -0500
From: "Alfred P. Bartholomai" <apb.freddyb@mailexcite.com>
Subject: Re: Finding perl version with script
Message-Id: <3505AB07.7B6455A4@mailexcite.com>

At the command line type:

perl -v

This will return the perl version information. ( assuming that perl is in
your PATH ).
For perl Version 5.x, try:

perl -V

for a lot of useful on perl was made for your system, including where the
perl'
library modules are located.

Fred Bartholomai
apb.freddyb@.mailexcite.com

Menno M Jansz wrote:

> Please could someone tell me how I can retrieve the perl version using a
> script.
>
> Thanks, Menno





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

Date: Tue, 10 Mar 1998 16:04:57 -0500
From: "Alfred P. Bartholomai" <apb.freddyb@mailexcite.com>
To: Menno M Jansz <menno@cyberdude.com>
Subject: Re: Finding perl version with script
Message-Id: <3505AAF9.3BBA6795@mailexcite.com>

At the command line type:

perl -v

This will return the perl version information. ( assuming that perl is in
your PATH ).
For perl Version 5.x, try:

perl -V

for a lot of useful on perl was made for your system, including where the
perl'
library modules are located.

Fred Bartholomai
apb.freddyb@.mailexcite.com

Menno M Jansz wrote:

> Please could someone tell me how I can retrieve the perl version using a
> script.
>
> Thanks, Menno





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

Date: Tue, 10 Mar 1998 14:05:57 -0600
From: bwb@acm.org
Subject: Re: Good Perl book
Message-Id: <6e46cm$jh$1@nnrp1.dejanews.com>

In article <6dlf6d$1r04@clnws01.we.highway1.com>,
  oneilt@ucla.edu (Tom O'Neil) wrote:
>
> I've had  a fair amount of experience with Perl, but it was a couple
> of years ago so I'm a little rusty.  I was wondering what a good Perl
> (including CGI) book(s) might be for a good reference and reminder?

Flat Hill Books has Perl book reviews and recommendations:

  http://www.flathill.com/languages/perl/


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Tue, 10 Mar 1998 18:56:28 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: Happy with Perl?
Message-Id: <EpM9y5.31A@ig.co.uk>

In article <6cjcoa$ii9$3@vnetnews.value.net>,  <twod@not.valid> wrote:
>: > if i wrote a program in perl which backed up $100 million worth of dealing

I would not write backup software, there are too many professional
packages out there that have taken man-years to develop. My project
requirements call for on-line backups and recovery of large filesystems
and Oracle databases. No hand-crafted software will compare with the
available packages designed for such applications.

>: > information, and that program failed because of a bug in the perl source,
>: > my company would not be able to sue anyone, and other than perlclinic

I think you need to reread what TPC provides. It is explicity designed to
discourage prospective customers with this attitude.

Regarding the $100M issue,  we have used perl and C on 50M UKP *bugdet*
projects.  The value of such projects to the customer will far exceed
your $100M figure, and we have managed to win awards/recognition from
the customer for doing this work.

>Systems written in any language need to be tested thoroughly before being
>placed into production. A bug in PERL is as likely or as unlikely as a bug in
>any other language that you care to code in. 
>
>Regardless of the language, if your testing is fully comprehensive you will
>find that bug before you go into production. If your testing is not fully
>comprehensive then you run the risk of hitting a bug in any language. If you
>choose to comprimise testing by employing lawyers, then that's an odd way to
>do business if you have any professional pride.

Thanks, my thoughts precisely.

Jacqui
-- 
Email: Jacqui.Caren@ig.co.uk  http://www.ig.co.uk/
Fax  : +44 1483 419 419       http://www.perlclinic.com/
Phone: +44 1483 424 424       http://www.perl.co.uk/
Paul Ingram Group Ltd,140A High Street,Godalming GU7 1AB United Kingdom



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

Date: Tue, 10 Mar 1998 11:51:17 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Help: avoiding eval() on a grep() function.
Message-Id: <35057D95.52212F75@gpu.srv.ualberta.ca>

schwern@starmedia.net wrote:
!
! In article <EpKL82.15D@world.std.com>,
!   aml@world.std.com (Andrew M. Langmead) wrote:
! >
! > schwern@starmedia.net writes:
! >
! > >$pattern = join '&&', map { "m/$_/" } @Pattern;
! > >$matchSub = eval "sub { $pattern }";
! >
! > >@matches = grep {&$matchSub} @Array;
! >
! > >This avoids doing the eval at each iteration of the grep.
! >
! > Subroutine dereferencing and calling is fairly expensive too, and
! > should probably also be avoided inside of grep. Trading an eval for
a
! > sub de-reference probably isn't that big of a win.
! 
! Problem is... you need it.  You can't do "grep { m/$STR1/ &&
! m/$STR2/ } @array" because we don't know how many $STR's there
! will be in this case.  In the original problem, @Pattern contains
! an unknown number of patterns.  And eval of some sort is
! necessary to build the list of pattern matches from the
! @pattern.

or, we can build with look-ahead patterns
and avoid eval() altogether:

@Array=('aaa'..'zzz');
@patterns=qw(a q w);
$big_pattern=join('',map{"(?=.*$_)"}@patterns);
@matches=grep /^$big_pattern/i,@Array;
print "@matches\n";

regards
andrew


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

Date: Tue, 10 Mar 1998 10:55:18 -0600
From: schwern@starmedia.net
To: charles.nahhas@ans.alcatel.co.uk
Subject: Re: How do you reduce the size of DBM files?
Message-Id: <6e3r79$nsn$1@nnrp1.dejanews.com>

You need to explicitly tell the DBM to reorganize itself.  DBM saves time by
deleting a hash entry, but not actually reclaim the space.  Think of it like a
bunch of CDs in a rack in alphabetical order.  You pull a CD out, and there's
a space there... but its in the middle of the rack of CDs.  Not very useful if
you want to keep everything in order.  If you really want to reclaim that
space, you have to go through your CDs and reorganize them.

That's what dbm_reorganize does.  Unfortunately, you're using dbmopen and not
the DBM_File module.  I have no idea how to go about calling the
dbm_reorganize function using the dbmopen interface.  Look at DBM_File (or
GDBM_File, or NDBM_File... whatever flavor DBM you use), the accomplanying dbm
man page (again, dbm, gdbm, ndbm...) and AnyDBM_File.


In article <01bd4c10$75b7a800$6b793ec2@Charles.Nahhas.ANS.alcatel.co.uk>,
  "charlie nahhas" <charles.nahhas@ans.alcatel.co.uk> wrote:
>
> I am writing a perl script which uses a DBM file to store and retrieve
> data.
> I want to limit the size of the file.
>
> When the file reaches a certain size, (the sum of the size of the .pag and
> .dir files > file_max_size) I delete the earliest records using
> delete($RECORD{earliest}). I then set a variable to be able to identify the
> next earliest record.
>
> I then check the size of the file again and if it is less than
> file_max_size, the loop exits, otherwise, the deleting step is repeated.
>
> When the file reaches file_max_size, the records are deleted as expected,
> but the file size does not decrease. So the scripts gets stuck in the loop,
> deleting all the records until the file is empty. Even when the file is
> empty, the size of the file is still the size it was when it started
> deleting the records.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Tue, 10 Mar 1998 13:34:27 -0800
From: Richard Hubbell <rhubbell@aw.sgi.com>
Subject: how to define @INC at runtime? e.g. $DEVBIN/lib/perl5 ??
Message-Id: <3505B1E3.66611A8D@aw.sgi.com>

how to define @INC at runtime? e.g. $DEVBIN/lib/perl5 ??


Anyone tried this or maybe even have it working
already?


I'd like to be able to define the $DEVBIN in a variable
so that I could move the perl around like so:


$DEVBIN = "/usr/version11.1/"

or if I was working on version11.2

$DEVBIN = "/usr/version11.2/"

I want perl to live with a certain set of sources maybe or
just be able to use it under /tmp/lib/perl5 or the like.

perl -V

would print $DEVBIN/lib/perl5 ( etc., etc. )


I've looked at 'use lib LIST' but that only works for
subsequent uses of 'use'.

Checked www.dejanews.com, checked the FAQ, the book.

Looks like it'll require a bit of hacking....



Rick


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

Date: 10 Mar 1998 21:43:56 GMT
From: bdwheele@indiana.edu (Brian Wheeler)
Subject: Re: how to define @INC at runtime? e.g. $DEVBIN/lib/perl5 ??
Message-Id: <6e4c6s$3pa$1@flotsam.uits.indiana.edu>

In article <3505B1E3.66611A8D@aw.sgi.com>,
	Richard Hubbell <rhubbell@aw.sgi.com> writes:
> how to define @INC at runtime? e.g. $DEVBIN/lib/perl5 ??
> 
> 
> Anyone tried this or maybe even have it working
> already?
> 
> 
> I'd like to be able to define the $DEVBIN in a variable
> so that I could move the perl around like so:
> 
> 
> $DEVBIN = "/usr/version11.1/"
> 
> or if I was working on version11.2
> 
> $DEVBIN = "/usr/version11.2/"
> 
> I want perl to live with a certain set of sources maybe or
> just be able to use it under /tmp/lib/perl5 or the like.
> 
> perl -V
> 
> would print $DEVBIN/lib/perl5 ( etc., etc. )
> 
> 
> I've looked at 'use lib LIST' but that only works for
> subsequent uses of 'use'.
> 
> Checked www.dejanews.com, checked the FAQ, the book.
> 
> Looks like it'll require a bit of hacking....
> 
	Nah.  Just set the PERL5LIB environment variable....then it'll
search in the places listed first.

Brian Wheeler
bdwheele@indiana.edu


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

Date: Tue, 10 Mar 1998 11:19:24 -0600
From: "Keith Turner" <rkturner@us.ibm.com>
Subject: Re: How to read text files that contains variables?
Message-Id: <6e3smg$1qh6$1@ausnews.austin.ibm.com>


$bar="name";
$test2="bar";
print eval ("{return \$$test2}")."\n";

here is an example of an ugly solution... I just tested it... you would just
$1 in place of $test2, I think this will work.






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

Date: 10 Mar 1998 19:03:44 GMT
From: klassa@aursgh.aur.alcatel.com (John Klassa)
Subject: Re: How to read text files that contains variables?
Message-Id: <6e42qg$3a7$1@aurwww.aur.alcatel.com>

On 10 Mar 1998 17:20:15 +0100, Horowitz Joel <horowitz@ulb.ac.be> wrote:
->Hye,
->I'd like very much to be able to open a text file like this:
-> <deletia>
->And replace every occurrence of <=...=> by the value of the variable
->inside. I tried

You might try:

	man perlfaq4

	... How can I expand variables in text strings? ...

-> <long sig deleted>

You might also try cropping your sig -- four lines is the generally
accepted max.

HTH,
John

-- 
John Klassa / Alcatel Telecom / Raleigh, NC, USA <><


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

Date: Tue, 10 Mar 1998 13:03:23 -0800
From: Scott Starks <scotts@ptp.hp.com>
Subject: Local File handles?
Message-Id: <3505AA9B.73371E72@ptp.hp.com>

Hello,

I have a subroutine that recursively calls itself.  It has the potential
to open a file handle in each call.  Is there a way to make this file
handle local (ie my) to the function so that each recursive call to the
function has it's own copy of the file handle?  I can't seem to find any
syntax of "my" to do this.  Any help would be greatly appreciated.

Scott Starks



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

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

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