[8208] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1826 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Feb 7 00:07:28 1998

Date: Fri, 6 Feb 98 21:00:33 -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           Fri, 6 Feb 1998     Volume: 8 Number: 1826

Today's topics:
    Re: 'require' dir same as app's? <tchrist@mox.perl.com>
    Re: 'require' dir same as app's? <tchrist@mox.perl.com>
    Re: A Scoping Related Question <tchrist@mox.perl.com>
    Re: Advice needed. <tchrist@mox.perl.com>
    Re: AUTOLOAD subroutine <zenin@best.com>
    Re: can variables be generated on the fly <tchrist@mox.perl.com>
    Re: Debuggin w/o shell <tchrist@mox.perl.com>
        deleting stuff from an array <gwl@commerce.com>
    Re: Destroying any and all elments of an array.. how? <tchrist@mox.perl.com>
    Re: Don't use signal handlers (was Re: Child processes) <tchrist@mox.perl.com>
    Re: Error sending mail /$wl007$/ <tchrist@mox.perl.com>
    Re: flocking questions! <tchrist@mox.perl.com>
    Re: flocking questions! <tchrist@mox.perl.com>
    Re: flocking questions! <tchrist@mox.perl.com>
        Forgery => Killfile <tchrist@mox.perl.com>
    Re: Generic Config-file maintenance <tchrist@mox.perl.com>
    Re: gethostbyaddr example please <tchrist@mox.perl.com>
    Re: getting perl system calls to run in different shell <tchrist@mox.perl.com>
    Re: How to reuse Perl internal methods <camerond@mail.uca.edu>
    Re: How to sort data from a file <tchrist@mox.perl.com>
    Re: How write to a file using "format" & "write" ? <tchrist@mox.perl.com>
    Re: I am female, blonde and stupid! <tchrist@mox.perl.com>
    Re: IO::Socket::INET newbie question <kellysm@ix.netcom.com>
    Re: Is file locking necessary? <tchrist@mox.perl.com>
    Re: Is Perl 5 year 2000 compliant? <tchrist@mox.perl.com>
    Re: Is Perl 5 year 2000 compliant? <tchrist@mox.perl.com>
    Re: Is this correct? File Locking <tchrist@mox.perl.com>
    Re: Is this correct? File Locking <tchrist@mox.perl.com>
    Re: killing a child process after a timeout <tchrist@mox.perl.com>
    Re: netscape.hst regex <cbevis@nsinet-nospam-.com>
    Re: non-regex for potentially RFC-compliant email addre <dformosa@st.nepean.uws.edu.au>
    Re: perl and file system <tchrist@mox.perl.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 4 Feb 1998 14:05:37 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: 'require' dir same as app's?
Message-Id: <6b9sjh$6kq$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, cberry@cinenet.net (Craig Berry) writes:
:Now, the problem:  When run from the directory containing the two source 
:files mentioned above, all is well.  However, when run from any other 
:dir, the 'require' can't find 'bar.pl'.  Now, obviously, that's because 
:the dir where my app lives isn't in @INC, nor should it be in general.  
:However, I'd love to convey to Perl the idea 'look in the same dir you 
:got the current file from' without having to fall back on 'require 
:/path/to/bar.pl', which I'm doing now as a stopgap.
:
:So, what should I do?

You should read the FAQ, which covers this.  You'll be happy
you did.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    "Just because you're into control doesn't mean you're in control."
    	--Larry Wall


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

Date: 5 Feb 1998 13:10:04 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: 'require' dir same as app's?
Message-Id: <6bcdnc$vo$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, cberry@cinenet.net (Craig Berry) writes:
:Perfect!  Thanks very much for the info.  Now, for my future edification,
:how could I have found this in the FAQ?  Even knowing what I'm looking for
:(as I do now), I see no trace of this.  Perhaps I'm just being blind. 

It's in perlfaq8.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    Just don't compare it with a real language, or you'll be unhappy...  :-)
            --Larry Wall in <1992May12.190238.5667@netlabs.com>


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

Date: 7 Feb 1998 02:07:11 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: A Scoping Related Question
Message-Id: <6bgfkf$b1b$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, shaker@netusa1.net writes:
:Or, in Case 2, can I use both the $var1 defined inside the sub and
:the one defined outside ? Not that I would want to do that.

