[10165] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3758 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 19 12:07:18 1998

Date: Sat, 19 Sep 98 09:00:19 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 19 Sep 1998     Volume: 8 Number: 3758

Today's topics:
    Re: Can I run Perl program regularly? <asehbai@osf1.gmu.edu>
    Re: Can you speed up this logfile report??? "Jim Woodgate" <jdw@dev.tivoli.com
        Efficency Experiments <mooneer@earthlink.net>
        Extracting fields from a fixed length file with no nl o <dgr@page-moy.co.uk>
    Re: Extracting fields from a fixed length file with no  <garry@america.net>
    Re: Extracting fields from a fixed length file with no  (Jeffrey Drumm)
    Re: Getting a line from a text file into an array (Alastair)
        Help with file test operator problem <843943n34@knight_storm@usa.net.sprynet.com>
    Re: Help with file test operator problem (Mark-Jason Dominus)
        How do I implement perl with javascript or vice versa? <poohba@io.com>
    Re: How do I take @_ and set it to $foo? (Michael J Gebis)
        How to produce a compiled file <marooo@tin.it>
    Re: How to produce a compiled file <alf@orion.it>
    Re: How to produce a compiled file <tchrist@mox.perl.com>
    Re: Interesting method technique: Default $self (Kevin Reid)
    Re: Module download problem (Alastair)
    Re: Perl & Java - differences and uses <borg@imaginary.com>
        Problems running Perlshop on my NT  <eyal@infomall.co.il>
        Ques: read data from pipe (Mike Collins)
    Re: Removing double entries from array (Marc-A. Woog)
    Re: script: scriptMangle! (Craig Berry)
        Symbol Tables, executing code from external files while <mitochon@hotmail.com>
    Re: what good is flock $LOCK_NB? (Mark-Jason Dominus)
    Re: what's wrong with win32 perl ? <gp@gpsoft.de>
    Re: where is Date::Parse? <antony@fabric8.nospam.com>
    Re: where is Date::Parse? (Michael Fuhr)
        Where is perldelta that describes new features in 5.005 (Jari Aalto+mail.perl)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Sat, 19 Sep 1998 04:50:19 -0400
From: Aamir Sehbai <asehbai@osf1.gmu.edu>
To: Paul Marsh <pjm@hplb.hpl.hp.com>
Subject: Re: Can I run Perl program regularly?
Message-Id: <Pine.OSF.3.96.980919044301.14425A-100000@osf1.gmu.edu>


> 
> D wrote in message <358ecba4.0@rapeme.kirov.ru>...
> >Dear Sir/Madam
> >
> >How can I make a program that can run my Perl program regularly (daily)?
> >

For some reason my account does not allow crontab, but does allow at jobs.
If that is your case too, consider using the following trick : 

Put this line (or something similar) at the top of your script :
   system("at now + 24 hours scriptname");

Then run the script once, and automatic at jobs will be scheduled every 24
hours or so.




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

Date: 18 Sep 1998 21:58:45 -0500
From: "Jim Woodgate" <jdw@dev.tivoli.com
Subject: Re: Can you speed up this logfile report???
Message-Id: <ob90jgq04a.fsf@goliath.dev.tivoli.com>


Tony Boyd <aboyd@slip.net> writes:
> The problem is that it gets slow.  5 megs?  Does that under a minute.  50
> megs?  Takes 30 minutes.  So I'm hoping the masters here can critique this
> code and clue me in to ways that will hyper-optimize the execution:

I saw Larry's note it was really good, but I wanted to make two quick
comments:

