[15464] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2874 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 26 21:08:33 2000

Date: Wed, 26 Apr 2000 18:05:08 -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: <956797508-v9-i2874@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 26 Apr 2000     Volume: 9 Number: 2874

Today's topics:
    Re: [REGEXP] Extremely important please read! <charles.henry@engineer2k.com>
    Re: AIX perl 5.6 compile <elaine@chaos.wustl.edu>
    Re: Extracting part of a string (Eric Bohlman)
    Re: Extracting part of a string <jeff@vpservices.com>
    Re: form to email <rootbeer@redcat.com>
    Re: freetype-1.3.1 <rootbeer@redcat.com>
    Re: Help with Linux & Perl command line <lr@hpl.hp.com>
    Re: min/max <lr@hpl.hp.com>
    Re: Passing a here doc to more (Craig Berry)
    Re: Passing a here doc to more <Jonathan.L.Ericson@jpl.nasa.gov>
    Re: Passing a here doc to more <schuette@umr.edu>
        Perl Programming Notation <krishnasanjay@hotmail.com>
    Re: Perl Programming Notation <lauren_smith13@hotmail.com>
    Re: Perl Programming Notation <tcuffel@exactis.com>
    Re: Perl Programming Notation <makarand_kulkarni@My-Deja.com>
        perl question , fuction name var mxapac@my-deja.com
    Re: perl question , fuction name var <tony_curtis32@yahoo.com>
    Re: perl question , fuction name var <rootbeer@redcat.com>
    Re: Put Variable Initializations In Other File <monty@primenet.com>
    Re: strict <mjcarman@home.com>
    Re: strict <jeff@vpservices.com>
    Re: strict <flavell@mail.cern.ch>
    Re: system return code problem (Charles DeRykus)
    Re: tie (Joe Smith)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 27 Apr 2000 00:02:49 +0200
From: "Charles Henry" <charles.henry@engineer2k.com>
Subject: Re: [REGEXP] Extremely important please read!
Message-Id: <8e7pdq$tqo$1@news6.isdnet.net>

Hi Michael,

> > That is from your point of view, which you are untitled to.
>                                                  ^^
> Interesting Freudian slip? ;-)

That is to say?

--
Charles Henry

PS : Sorry english is far from being my native language. I am French.




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

Date: Wed, 26 Apr 2000 23:38:34 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: AIX perl 5.6 compile
Message-Id: <B52CF67B.3176%elaine@chaos.wustl.edu>

in article 390756FF.B78971AA@uhc.com, Chris Covington at ccoving@uhc.com
quoth:

> I am trying to compile perl5.6 on AIX 4.3 using gcc.  I get an error
> after configuration, a while into the "make":

Use your native compiler.

e.




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

Date: 26 Apr 2000 22:17:42 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Extracting part of a string
Message-Id: <8e7pu6$fk8$1@slb2.atl.mindspring.net>

Tad McClellan (tadmc@metronet.com) wrote:
: On Wed, 19 Apr 2000 00:06:55 -0500, Dan Olson <theoddone@quakefiles.com> wrote:
: >Tony Curtis wrote:
: >> 
: >> 
: >> perldoc perlre
: >> perldoc -f substr
: >I had a similar problem.  I added these two lines into my perl program,
: >but they only generated errors.  What am I doing wrong?
: 
: 
: You are supposed to type them on the command line, not
: insert them in a program.

About 15 years ago, I read a story describing two (possibly apocryphal) 
doctor-patient interactions:

1) A man consulted the doctor about excessive underarm sweating.  The 
doctor gave him a prescription for aluminum salts and told him "wipe this 
under you arms every morning."  A few weeks later, the patient called the 
doctor's office and reported that a) the problem was still occurring and 
b) he needed a new copy of the prescription because the old one had 
become badly smudged from being wiped in his armpits.

2) A child presented with lots of itchy welts.  The doctor asked if there 
was a dog in the house and upon being told there was, diagnosed the 
problem as flea bites and suggested a flea collar.  On a followup visit, 
the doctor noted that the child was free of bites and was wearing a flea 
collar.
 


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

Date: Wed, 26 Apr 2000 15:35:02 -0700
From: Jeff Zucker <jeff@vpservices.com>
To: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Extracting part of a string
Message-Id: <39076F16.5E7CD610@vpservices.com>