First of all, local doesn't define anything to the compiler.  In fact,
the compiler ignores it in setting up variable definitions.  The compiler
deals with my.  The interpreter deals with saves (er, "local"s).

You could have both, but it will just get you talked about.  In fact,
lexicals and dynamics cannot see each other, and if both exist, the
lexical takes precedence!

    package SomeWhere;
     $::var = "main global";
       $var = "somewhere global";
    my $var = "lexical";

    print $::var;   # main global
    print   $var;   # lexical 
    print  ${var};  # lexical 
    print ${"var"}; # somewhere global


Dynamic scoping is just not something you want to encourage.
The days of perl4 brought atrocities like this:

    # feed `find -ls` into this to translate
    # 204814    4 -rw-------   1 tchrist  wheel        3776 Feb  4 ...
    # into something like this
    # 204814    4 -rw-------   1 101      0            3776 Feb  4 ...
    # 

    $fmt = 'a26 A9 A8 a*';

    while (<>) {
	($pre, $login, $group, $post) = unpack($fmt, $_);
	print pack($fmt, $pre, &id(*login), &id(*group), $post);
    }

    sub id {
	local(*id) = @_;
	$id{$id} = $id =~ /^\d+$/ ? $id : &id       unless defined $id{$id};
	$id{$id};
    }

    sub login { (getpwnam($id))[2]; }
    sub group { (getgrnam($id))[2]; }

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


    "Many folks want nothing more than to live and let learn." --Larry Wall


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

Date: 5 Feb 1998 03:35:23 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Advice needed.
Message-Id: <6bbc1r$m2m$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, "Sergio Loscialo" <sloscialo@chubb.com>
:I really could have done without your condescending
:post.  

Condescending?  *That* was condescending??  Sergio, you have no early
clue what condescending can be.  You really don't.  What Mr. Phoenix
posted was the height of civility and kindless.

:I don't see you going around posting that message
:to everyone who writes simple subject lines.  

I do.  It's on its way.

I also killfile people who intentionally post with unanswerable addresses,
as well as clearly post their despammed addresses for all to see.
I use spam filters.  You can too.

Yours is 

    "Sergio Loscialo" <sloscialo@chubb.com>

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


"SPARC" is "CRAPS" backwards --Rob Pike


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

Date: 7 Feb 1998 03:06:56 GMT
From: Zenin <zenin@best.com>
Subject: Re: AUTOLOAD subroutine
Message-Id: <886821094.999228@thrush.omix.com>


Allen Choy <achoy@us.oracle.com> wrote:
: Is it possible to share an AUTOLOAD subroutine by several modules?

	Yes, just inherit it.

-- 
-Zenin
 zenin@best.com


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

Date: 3 Feb 1998 21:49:50 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: can variables be generated on the fly
Message-Id: <6b83du$dbk$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, ehood@medusa.acs.uci.edu (Earl Hood) writes:
:Maybe for variables, but can be handy for subroutines.  For many of the
:cases where references are needed, soft references are not needed.
:However, they do have there uses, especially when obtaining a reference
:to an object can be quite troublesome if you restict your self to hard
:references only.

Like where?

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


    "Have the appropriate amount of fun." --Larry Wall


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

Date: 4 Feb 1998 14:26:00 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Debuggin w/o shell
Message-Id: <6b9tpo$6kq$3@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, pjmone@symbioticinc.com writes:
:Due to the elitest nature of the body of programmers who reside here, I
:am forced to both use a proper subject and be as specific as I can.

More particularly, due to that comment, you get killfiled for 
petulance and insulence.  Someday you folks will learn what 
a slanderous negative flash-word "elitist" is.

!Hasta nunca!

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

"If Dennis Ritchie were the man who developed Modula-2 then C would be long forgotten."
    --Tarjei Jensen


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

Date: Fri, 6 Feb 1998 11:06:27 -0700
From: "GW Lander" <gwl@commerce.com>
Subject: deleting stuff from an array
Message-Id: <6bfjfb$mgo@lace.colorado.edu>

I have an array with data similar to the following...

\\MYMACHINE\Processor(0)\% Processor Time
\\MYMACHINE\Paging File(\??\C:\pagefile.sys)\% Usage Peak
\\MYMACHINE\Paging File(\??\C:\pagefile.sys)\% Usage