> 	if ($line =~ m!GET (/[^ ]+) HTTP!i) {  #This grabs the file requested

Since your files are big enough that it might make a difference, you
might want to try [Gg][Ee][Tt]  and [Hh][Tt][Tt][Pp] instead of using
the /i

> 			@earls = ($match,@earls);  #This adds it to the array

Like Larry said, this is a wasted step, but it's also a *really* bad
step.

push (@earls,$match);

adds $match to @earls

@earls = ($match, @earls);

Makes at least one extra copy of @earls and copies it element by
element!!  As @earls gets bigger and bigger all that wasted allocation
of memory, copying, and freeing is "real bad"(tm)

I would guess that just changing this one line would make your script
much faster.  And if/when you take this out and just put the hash in
directly, you'll be "real happy"(tm)

-- 
Jim Woodgate 
Tivoli Systems
E-Mail: jdw@dev.tivoli.com


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

Date: Sat, 19 Sep 1998 06:36:39 -0700
From: Mooneer Salem <mooneer@earthlink.net>
Subject: Efficency Experiments
Message-Id: <3603B367.7D917CA@earthlink.net>

I'm trying to make a program that I'm writing faster. The program I'm
writing will take an HTML file, take Perl code located between <perl>
and </perl>, and execute it. The hard part's already done; I just have
to make my code faster and add some error handling to it. I was thinking
that variable interpolization might be the bottleneck, so I tried to do
as little of it as possible by using join statements whenever I needed
to insert the contents of a variable into a string of printed text, and
using single quotes in print statements when I don't need to insert
contents of variables.

My code's below; can anyone see any other ways to make the code faster?

-- 
Mooneer Salem
Webmaster & Administrator for HyperNetMsg
(http://hypernetmsg.hypermart.net)

(nph-hnm_parse.pl)
------------------

#!/usr/local/bin/perl

# HyperNetMsg, version 1.0
# HTML Parser (a.k.a Perl Nest)
#
# Filename: nph-hnm_parse.pl
# Author:   Mooneer Salem (mooneer@earthlink.net) and
#           Thomas Garvey (garvjr@revealed.net)
############################
# The following lines print the customary nph header lines
# and set the program to automatically flush the output buffer.

$| = 1;

$http_header = join("\n", 'HTTP/1.0 200 OK', 'Content-type: text/html',
"\n");
print $http_header;

# Set the path to the files that you want to parse

$path_to_html = '/data1/hypermart.net/hypernetmsg';

# Retrieve the extra path information from the URL

$path_info = $ENV{'PATH_INFO'};

# Load the Carp module, which provides more detailed error
# handling

use Carp;

# Open and read in the specified file

$total_filename = join('', $path_to_html, $path_info);
$error_msg = join('', 'Error while opening ', $total_filename);

open(FILE, $total_filename) or croak $error_msg;
while(<FILE>) {
    if (/<\s*perl\s*/) {
        $perl_code = undef;
        while(<FILE>) {
            if (/<\s*\/perl\s*/) {
                last;
            }
            $perl_code = join('', $perl_code, $_);
        }
    
        eval $perl_code;
        if ($@) {
            print $@;
        }
    } else {
        print;
    }
}
close(FILE);


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

Date: Sat, 19 Sep 1998 13:24:45 +0100
From: Dave Robson <dgr@page-moy.co.uk>
Subject: Extracting fields from a fixed length file with no nl or cr
Message-Id: <3603A28D.AFF7C3D2@page-moy.co.uk>

I have a fixed length file (90 Characters long) & I want to pull off the
last 5 characters from each record, the file has no delimiters in it i.e
no Newline or Carrige Return at the end of the record.

Does anyone have any bright ideas ?

Thanks

Dave



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

Date: Sat, 19 Sep 1998 12:53:28 GMT
From: Garry Williams <garry@america.net>
Subject: Re: Extracting fields from a fixed length file with no nl or cr
Message-Id: <3603A993.3B855528@america.net>

$ perldoc -f sysread
=item sysread FILEHANDLE,SCALAR,LENGTH,OFFSET

=item sysread FILEHANDLE,SCALAR,LENGTH

Attempts to read LENGTH bytes of data into variable SCALAR from the
specified FILEHANDLE, using the system call read(2).  It bypasses
stdio, so mixing this with other kinds of reads, print(), write(),
seek(), or tell() can cause confusion because stdio usually buffers
data.  Returns the number of bytes actually read, or undef if there
was an error.  SCALAR will be grown or shrunk so that the last byte
actually read is the last byte of the scalar after the read.

An OFFSET may be specified to place the read data at some place in the
string other than the beginning.  A negative OFFSET specifies
placement at that many bytes counting backwards from the end of the
string.  A positive OFFSET greater than the length of SCALAR results
in the string being padded to the required size with "\0" bytes before
the result of the read is appended.

$

Dave Robson wrote:
> 
> I have a fixed length file (90 Characters long) & I want to pull off the
> last 5 characters from each record, the file has no delimiters in it i.e
> no Newline or Carrige Return at the end of the record.
> 
> Does anyone have any bright ideas ?
> 
> Thanks
> 
> Dave


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

Date: Sat, 19 Sep 1998 13:58:21 GMT
From: drummj@mail.mmc.org (Jeffrey Drumm)
Subject: Re: Extracting fields from a fixed length file with no nl or cr
Message-Id: <3604ae69.128748225@news.mmc.org>

On Sat, 19 Sep 1998 13:24:45 +0100, Dave Robson <dgr@page-moy.co.uk> wrote:

>I have a fixed length file (90 Characters long) & I want to pull off the
>last 5 characters from each record, the file has no delimiters in it i.e
>no Newline or Carrige Return at the end of the record.

>Does anyone have any bright ideas ?

Hmm. Didn't see "[Pp]erl" anywhere in the subject or question, but just in
case:

Seems like the perfect application for open, seek and read. You'll find out
how to use those wonderful functions in the documentation included with
every distribution of Perl.

Or you could simply use fold and cut, if you aren't using a
functionality-challenged OS (like I am at the moment) . . . :)

-- 
                           Jeffrey R. Drumm, Systems Integration Specialist
                                  Maine Medical Center Information Services
                                     420 Cumberland Ave, Portland, ME 04101
                                                        drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented." -me


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

Date: Sat, 19 Sep 1998 12:52:50 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Getting a line from a text file into an array
Message-Id: <slrn707e06.4m.alastair@calliope.demon.co.uk>

mike@www.bcinternet.com <mike@www.bcinternet.com> wrote:
>#!/usr/bin/perl
>open(IN,'<path to file>');
> ...

You should check the status of the 'open' here i.e.

open(IN,'<path to file>') or die "Failed to open file : $!";

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: Sat, 19 Sep 1998 07:32:32 -0700
From: "Knight" <843943n34@knight_storm@usa.net.sprynet.com>
Subject: Help with file test operator problem
Message-Id: <6u0fcs$4bp$1@juliana.sprynet.com>

There is something wrong with this script and I can't find it. What it is
supposed to do is open a directory. Read the files in it. then if it is a
normal file replace it's listing within the array I have the files stored in
to "delete" for some reason it can not tell if the file is a file or not. I
think there is something wrong with the file test operator, but I don't know
for sure. Any help here is apprecieated. Thank you.


$Dirname = ("C:/Daniel~1/song_b~1");

unless (opendir (OPENMAINDIR, $Dirname))
       {die "Could not open main directory";}

@mainfiles   = readdir (OPENMAINDIR);
@mainfiles   = sort(@mainfiles);
$numberfiles = @mainfiles;

close (OPENMAINDIR);


$testvar = 0;
while ($testvar < $numberfiles)
   {$file = @mainfiles[$testvar];
    if (-f $file)
       {@mainfiles[$testvar] = ("delete");
       }
    $testvar = ($testvar + 1);
   }

$testvar = 0;
while ($testvar < $numberfiles)
   {print @mainfiles[$testvar];
    print "\n";
    $testvar = ($testvar + 1);
   }




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

Date: 19 Sep 1998 10:49:11 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Help with file test operator problem
Message-Id: <6u0g97$oei$1@monet.op.net>

In article <6u0fcs$4bp$1@juliana.sprynet.com>,
Knight <knight_storm@usa.net> wrote:
>$Dirname = ("C:/Daniel~1/song_b~1");
>unless (opendir (OPENMAINDIR, $Dirname))
>       {die "Could not open main directory";}
>@mainfiles   = readdir (OPENMAINDIR);
>   {$file = @mainfiles[$testvar];
>    if (-f $file)

Suppose $file contains `fred'.  Then `-f $file' looks for `fred' in
the *current* directory; this is just what you should expect.

If you want to look to see if there is a `fred'  in some other
directory, you must say so.  One way:

     if (-f "$Dirname/$file") 


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

Date: Sat, 19 Sep 1998 06:55:11 -0500
From: Chocolate <poohba@io.com>
Subject: How do I implement perl with javascript or vice versa?
Message-Id: <Pine.BSF.4.02A.9809190638490.28728-100000@dillinger.io.com>

I am not sure it this is the right group or not.  I want to set a cookie.
I do this best with perl CGI but I know it can be done with JavaScript.
The situation:
I have this page that you have to log into.  There is a flat file with
your username and a password that you made up along with some other
information.  Once logged in your username is put into another file that
says that you are online now.  It also gives you access to other parts of
the page.  Now if you close the browser then your cookie is unset and you
would have to log back in later but your name is still in the file that
says that you are still here.  If you log out by clicking logout then you
are removed from the file before you are logged out.  What I want to do is
something like: onUnload logout.cgi.  How do I do this?

	      *		Web Page Designs	  *
	    <  poohba@io.com  |  www.io.com/~poohba >
	      *		  (919)599-5543		  * 
		




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

Date: 19 Sep 1998 08:42:27 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: How do I take @_ and set it to $foo?
Message-Id: <6tvqpj$37l@mozo.cc.purdue.edu>

Vince Padua <vpadua@csufresno.edu> writes:
}Disclaimer : Newbie.
}How do I take a integer say 1234567.123456789 that is in @_ and put it
}in $foo?

They sure have some weird integers at fresno.

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: Wed, 16 Sep 1998 23:03:58 +0200
From: Marco Orlandi <marooo@tin.it>
Subject: How to produce a compiled file
Message-Id: <360027BE.3E6401D9@tin.it>

I would like to avoid the Perl interpreter overhead, so I would like to
know how I can SAFELY compile my scripts and produce an executable file.

thank you



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

Date: Thu, 17 Sep 1998 09:38:05 +0200
From: Alessandro Forghieri <alf@orion.it>
Subject: Re: How to produce a compiled file
Message-Id: <3600BC5D.32EDD097@orion.it>

Grretings

Marco Orlandi wrote:
> 
> I would like to avoid the Perl interpreter overhead, so I would like to
> know how I can SAFELY compile my scripts and produce an executable file.

Tje answer to your question is in perlfaq3: How can I make my program
run faster?

I believe the perl compiler is included in the 5.005.x distribution.
Cheers,
	Alessandro


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

Date: 19 Sep 1998 11:59:10 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to produce a compiled file
Message-Id: <6u06ae$qln$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, Marco Orlandi <marooo@tin.it> writes:
:I would like to avoid the Perl interpreter overhead, 

Repeat after me: YOU CANNOT DO THAT.  

:so I would like to
:know how I can SAFELY compile my scripts and produce an executable file.

That's a FAQ.  Happy reading.

--tom
-- 


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

Date: Sat, 19 Sep 1998 10:06:16 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Interesting method technique: Default $self
Message-Id: <1dfk5a4.6dpy0e1jzjy6wN@slip166-72-108-61.ny.us.ibm.net>

Mark-Jason Dominus <mjd@plover.com> wrote:

>       package DB;

What's this code doing in the debugger package?
        
>       sub new {
>         ...
>       }
>       
>       { my $the_db;
>         sub the_db {
>           return $the_db if $the_db;
>           my $pack = shift;
>           $the_db = $pack->new();
>         }
>       }
>       
>       sub query {
>         my $self = shift;
>         $self = $self->the_db unless ref $self; # This is the magic
>         ...
>       }

I'd do something like this:

package db;

$DObj = undef;

sub new {
  ....
}

sub instance {
  my ($something) = @_;
  if (ref $something) {
    return $something;
  } else {
    return $DObj = $something->new;
  }
}

sub query {
  my ($ob, $query) = @_;
  my $self = $ob->instance;

  ...
}

-- 
  Kevin Reid.      |         Macintosh.
   "I'm me."       |      Think different.


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

Date: Sat, 19 Sep 1998 12:50:17 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Module download problem
Message-Id: <slrn707dre.4m.alastair@calliope.demon.co.uk>

nguyen.van@imvi.bls.com <nguyen.van@imvi.bls.com> wrote:
>Hi guys,
>
>I tried to download "GetDate" module,but get problem when "make test".
>Following is the error message.
>
>PERL_DL_NONLAZY=1 /usr/bin/perl -I./blib/arch -I./blib/lib
>-I/opt/lib/perl5/sun4-solaris/5.00404 -I/opt/lib/perl5 -e 'use Test::Harness
>qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
>t/getdate...........WARNING: Date::GetDate requires Date::Parse for years >=
>2000 at blib/lib/Date/GetDate.pm line 10. Can't locate Date/Parse.pm in @INC
> ...

Well, if you read the message you might take a wild guess that you need to
install 'Date::Parse'.

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: Sat, 19 Sep 1998 15:08:55 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <bOPM1.856$Ge.2187567@ptah.visi.com>

In comp.lang.java.programmer Andrew Johnson <ajohnson@gpu.srv.ualberta.ca> wrote:
: George Reese wrote:

:> It is not beauty that I am arguing is goodness--it is structure that
:> is goodness.  Certainly not any structure, but structure that enables
:> one to accomplish any functionality they wish without compromising the
:> structure of the whole.  Perl does not do that.  Python does.

: if you can't write stuctured code that's not Perl's fault. Perl allows
: freedom, 'programmer, enable thyself!' ... (or choose a language that
: chooses your enablement (sic) for you).

I have already stated that freedom has no place in programming.  Now
you may disagree with it, and I have certainly provided support for
that assertion.  It therefore makes no sense to come back with freedom
to counter that argument.  You may want to try explaining why a
programmer should have freedom.

-- 
George Reese (borg@imaginary.com)       http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
   "Keep Ted Turner and his goddamned Crayolas away from my movie."
			    -Orson Welles


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

Date: Sat, 19 Sep 1998 15:05:24 +0200
From: Eyal Moshe <eyal@infomall.co.il>
Subject: Problems running Perlshop on my NT 
Message-Id: <3603AC14.E95B3FDA@infomall.co.il>

Hi all..

I'm having problems running Perlshop, free shopping cart software, on my

system. When I run it I get the message:

    "Invalid Transmission #3 received from: 209.88.180.2
     If your connection was interrupted, you must Enter the shop from
the beginning again."

209.88.180.2 is my IP.. I'm not sure if I've configured the perl script
and especially the paths well. If anyone works with Perlshop in NT and
can help me or maybe even send me his configuration file (actually the
perl script itself) I'll be VERY thankful.

If you know some other free shopping cart for NT, I'd love to hear about

it.

Thanks in advance,

Eyal Moshe



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

Date: Sat, 19 Sep 1998 12:49:59 GMT
From: mike@w3z.com (Mike Collins)
Subject: Ques: read data from pipe
Message-Id: <3604a7b9.34602828@news.110.net>

Can someone offer a simple example of a perl script receiving a
message piped from .procmailrc? 

I assume perl reads from STDIN and am curious about which perldoc to
reference and what module(s) to use, if any.



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

Date: Sat, 19 Sep 1998 11:05:46 GMT
From: mwoog@pobox.ch (Marc-A. Woog)
Subject: Re: Removing double entries from array
Message-Id: <36038fbb.881281@news.datacomm.ch>

On Fri, 18 Sep 1998 16:38:08 -0500, tadmc@metronet.com (Tad McClellan)
wrote:

>Marc-A. Woog (mwoog@pobox.ch) wrote:
>
>: I am quite new to Perl and I have a "How-to-do-better"-Question:
[snipped]
>Yours is a Frequently Asked Question.
>
>Shame on you for asking it yet again.
[snipped]

And I am very, very ashamed. I hope one question of that kind is
allowed once per year?

Marc

-- 
Marc-A. Woog
mwoog@pobox.ch
http://www.dtc.ch/mwoog/


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

Date: 16 Sep 1998 04:45:17 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: script: scriptMangle!
Message-Id: <6tnfot$e2o$1@marina.cinenet.net>

Elaine -HappyFunBall- Ashton (eashton@bbnplanet.com) wrote:
: Craig Berry wrote:
: [responding to Tom C.]
: > I happen to be in sympathy with your general free software approach.  I
: > just wish you'd stop attacking strawmen when criticizing the non-free
: > approach(es).
: 
: I don't see that as attacking. To make Perl 'unreadable' is almost
: blasphemy.

Perl's a tool.  We use it to do work.  It can be made unreadable, and that
may be useful in some tasks.  No moral dimension, just another technique
to apply when (or if) it's needed.

: Also, to assume that your code is safer by making it cryptic
: is certainly a misconception proven to be wrong over years of
: cryptographic history, e.g. purple, enigma, etc.

With this I disagree.  Cryptic code is not 'safe' in the absolute sense,
but it's certainly *safer*, in the same sense that my house is safer if
the front door's locked.

: You have a choice to
: either sell it with a license leaving you legal recourse or give it
: away.

Or shroud the source, or compile it, or...  All these techniques are real,
practical solutions to real-world problems.

: 'Codae Obscurae' is sort of, well, pointless, unless you are
: sending the plans for WWIII encoded in music encoded in Perl. :)  

OK, let me ask you, as I have Tom:  Do you lock your front door at home?

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "Ripple in still water, when there is no pebble tossed,
       nor wind to blow..."


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

Date: Sat, 19 Sep 1998 11:21:27 -0400
From: JG <mitochon@hotmail.com>
Subject: Symbol Tables, executing code from external files while running in another?
Message-Id: <3603CBF7.6541@hotmail.com>

Hello,
	I'm trying to store modular pieces of code in many different
files. I'm trying to make it so that I can have certain files
inherit some properties and methods from other files, but I need to 
be able to import packages from these external files into a separate
package in the current file. After using the package, I would want to
discard it completely for the next package to be loaded into that same
space. Example:

File A may at one point need to execute only the code contained in 
'package whatever;' of File B. At another point during the same
execution of the perl interpreter, File A may need to run code from a
package in File C.

Does anyone know if there is a way to do this without creating .pm
modules which must reside in the lib directories. I want to make this
portable and not require changing of anyone's lib dirs in any way. I've
looked at TOM, but couldn't find many examples of it and wasn't sure if
it would do what I want.
Thanks,
JG


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

Date: 19 Sep 1998 10:54:42 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: what good is flock $LOCK_NB?
Message-Id: <6u0gji$ofc$1@monet.op.net>

In article <3603211D.9EDCF0D@freewwweb.com>,
Sam Wang  <samwang@freewwweb.com> wrote:
>what good is just checking if it's locked or not? sound's kinda useless to me.

Suppose you have a program that needs to perform several tasks, one of
whick involves access to a file which might be locked.  If the file is
locked, you can have the program perform some other task and then
check again later.  If you didn't use LOCK_NB, it would just sit
around waiting and doing nothing until the file became unlocked.

For example, consider a network service whose function is to accept
requests from the network to modify some sort of database.  More than
one instance of this program might be running at a certain time.  The
program gets a request to change the database.  If it uses LOCK_NB to see
if the database is locked, it can set a timer, continue to accept
messages over the network, and write all the changes at once sometime
later when the file is unlocked.  If it does not  use LOCK_NB, then it
will be unable to continue to service network requests while it is
waiting for the file to be unlocked.



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

Date: Sat, 19 Sep 1998 15:28:33 +0100
From: Guenther Pewny <gp@gpsoft.de>
Subject: Re: what's wrong with win32 perl ?
Message-Id: <3603BF91.6BB56654@gpsoft.de>



John Smith schrieb:

> I still couldn't compile modules under win32.
> So far, I have tried four different versions of perl5,
> include ActiveState perl. They all complained about
> xsubpp. Is it my windows setting or the unsolved problem of win32 perl ?
> Please help.
> If anybody have a binary version of HTML::Embperl
> module, could you please email me ?
> Thanks,
> dc@fcc.gov

  Hi,

I'dont know about the other perl versions, but within ActiveState I've tried to make
out the reason why the modules don't compile.

In AS, there is a (not included in standard perl) special handling for accessing global
perl objects from extension modules. Its purpose is to share the globals between
many extensions without reloading them (sorry, I don't know *exactly* how this
mechanism works). So far as I know, there is a spechial "PerlObj" object (C++),
which contains all the globals, which are normally accessed directly from the
extensions. It seems the extensions under Win32 have to use this object instead,
and all the "normal" extensions don't do this.

Looking at "XSUB.h", you find that the use of this object is controlled by the compiler
option "PERL_OBJECT", which causes "objXSUB.h" to be included.
Furthermore, there is "XSlock.h", which inclusion can be controlled by the option
"NO_XSLOCKS". It seems to contain a special locking mechanism shared access
under Win32, which is not included in standard perl.

I've experimented with these options, but without success.

Another possibility could be the use of "perlCAPI.h", controlled by "PERL_CAPI".
I will try this.

In "perl.h", you find an explanation of how the "PerlObj" mechanism works.

Perhaps someone knows more details about porting modules to Win32 perl
or makes out how all the things mentioned above work *exactly*.

G|nther Pewny




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

Date: Sat, 19 Sep 1998 03:04:52 -0700
From: antony quintal <antony@fabric8.nospam.com>
Subject: Re: where is Date::Parse?
Message-Id: <360381C4.BB25EF25@fabric8.nospam.com>

Andrew Johnson wrote:

> [danger:ajohnson:~]$ perl -MCPAN -e shell
> 
> cpan shell -- CPAN exploration and modules installation (v1.40)
> ReadLine support enabled


wow. that's some good fish. thanks!

antony

-- 
   8888
 888  888   
888    888  :::::::::::::::::::::::
 888  888   http://www.fabric8.com
   8888     san francisco
 888  888   415.487.9702
888    888  :::::::::::::::::::::::
 888  888   
   8888


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

Date: Sat, 19 Sep 1998 15:04:10 GMT
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: where is Date::Parse?
Message-Id: <6u0h4r$ft7@flatland.dimensional.com>

Russ Allbery <rra@stanford.edu> writes:

> Michael Fuhr <mfuhr@dimensional.com> writes:
>
> > I'll have to assume you didn't see my response, in which I gave the
> > poster two URLs where one could search for "Date::Parse" and find out
> > where it is (TimeDate).
>
> In at least the CPAN URL, this piece of information is not at all obvious.
> I've been using Perl for years, I have patches in Perl's core
> distribution, I have modules on CPAN, and I *often* have difficulty
> finding Date::Parse when I haven't looked for it for a while and forgot
> where it was.

Searching the CPAN URL for Date::Parse gives me two hits, the first of
which indeed isn't very helpful:

  Date::Parse - Converts date strings into Unix time values. (A Unix time
  value is the number of seconds since January 1, 1970.) 
      Local copy (only if this is a CPAN site!)
      Copy from somewhere else 

Clicking the link takes me to modules/by-module/Date, where one doesn't
find anything looking like "Date::Parse".  Okday, dead end.  Let's
go back and continue the search:

  The TimeDate Bundle - Contains Date::Format, Date::Language, Date::Parse,
  and Time::Zone. See their individual listings for further details. 
      Local copy (only if this is a CPAN site!)
      Copy from somewhere else 

Looks like a winner.  Clicking the link takes me to modules/by-module/Time,
where I find TimeDate-*.tar.gz.

Now let's try the reference.perl.com link and search for Date::Parse:

  Date::Parse 
  Converts date strings into Unix time values. (A Unix time value is
  the number of seconds since January 1, 1970.)

  TimeDate Bundle 
  Contains Date::Format, Date::Language, Date::Parse, and Time::Zone. 

We find the same two links as above.  Again, following the first isn't
helpful but taking the second gets us what we're looking for.  I also
often forget where Date::Parse is, but as we've seen, it isn't too
difficult to find it again.

A request to other module authors that would make things easier:  If
your module requires another module such as Date::Parse that isn't on
CPAN under its own name, please indicate where we can find it.

> > If, on the other hand, you did see my post and considered it to be
> > unhelpful because it didn't contain The Answer, then all I can say is:
>
> >     Give a man a fish and he eats for a day.
> >     Teach a man to fish and he eats for a lifetime.
>
> You don't have to keep the man starving while you teach him to fish, you
> know.  It doesn't help you teach him any better and tends to just make him
> resentful of fishermen.

With the information I provided the man shouldn't starve.  He might go
hungry a little longer, but that should provide him the motivation to
learn how to fish for himself.  In my experience (which admittedly may
differ from yours), if you throw somebody a fish whenever he asks for
it he'll just keep coming back to you for more fish.  At some point
you're going to have to refuse him, and now you've got an even bigger
case of resentment.

-- 
Michael Fuhr
http://www.fuhr.net/~mfuhr/


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

Date: 19 Sep 1998 18:46:16 +0300
From: jari.aalto@poboxes.com (Jari Aalto+mail.perl)
Subject: Where is perldelta that describes new features in 5.005?
Message-Id: <ptr3e9o5cmv.fsf@olkikukka.i-have-a-misconfigured-system-so-shoot-me>



	Hi, [CC is fine]

	Would someone send me the perldelta of 5.005 or show me
	a pointer to it. No 5.005 tgz pointer thank you :-)


	jari


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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