Eric Bohlman wrote:
>
> [snip OP's problem with perldoc]
> 
> [snip hilarious story about prescriptions]
>
> [snip hilarious story about flea collars]

Thanks, Eric, those are going straight into the FAIQ/abigailisms file!

:-)

And here's a third for you:

Patient goes into doctor and touches shoulder and says "this hurts",
touches knee and says "this hurts", touches toe and says "this hurts",
then asks "what's wrong?".  The doctor says : "you have a broken
finger."

(Not sure that comes across in print, the idea is that the finger the
patient is touching the parts with is broken)

-- 
Jeff


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

Date: Wed, 26 Apr 2000 17:11:05 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: form to email
Message-Id: <Pine.GSO.4.10.10004261710500.21722-100000@user2.teleport.com>

On Wed, 26 Apr 2000, [@@]~ wrote:

> Anyone point me in the right direction to a free form to email script?

If you're wishing merely to _find_ (as opposed to write) programs,
this newsgroup may not be the best resource for you. There are many
freeware and shareware archives which you can find by searching Yahoo
or a similar service. Hope this helps!

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



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

Date: Wed, 26 Apr 2000 17:06:13 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: freetype-1.3.1
Message-Id: <Pine.GSO.4.10.10004261704150.21722-100000@user2.teleport.com>

On Thu, 27 Apr 2000, Quaid Joher wrote:

> While installing freetype-1.3.1 module 

What is this module? The CPAN search site says: No modules found matching
'freetype'.

    http://search.cpan.org/

If other people can see the source for the module, it's more likely that
they can help you to find the problem. Cheers!

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



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

Date: Wed, 26 Apr 2000 15:02:41 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Help with Linux & Perl command line
Message-Id: <MPG.1371075c1f47a38f98a993@nntp.hpl.hp.com>

[Rearranged in coherent time sequence.]

In article <8e7ktn$bc$1@news.NERO.NET> on Wed, 26 Apr 2000 14:52:06 -
0600, Dave Klingler <davidk@excitehome.net> says...
> Larry Rosler <lr@hpl.hp.com> wrote in message
> news:MPG.1370eaa876a652b098a98d@nntp.hpl.hp.com...
> > In article <8e7f42$rkn$1@news.NERO.NET> on Wed, 26 Apr 2000 13:13:04 -
> > 0600, Dave Klingler <davidk@excitehome.net> says...
> > > I am trying to figure out how to write a one line Perl script which will
> > > loop until a file is present on the system.  I don't know enough about
> > > Perl to know how to write this line.  Does anyone have any ideas?
> >
> > UNTESTED (of course).  Note that the two '-e's have nothing to do with
> > each other:
> >
> >     perl -e '1 until -e /whatever/file'
> >
> > But what a resource hog that is.  You might do it every so often:
> >
> >     perl -e 'sleep 1 until -e /whatever/file'
> >
> > For intervals shorter than one second, look at the four-argument
> > select() function in perlfunc.

 ...

> That was the idea I needed.  This is how I got it to work:
> 
> perl -e 'while (!(-e \"$storeid$extension\")){}'

How does that work?  It appears as though you are interpolating two 
shell variables, but the single-quotes would inhibit that.  Outer 
double-quotes would be necessary, which would explain your escaping the 
inner double-quotes (though I would replace them with qq{} for 
legibility).

Also, Perl provides eloquent means of expression.  Consider using them.

   while (! predicate ) { }

is equivalent to:

   until ( predicate ) { }

and avoids negative logic.  So:

  perl -e "until (-e qq{$storeid$extension}) { }"

I won't comment on why you want to tie up your machine while this is 
looping.  Tad McClellan posted the same thing, and Tom Phoenix warned 
against it.  I showed both ways, with yet another choice.

> Thank you to everyone for helping me out on this so quickly.

We aim to serve.  :-)

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


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

Date: Wed, 26 Apr 2000 15:48:07 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: min/max
Message-Id: <MPG.1371120442d6375d98a994@nntp.hpl.hp.com>