What I am trying to do is get rid of everything the the left of the last "\"
and keep just the stuff to the right of the last "\".  I would like for the
array to look similar to the following when this step is done...

% Processor Time
% Usage Peak
% Usage

Anybody have a suggestion for the simplest way to do this?

Thanks for any suggestions.

gw





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

Date: 4 Feb 1998 00:31:56 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Destroying any and all elments of an array.. how?
Message-Id: <6b8cts$r22$1@csnews.cs.colorado.edu>

In comp.lang.perl.misc, dilcher@cueva.nospam.com (Jeff) writes:

[A reply to this poster has been sent in email.]
[Pity he can't receive it.]

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

if (shm == (char *)-1)  /* I hate System V IPC, I really do */
    --Larry Wall, from doio.c in the v5.0 perl distribution


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

Date: 4 Feb 1998 22:05:00 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Don't use signal handlers (was Re: Child processes)
Message-Id: <6baomc$sa8$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, aml@world.std.com (Andrew M. Langmead) writes:
:But the amount of C that you would have to write to make an XSUB that
:handled signals would be farily small compared to the amount of perl
:that you would have to write. (For a program of moderate complexity.)
:
:Hey when I'm writing in C I occationally need to write some ASM code?
:Whats the matter with mixed language programming? Writing at the level
:required for the task at hand?

This whole issue is misrepresented.  I strongly suggest that those
advocating this approach should provide C version of everything
we use signals for, including longjumping out.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

BASIC: A programming language.  Related to certain social diseases in
that those who have it will not admit it in polite company.


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

Date: 5 Feb 1998 03:39:39 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Error sending mail /$wl007$/
Message-Id: <6bbc9r$m2m$3@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, "Wim Lambrechts" <Wim.Lambrechts@village.uunet.be>
posted a message with an unrepliable, "spamproof" address.  He has been
killfiled for illegal postings.

I use spamfilters, and so can you.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    X-Windows: Even your dog won't like it.
	--Jamie Zawinski


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

Date: 6 Feb 1998 16:05:56 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: flocking questions!
Message-Id: <6bfcd4$4f4$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, "Jerry Davis" <gedavis3@vt.edu> writes:
:Thanks to all that helped me with my first flock question, but some test
:scripts have yielded some more questions.

And while I'm on the matter, grep for flock in the perl docs, 
*especially* the FAQs, which talks about a lot of this.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


You have made an excellent hit on the UNIX.--More--


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

Date: 6 Feb 1998 22:41:37 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: flocking questions!
Message-Id: <6bg3j1$cj$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, Chris <cnewell@ableweb.com> writes:
:As long as we're on the subject....
:Is there a way to flock a dbm file? I have a web site that uses dbms extensively
:and this
<BAD WRAP>
:would be an issue for me..

Yes:

    man DB_File

--tom

-- 
	Tom Christiansen	tchrist@jhereg.perl.com


Emacs is a fine programming language, but I still prefer perl. -me


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

Date: 6 Feb 1998 15:21:36 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: flocking questions!
Message-Id: <6bf9q0$ba$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, "Jerry Davis" <gedavis3@vt.edu> writes:
:But I don't understand how flock protects file contents if it checks for a
:lock AFTER the file has opened.

It doesn't.  Flock protects from other flockers.  Nothing more.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
    That means I'll have to use $ans to suppress newlines now.  
    Life is ridiculous. 
        --Larry Wall in Configure from the perl distribution


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

Date: 3 Feb 1998 23:02:52 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Forgery => Killfile
Message-Id: <6b87ms$ka7$2@csnews.cs.colorado.edu>

People who forge their return address will not receive my 
help.  In fact, you will be killfiled.  I'm not going to
argue about it -- it's what I'm doing.  If you don't like 
it, don't forge.  I use spam filters, and so can you.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
    Sorry.  My testing organization is either too small, or too large, depending
    on how you look at it.  :-)
            --Larry Wall in <1991Apr22.175438.8564@jpl-devvax.jpl.nasa.gov>


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

Date: 4 Feb 1998 22:17:18 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Generic Config-file maintenance
Message-Id: <6bapde$sa8$3@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, phil@freed.com (Philip Freed) writes:
:I'd like to maintain a number of config files to be used by various
:Perl utilities.  

    require 'myprogconfig.pl';