In article <7ag0s88sdg.fsf@Merlin.i-did-not-set--mail-host-address--so-
shoot-me> on Wed, 26 Apr 2000 21:27:57 GMT, Ala Qumsieh 
<aqumsieh@hyperchip.com> says...
> Larry Rosler <lr@hpl.hp.com> writes:
> > In article <7a3dob9gsv.fsf@Merlin.i-did-not-set--mail-host-address--so-
> > shoot-me> on Tue, 25 Apr 2000 00:15:45 GMT, Ala Qumsieh 
> > <aqumsieh@hyperchip.com> says...
> > > Here's a cool variant:
> > > 
> > > 	$min = [$a => $b] -> [$b <= $a];
> > 
> > For some definitions of 'cool'.  Performance certainly isn't one of 
> > those definitions.
> 
> Usually, performance and coolness are inversely proportional. I
> referred to this snippet as cool due to its symmetry. Note the
> symmetrical use of the fat comma and less-than-or-equal operator.

That's what I meant by "some definitions of 'cool'".  Too bad the '->' 
is both asymmetric and required.

> Of course, since this constructs an anonymous array, does a
> comparison, and then does an array lookup, I wouldn't expect it to
> even come close to a simple if statement (ugh) in terms of speed.

Well, today someone posted:

    $x = (/(.*)/)[0];

instead of:

    ($x) = /(.*)/;

So you never can tell who thinks rococo expressions are necessary and 
who just admires them for their esthetics. 

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


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

Date: Wed, 26 Apr 2000 22:57:23 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Passing a here doc to more
Message-Id: <sget2juqqtj66@corp.supernews.com>

Jeffery Cann (Jeffery_Cann@nospam.sandp.com) wrote:
: I am converting a shell script to PERL.  The shell script uses a here
: document, passed through the 'more' utility to display the help file.
: It is done this way so that the help text is displayed one screen at a
: time.
: 
: more <<EOT
:     Usage:
:     ...
: EOT
: 
: I know that PERL supports here documents.  What I don't know is how to
: pass a here document from my PERL script to the 'more' utility or how to
: alter the display of the here document within the PERL script so that
: one screen displays at a time.  I favor the pass to 'more' approach
: because it's simpler.

This demo version uses 'less' instead of 'more', since that does something
visible (pauses with (END) display at end of input) on a short test
here-doc.


#!/usr/bin/perl -w
# here2less - demo of sending a here-doc to external 'less' command.
# Craig Berry (20000426)

use strict;

open LESS, "|less" or die "Can't open pipe to 'less': $!";

print LESS <<EOT;
Here's some stuff
Here's some more
And so forth
EOT

close LESS or die "Pipe to 'less' reported failure on close: $!";

-- 
   |   Craig Berry - cberry@cinenet.net
 --*--  http://www.cinenet.net/users/cberry/home.html
   |   "The road of Excess leads to the Palace
      of Wisdom" - William Blake


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

Date: Wed, 26 Apr 2000 15:45:05 -0700
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: Passing a here doc to more
Message-Id: <39077171.D0B7076B@jpl.nasa.gov>

Jeffery Cann wrote:
> I know that PERL supports here documents.  What I don't know is how to
> pass a here document from my PERL script to the 'more' utility or how to
> alter the display of the here document within the PERL script so that
> one screen displays at a time.  I favor the pass to 'more' approach
> because it's simpler.

Here are a few ideas:

1) Open a pipe to more and write to the pipe.  See perlopentut, 'perldoc
-f open' and 'perldoc -f print'

2) Call more using the system function.  See 'perldoc -f system'.

3) Use one of the User Inteface modules from CPAN. See
http://search.cpan.org/Catalog/User_Interfaces/

4) Use Perl's format facility. (This may be worthless for your purposes,
but I'm always finding ways to use it.)  See perlform.

Here documents will work anyplace you would use a normal quoted string.

Jon
-- 
Knowledge is that which remains when what is
learned is forgotten. - Mr. King


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

Date: Wed, 26 Apr 2000 18:08:00 -0500
From: "Matt Schuette" <schuette@umr.edu>
Subject: Re: Passing a here doc to more
Message-Id: <39077584@news.cc.umr.edu>

"Jeffery Cann" <Jeffery_Cann@nospam.sandp.com> wrote in message
news:390763D3.7130D3C0@nospam.sandp.com...
> Greetings.
>
> I am converting a shell script to PERL.  The shell script uses a here
> document, passed through the 'more' utility to display the help file.
> It is done this way so that the help text is displayed one screen at a
> time.
>
> more <<EOT
>     Usage:
>     ...
> EOT
>
> I know that PERL supports here documents.  What I don't know is how to
> pass a here document from my PERL script to the 'more' utility or how to
> alter the display of the here document within the PERL script so that
> one screen displays at a time.  I favor the pass to 'more' approach
> because it's simpler.

#!/usr/bin/perl

open(MORE, "|/bin/more");
print MORE<<EOT;
    Usage:
    ...
EOT
close MORE;

Tested it in Unix.  You'll probably want to do 'which more' and use that if
it's different from '/bin/more'.  HTH

Matt




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

Date: Wed, 26 Apr 2000 23:20:36 GMT
From: Sanjay Krishna <krishnasanjay@hotmail.com>
Subject: Perl Programming Notation
Message-Id: <8e7tjs$6o3$1@nnrp1.deja.com>

Is there a programming notation/naming convention for programming in
Perl ??


Thanks
Sanjay



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


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

Date: Wed, 26 Apr 2000 16:42:08 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: Perl Programming Notation
Message-Id: <8e7uta$ubp$1@brokaw.wa.com>


Sanjay Krishna <krishnasanjay@hotmail.com> wrote in message
news:8e7tjs$6o3$1@nnrp1.deja.com...
> Is there a programming notation/naming convention for programming in
> Perl ??

The perlstyle document has some pointers on some conventions.  Of course,
every company (and/or project manager) has a favorite style that may be
imposed on you.  Go with the flow, use the style you feel suits you, but
above all make sure your style is readable.

If you mean the naming convention inside the perl source, take a look at
perlguts or visit the source.

perldoc perlstyle
perldoc perlguts


Lauren




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

Date: Wed, 26 Apr 2000 18:34:45 -0500
From: "Tim Cuffel" <tcuffel@exactis.com>
Subject: Re: Perl Programming Notation
Message-Id: <zILN4.7$jY2.2699@den-news1.rmi.net>

Sanjay Krishna wrote in message <8e7tjs$6o3$1@nnrp1.deja.com>...
>Is there a programming notation/naming convention for programming in
>Perl ??


Information about style can be found in the perlstyle manpage.

man perlstyle

-T





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

Date: Wed, 26 Apr 2000 17:37:59 -0700
From: Makarand Kulkarni <makarand_kulkarni@My-Deja.com>
Subject: Re: Perl Programming Notation
Message-Id: <39078BE7.A1463B13@My-Deja.com>

> Is there a programming notation/naming convention for programming in
> Perl ??

some notes are provided in chapter 8 of the camel book




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

Date: Wed, 26 Apr 2000 23:38:09 GMT
From: mxapac@my-deja.com
Subject: perl question , fuction name var
Message-Id: <8e7ukv$7p8$1@nnrp1.deja.com>

Hi,