Just make the config file straight perl!  Anything else is dubious at best.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

"There is no idea so sacred that it cannot be questioned, analyzed...
 and ridiculed." --Cal Keegan


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

Date: 6 Feb 1998 15:49:54 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: gethostbyaddr example please
Message-Id: <6bfbf2$2td$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    AFL <sa346@city.ac.uk> writes:
:I'm trying to use gethostbyaddr() and am having real problems, I just
:can't fathom-out what perl expects.  Anyone got an example? 

% man perlipc | grep gethostbyaddr
               my $name = gethostbyaddr($iaddr,AF_INET);
               my $name = gethostbyaddr($iaddr,AF_INET);
        use Net::hostent;              # for OO version of gethostbyaddr
          $hostinfo = gethostbyaddr($client->peeraddr);
               $host = gethostbyaddr($hisiaddr, AF_INET);

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

If you want your program to be readable, consider supplying the argument.
            --Larry Wall in the perl man page 


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

Date: 5 Feb 1998 22:38:14 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: getting perl system calls to run in different shells
Message-Id: <6bdf0m$7m4$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, sharyl_griffith@ftw.paging.mot.com writes:
:I'm trying to get my perl scripts with system calls to run regardless of
:which shell a user is running.	Is there an easy way to do this?

Their shell is irrelevant to the performance of system calls.
The shell cannot affect read, write, getuid, or any other
system call.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    if (rsfp = mypopen("/bin/mail root","w")) {     /* heh, heh */
        --Larry Wall in perl.c from the perl source code


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

Date: Fri, 06 Feb 1998 21:22:56 -0600
From: Cameron Dorey <camerond@mail.uca.edu>
To: blazer@mail.nevalink.ru
Subject: Re: How to reuse Perl internal methods
Message-Id: <34DBD390.3B78A93E@mail.uca.edu>

Mike wrote:
> 
> Hi all,
> I've got this question trying to make some analysis on perl-scripts.
> The
> first goal was to remove all comments from perl-script. 

I'm just curious, why? It shouldn't help the run-time.

Cameron Dorey
camerond@mail.uca.edu


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

Date: 4 Feb 1998 14:21:45 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to sort data from a file
Message-Id: <6b9thp$6kq$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, davidh@wwwpromote.com writes:
:I need some help sorting the contents of a file by a certain field on
:each line.  

    http://www.perl.com/CPAN/doc/FMTEYEWTK/sort.html

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
    "I have many friends who question authority.  For some reason most of 'em
    limit themselves to rhetorical questions."
    	--Larry Wall


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

Date: 3 Feb 1998 22:52:31 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How write to a file using "format" & "write" ?
Message-Id: <6b873f$ka7$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, Joey Garcia <j.garcia@lmco.com> writes:
:I want to mail a formatted report and I am using the "format" and
:"write" command, but that outputs the data to the STDOUT.  How can I
:have it write to a file for emailing?  Please be specific, thanks!

I specifically wrote the perlform manpage to address this question.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

        "If Christianity were to disappear, in time, even the 
		churches would suffer."  --Jonathan Swift


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

Date: 4 Feb 1998 00:33:25 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: I am female, blonde and stupid!
Message-Id: <6b8d0l$r22$2@csnews.cs.colorado.edu>

In comp.lang.perl.misc, Kati Gaebler <dont@mailmehere.com> writes:

[A reply to this poster has been sent via email.
 Pity she can't receive it.]

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    echo "Your stdio isn't very std."
            --Larry Wall in Configure from the perl distribution


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

Date: Fri, 06 Feb 1998 21:35:15 -0500
From: "Shawn M. Kelly" <kellysm@ix.netcom.com>
To: Tony.Curtis@vcpc.univie.ac.at
Subject: Re: IO::Socket::INET newbie question
Message-Id: <34DBC863.79FBC0B1@ix.netcom.com>

Tony,

    Thank you very much for the assist. I didn't understand the $pop->
references but I managed to use the autoflush successfully in my ugly
code. I could not find references to autoflush or the $pop-> (methods?)
notation in the Camel or Gecko book? Would this be documented in some
other book or only in the online doc somewhere?

Again, thank you.

Regards,

Shawn M. Kelly

Remove xx to reply wrote:

> Re: IO::Socket::INET newbie question, Shawn
> <kellysm@ix.netcom.com> said:
>
> Shawn> print ($pop "USER username \n");
>
> Shawn> server. My next line "print ($pop "USER username
> Shawn> \n");" doesn't seem to run. I never get the next OK
>
> The handle needs to be flushed.  And lines should be
> terminated with CR LF.
>
> You should also really use the supplied Handle methods, viz.
>
> autoflush $pop 1;
> $pop->print("USER username\r\n");
>
> $pop->getline ....
>
> You might like to consider using the Net::POP3 module
> instead...
>
>     $wheel->reinvent(0);
>
> hth,
> tony





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

Date: 4 Feb 1998 03:36:23 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Is file locking necessary?
Message-Id: <6b8nnn$5t4$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, "Bill Genzer" <bill@fathead.net> writes:
:My question is if it is necessary to lock files before
:reading or writing to files?  

Of course you do, and more.  Welcome to the wonderful world
of multitasking.  See the FAQ.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
The use of COBOL cripples the mind; its teaching should, therefore, be
regarded as a criminal offense.
                --E. W. Dijkstra (1982)


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

Date: 5 Feb 1998 02:19:40 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Is Perl 5 year 2000 compliant?
Message-Id: <6bb7js$i6r$2@csnews.cs.colorado.edu>

:On Wed, 4 Feb 1998, Matthew Rock wrote:
:> Does anyone know of any problems with Perl 5 and Y2K?

Yes, generally related to those poor people who get spooked by rabid
insurance companies into believing all this Y2K nonsense due
idiotic lawyer-phobia.  

Perl is just as Y2K as my pencil; no more, no less.  You'll
find no scape goats here.  On your own heads be it.

A more lengthy treatise on this topic will be forthcoming 
from me presently.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


	"Lasciate ogni speranza, voi ch'entrate!"


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

Date: 5 Feb 1998 14:35:24 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Is Perl 5 year 2000 compliant?
Message-Id: <6bcinc$5va$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    Abraxas@hell.com (Tiberius) writes:
:Well, exactly what *isn't* in the documentation? Of course it's in the
:documentation. Virtually everything is. If only questions that had no
:answers in the docs were posted in the newsgroups, there'd be like,
:what, 2 questions a day?

If the answer can be found through 

    grep pattern /usr/src/perl/pod/*.pod

Then it should be researched there before coming here.  In fact, even
it isn't there, it should be researched first.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    "Lisp has all the visual appeal of oatmeal with fingernail clippings mixed in."
    	--Larry Wall


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

Date: 4 Feb 1998 14:32:06 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Is this correct? File Locking
Message-Id: <6b9u56$6kq$4@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    "Bill Genzer" <bill@fathead.net> writes:
:I'm still new at CGI and I've looked at several different FAQs trying to
:figure out file locking and I think I finally got it, this is a broken down
:version of what I'm doing, I just wanted to make sure it looks correct.

:open (FILE,">$filepath");
:#Lock File Before Updating
: flock(FILE,2);
:seek(FILE, 0, 2);
:print FILE "$FORM{'datafield'}\n";
:#UnLock File After Updating
: flock(FILE,8);
:CLOSE(FILE);

:Does it matter where you lock and unlock the file?  (either before or after
:you open or close the file?) This is how it was in the FAQ I found and as
:far as I can tell it works fine.

You have several things wrong here.  One is that you don't
check return values.  The other thing is that YOU SHOULD NOT
UNLOCK THE FILE.

What you have there is quite different from what I have
in the FAQ you allege to have consulted.  Please, please
check again.

man perlfaq5: I still don't get locking.  I just want to increment the
	      number in the file.  How can I do this?

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
They spell it "da Vinci" and pronounce it "da Vinchy".  Foreigners
always spell better than they pronounce.
                -- Mark Twain


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

Date: 5 Feb 1998 13:13:12 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Is this correct? File Locking
Message-Id: <6bcdt8$vo$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, joseph@5sigma.com writes:
:I'm not sure why myself.  LOCK_UN *does* flush the filehandle.
:Maybe there are some systems where this doesn't work reliably?

Yes, ones prior to the 5.004 of Perl.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    I don't know if it's what you want, but it's what you get.  :-)
            --Larry Wall in <10502@jpl-devvax.JPL.NASA.GOV>


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

Date: 4 Feb 1998 23:51:33 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: killing a child process after a timeout
Message-Id: <6bauu5$8oh$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, chip@pobox.com writes:
:You are using Perl signal handlers.
:Don't.  They don't work reliably.
:You must do what you want some other way.

Chip, *THERE IS NO OTHER WAY*.  Stop telling peple to go blow.
Either supply them with your undisclosed XS code eveyr time they ask,
or else stop telling them no.

It's simply not acceptable to tell people "no" like this.   I use
signal handlers every day.  For the kind of thing he's talking
about, there's no problem.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
"I sincerely hope that the future does not mean we must continually restrict
 ourselves to the tools that were available 10 years ago."
	Mark Bush in comp.unix.wizards <4235@inca.comlab.ox.ac.uk>


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

Date: Fri, 06 Feb 1998 20:16:31 -0600
From: Cam Bevis <cbevis@nsinet-nospam-.com>
Subject: Re: netscape.hst regex
Message-Id: <34DBC3FF.F01B053A@nsinet-nospam-.com>

Clay Irving wrote:
> 
> In <34DB2841.16A6D012@nsinet-nospam-.com> Cam Bevis <cbevis@nsinet-nospam-.com> writes:
> 
> >I'm trying to parse a netscape.hst file (about:global doesn't work since
> >the file is corrupted).
> 
> >Its a 4 byte hex string (the date, captured to $1), followed by
> >"http://",
> >followed by the URL(captured to $2). I think I have a byte
> >ordering/hex->decimal->date conversion problem too,
> >but I'm not tackling that right now(any pointers would be welcomed,
> >though).
> 
> >Here's (what seems to be) a record looks like:
> 
> >>;d4http://www.databaseamerica.com/image/dba_anim.gif
> 
> >...and here's the code I'm trying to use?
> 
> >open HISTORY, "netscape.hst";
> >my $Data = <HISTORY>; # whole file as a single string
> >while( $Data =~m|(.{4})http://(.*)|igs)
> >   { $mytime= $1; $url= $2;  $mytime=pack("H*", unpack("V*",
> >$mytime));$mytime=gmtime $mytime;print "$mytime $url \n"; }
> 
> >Has anybody done this before, or can I get a shove in the right
> >direction?
> 
> Perl Modules are your friend.
> 
> Take a look at:
> 
>   Netscape::History
>   http://www.perl.com/CPAN-local/authors/id/NEILB/


  Yes they are, and always have been my friend (Thanks! to the
authors!)  That module is  for the history.db file from UNIX Netscape,
and this is a netscape.hst from w95, and corrupted at that.  

Thanks for giving it a shot anyway.


Cam

-- 
Cam Bevis
Non-spammers remove -nospam- to respond
cbevis@nsinet-nospam-.com


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

Date: 7 Feb 1998 01:49:41 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: non-regex for potentially RFC-compliant email address (was Re: Quickie: regexp for valid e-mail addresses)
Message-Id: <886816142.601815@cabal>

In <qz$9802061544@qz.little-neck.ny.us> Eli the Bearded <*@qz.to> writes:

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

[...]

>> dformosa@st(look)nepean(no)uws(dots)edu(here)au

>That is a sendmail-ism and is not likely to work with other programs.

True,  personaly I would have liked sendmail to turn them into a null
chars.  This way I could stick it all threw the address and create an even
more glorious mess.

--
Please excuse my spelling as I suffer from agraphia see the url in my header. 
Never trust a country with more peaple then sheep. 
Support NoCeM http://www.cm.org/                   
I'm sorry but I just don't consider 'because its yucky' a convincing argument


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

Date: 4 Feb 1998 14:36:29 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: perl and file system
Message-Id: <6b9udd$7pr$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    Fabrice Gonton <fabrice.gonton@aigf.sncf.fr> writes:
:Well, I should have said how determine the TYPE of fs 
:(i.e ufs jfs tmpfs nfs ...) with a PERL command, that works on nearly
:all Un*x systems

    $ mount | grep fs | perl -pe 's/.+type\s+(\S+).*/$1/'

Today is the day that the world forgets the toolbox.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


Ken is very smart but also very opinionated.  --Doug Gwyn


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

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

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