it would be nice to retrieve the funciton name
within the sub module.
example :
sub mysub {

 ....
if ($failed == 0 ){
    logerror($function_name);
}

any ideas?



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


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

Date: 26 Apr 2000 19:14:25 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: perl question , fuction name var
Message-Id: <87purctn6m.fsf@shleppie.uh.edu>

>> On Wed, 26 Apr 2000 23:38:09 GMT,
>> mxapac@my-deja.com said:

> Hi, it would be nice to retrieve the funciton name
> within the sub module.  example : sub mysub {
> ....  if ($failed == 0 ){ logerror($function_name); }
> any ideas?

    #!/usr/bin/perl -w
    # Emacs: -*- mode: cperl; -*-
    
    use strict;
    
    sub test_me {
      my ($package, $filename, $line, $subroutine, $hasargs,
	  $wantarray, $evaltext, $is_require, $hints, $bitmask) = caller(0);
    
      print "$filename:$line: calling subroutine $subroutine\n";
    }
    
    test_me();

      ==>  test.perl:13: calling subroutine main::test_me

perldoc -f caller

hth
t


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

Date: Wed, 26 Apr 2000 17:17:22 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: perl question , fuction name var
Message-Id: <Pine.GSO.4.10.10004261716340.21722-100000@user2.teleport.com>

On Wed, 26 Apr 2000 mxapac@my-deja.com wrote:

> it would be nice to retrieve the funciton name within the sub module.

What I think you want can be done with the caller() function; see
perlfunc. Good luck with it!

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



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

Date: 27 Apr 2000 00:47:32 GMT
From: Jim Monty <monty@primenet.com>
Subject: Re: Put Variable Initializations In Other File
Message-Id: <8e82n4$42v$1@nnrp03.primenet.com>

Tom Phoenix <rootbeer@redcat.com> wrote:
> > What's the short answer?
>
> perlmod. (I'd tell you more, but then it wouldn't be a short answer. :-)

Judging from the volume of discussion in this newsgroup about how
packages and modules and 'use' and 'require' and 'do' and scoping
and namespaces and compile-time evaluation and run-time evaluation
and other related things work, the answer to my problem is not as
trivial as simply reading about it somewhere.

I was hoping someone would just show me a simple example of how to
put a hash initialization into a separate file and still "use
strict" in the main or calling script. Based on what I have read,
it cannot be done easily and without knowledge of packages and
modules. (It goes without saying that I don't understand these
topics or I wouldn't have to ask.)

I gave up and read two-column, tab-separated values text files,
parsed them, and initialized the hashes in a while loop. Blech!

-- 
Jim Monty
monty@primenet.com
Tempe, Arizona USA


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

Date: Wed, 26 Apr 2000 16:32:52 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: strict
Message-Id: <39076084.4D6F35E1@home.com>

"Godzilla!" wrote:

Ahh, another PG pseudonym for the killfile. *plonk*

Abridged version: Ignore pretty much anything and everything this person
says. For more details, see below.
 
> "This is the safest mode to operate in, but is
>  sometimes too strict for casual programming."

The one good thing in your entire post. Not yours, of course.

> Use of strict is very effective as a teaching tool 
> until you no longer need it.

That's not what it's for. It's to help you out when you do something
foolish. To the novice this may serve as an educational tool, but it is
no less beneficial to the guru as it points out probable typos and other
silly mistakes.
 
> There are some general guidelines about strict
> which seem to never be mentioned, [...]
> if you don't have command line screen access, 
> using pragma hints such as strict, is a disaster.

Never heard of Carp, eh? "Fatals to Browser" ring a bell?

> Without command line access such as root or telnet, 

Yes, root privileges == CLI, and we encourage you to run as root for all
tasks, not just system administration.

*slap*

> you will never see these pragma hints unless you 
> make special arrangements in your script to have 
> them printed. If you have such a skill to make 
> these special arrangements, you have no need for
> pragma hints, yes?

I know how to drive a car, therefore I can build an airplane. You have a
complete non-sequitur, which doesn't matter anyway since no "special
arrangements" are required.
 
[More misguided drivel snipped.]

> [M]any of these 'hints' created are worded in such 
> a way as to add more confusion and frustration.

Sure, the developers of Perl like to throw in some really bizzare
messages, just to make sure you're paying attention.

> In some circumstances, pragma hints are simply dead wrong.

Such as? Even when a little off the mark, you still know that
*something* is wrong in your program, probably a line or two up.

> other oxymoron is pragma hints are worded in such
> a way, you need to be an expert to make sense of
> what you are reading on your screen. Obviously,
> many times, pragma hints are directed at experts
> rather than those intended to help, beginners.

They are intended to be helpful but concise, and can be rather terse to
those unfamiliar with them. If you find the messages confusing, either
look them up in 'perldoc perdiag' or put 'use diagnostics' in your
program to get more verbose messages.

> Pragma hints are intended to help, but often help
> only those who don't need help; experts in Perl.

I think we can all use a little help when we inadvertantly do something
silly.

> Pragma hints have a use, a purpose, but should
> be used wisely and with some skepticism. For
> beginners, the moderately skilled in Perl, I would
> say avoid pragma hints like the Black Plague.

To those same people, avoid this person's "advice" like the Black
Plague.

> They usually are of no benefit and often create problems.

No, they are almost always of benefit and rarely create problems. When
they do (e.g. because you simply *must* use symrefs) you can disable
them.

> This is a matter for personal judgement and choice.

And your choice is obviously fumbling in the dark, all the while yelling
that you have seen the light!

> Those new to Perl, those developing moderate skills
> in Perl, will learn infinitely more by figuring out
> their problems on their own, sans pragma hints. Hard
> lessons; the best learned and best remembered lessons.

Yes, my boss appreciates me spending all day looking for a silly little
problem that the compiler could have pointed out for me immediately.
You're still shooting wide of the mark. -w and 'use strict' are not
intended to *teach* you how to program Perl. Buy a book for that and
RTFM. These things are intended to *guide* you, pointing out places
where you've done something that is probably not what you intended to
do.

> If you are the type who doesn't shy away from challenging
> circumstances, a type who enjoys learning how to
> avoid problems and enjoys hard work, you will find
> use of strict to be a lazy programmer's excuse
> for avoiding challenges in programming.

If you enjoy spending an hour trying to figure out why your script
doesn't work only to find that on one line you mistyped '$temp' as
'$tmp'...

Laziness is one of the virtues of a good programmer. :) Failure to 'use
strict' is either stupidity or excessive hubris.

-mjc


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

Date: Wed, 26 Apr 2000 16:02:42 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: strict
Message-Id: <39077592.8E023CCD@vpservices.com>

Michael Carman wrote:
> 
> [snip of Godzilla stuff]
>
> I know how to drive a car, therefore I can build an airplane.

Ah, nice turn of phrase, Michael, I am putting that in the FAIQ file,
two catches in one day!

Godz (PG,JoB), I am not commenting on that because it puts you down, but
just because it is clever.  You do have half a point here -- use strict
*is* like an editor and we can't be editors and writers at the same
time, gotta segregate that editor part of the mind off so it doesn't
fowl up the writer part.  Trouble is, unlike creative fiction,
programming can get you in deep deep trouble if you put off all the
editing till the end.  "Strict" isn't like the grammarian whom you can
safely ignore until the end, it's like the part of your brain that knows
whether or not you've introduced a character in your novel yet.  I
suppose you could choose to forget that until the end and keep
reintroducing the character every chapter, but would you really want
to?   Regards to Shirley and the pets, talk to the therapist early and
often.

-- 
Jeff


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

Date: Thu, 27 Apr 2000 01:51:14 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: strict
Message-Id: <Pine.GHP.4.21.0004270145470.27940-100000@hpplus01.cern.ch>

On Wed, 26 Apr 2000, Michael Carman wrote:

> [More misguided drivel snipped.]
> 
> > [M]any of these 'hints' created are worded in such 
> > a way as to add more confusion and frustration.
> 
> Sure, the developers of Perl like to throw in some really bizzare
> messages, just to make sure you're paying attention.

Please, do not feed the troll.  Its ego feeds on anyone willing to
take it seriously, when all the time it's just trying to be
disruptive.

> I think we can all use a little help when we inadvertantly do something
> silly.

Amen to that!  I learned Perl initially without the benefit of the
safety harness, but I wouldn't do without it now that I understand a
bit more.

> And your choice is obviously fumbling in the dark, all the while yelling
> that you have seen the light!

Nicely put.  But still, please do not feed the troll.



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

Date: Thu, 27 Apr 2000 00:35:26 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: system return code problem
Message-Id: <FtnGB3.LA3@news.boeing.com>

In article <FtLMDs.KGq@news.boeing.com>,
Charles DeRykus <ced@bcstec.ca.boeing.com> wrote:
> ....
>system q{ (foo;echo $?)| tee afile.log;exit `tail -1 afile.log` };
>

Here's a much better solution from Tom Christiansen:

system { 
  exec 3>&1;
  exit `( (myprogram; echo $? 1>&4 3>&- 4>&-) |
              tee afile.log 1>&3 3>&- 4>&1 ) 4>&1`;
};
if ($?) { warn "myprogram failed: $?" }



--
Charles DeRykus


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

Date: 26 Apr 2000 22:06:04 GMT
From: inwap@best.com (Joe Smith)
Subject: Re: tie
Message-Id: <3907684c$0$212@nntp1.ba.best.com>

In article <38F63A41.C3433C0E@Mysticglow.com>,
John Watson  <johnwatson@Mysticglow.com> wrote:
>tie(@array,"DB_File","file.txt", O_RDWR|O_CREAT, 0644, $DB_RECNO) or die;
>
>but what I need to be able to do is have a file that holds two element
>arrays.

DB_File can only store strings, not arrays.
You will have to convert array to a string (possibly with join()) on
writing, and convert the string back to an array (possibly using split()).

If you intend to store more complicated structures in a file, then
you should take a look at Data::Dumper.
	-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.


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

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


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