[23744] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5949 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 17 14:05:40 2003

Date: Wed, 17 Dec 2003 11:05:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 17 Dec 2003     Volume: 10 Number: 5949

Today's topics:
        ANNOUNCE: File::Slurp-9999.02 <uri@stemsystems.com>
        Announcing File::Finder 0.01 (Randal L. Schwartz)
        Announcing File::Finder 0.01 (Randal L. Schwartz)
    Re: Creating a list of HASHes <asu1@c-o-r-n-e-l-l.edu>
    Re: encrypt email address to a string (G Klinedinst)
    Re: Indigo httpd.conf - mod_perl.so cannot be loaded <dwall@fastmail.fm>
    Re: Indigo httpd.conf - mod_perl.so cannot be loaded <asu1@c-o-r-n-e-l-l.edu>
        PAR error <linh@chello.no>
    Re: Passing a hash by reference (G Klinedinst)
    Re: Passing a hash by reference <morecoffeeplease@yahoo.com>
    Re: Passing a hash by reference <uri@stemsystems.com>
        Please critique this short script that scans a log file <jwngaa@att.net>
    Re: Please critique this short script that scans a log  <nobull@mail.com>
    Re: Please critique this short script that scans a log  <dwall@fastmail.fm>
    Re: Please critique this short script that scans a log  <uri@stemsystems.com>
    Re: Q about a module containing more than one class <xxala_qumsiehxx@xxyahooxx.com>
    Re: Q about a module containing more than one class <kevin@vaildc.net>
    Re: RegExp check for nothing or pattern <djo@pacifier.com>
    Re: RegExp to match pattern or BLANK? <djo@pacifier.com>
    Re: Return all points with x km of y (Off-topic) <dwall@fastmail.fm>
    Re: Starting Perl Script at Bootup <usenet@morrow.me.uk>
    Re: Upload directory from browser <gary@tgpmakers.com>
        What CPU/Memory does a Wait cost? <test@test.com>
    Re: What CPU/Memory does a Wait cost? <nobull@mail.com>
    Re: What CPU/Memory does a Wait cost? <jgibson@mail.arc.nasa.gov>
        Win32API::Net::UserAdd parameter in hash question (ThERiZla)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 17 Dec 2003 15:45:56 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: ANNOUNCE: File::Slurp-9999.02
Message-Id: <Hq1rKF.tuB@zorch.sf-bay.org>


File::Slurp-9999.02 is up on cpan. one new feature (atomic spewing), 1
little bug fix, 2 new tests and it now passes all tests on OSX (and i
found a perl bug there). the pod is updated to reflect the changes.

9999.02  Wed Dec 17 03:40:49 EST 2003
	- skip DATA test in handle.t on OSX (bug in perl with sysread on DATA)
	- changed checking if file handle from fileno to ref
		from Randal Schwartz <merlyn@stonehenge.com>
	- added support for atomic spewing
	- added new test stdin.t for the fileno/ref change
	- added new test inode.t to test atomic spewing

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org




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

Date: 17 Dec 2003 08:33:32 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Announcing File::Finder 0.01
Message-Id: <867k0vjter.fsf@blue.stonehenge.com>

*** post for FREE via your newsreader at post.newsfeed.com ***


Now coming to a CPAN near you, File::Finder, a nice wrapper around
File::Find, with a much more find(1)-like syntax than File::Find::Rule,
which can be both a blessing and a curse. :)

From the synopsis:

         use File::Finder;
         ## simulate "-type f"
         my $all_files = File::Finder->type('f');

         ## any rule can be extended:
         my $all_files_printer = $all_files->print;

         ## traditional use: generating "wanted" subroutines:
         use File::Find;
         find($all_files_printer, @starting_points);

         ## or, we can gather up the results immediately:
         my @results = $all_files->in(@starting_points);

         ## -depth and -follow are noted, but need a bit of help for find:
         my $deep_dirs = File::Finder->depth->type('d')->ls->exec('rmdir','{}');
         find($deep_dirs->as_options, @places);

A few other interesting examples from the manpage:

             my $big_or_old = File::Finder
               ->type('f')
               ->left
                 ->size("+100")->or->mtime("+90")
               ->right;
             find($big_or_old->ls, "/tmp");


             my $files = File::Finder->type('f');
             # find files that are exactly mode 644
             my $files_644 = $files->perm(0644);
             # find files that are at least world executable:
             my $files_world_exec = $files->perm("-1");
             # find files that have some executable bit set:
             my $files_exec = $files->perm("+0111");

             my $blaster = File::Finder->atime("+30")->eval(sub { unlink });

             my $old = File::Finder->atime("+30");
             my $big = File::Finder->size("+100");
             my $old_or_big = File::Finder->eval($old)->or->eval($big);
             my $killer = File::Finder->eval(sub { unlink });
             my $kill_old_or_big = File::Finder
               ->eval($old_or_big)->ls->eval($killer);
             $kill_old_or_big->in('/tmp');

It's functional, but not tested completely.  I have tests for the
mechanism, but not for the individual file tests (except ->eval).
I'm writing up an article for this module for The Perl Journal's
January 2004 issue, and feedback is welcome.

I believe the code is cleaner and faster and easier to extend than
File::Find::Rule. I'm not intending to slight Richard Clamp's work in
the slightest.... I just wanted to take a different approach to the
interface and engine and like the results.

print "Just another Perl hacker,"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


 -----= Posted via Newsfeed.Com, Uncensored Usenet News =-----
http://www.newsfeed.com - The #1 Newsgroup Service in the World!
-----== 100,000 Groups! - 19 Servers! - Unlimited Download! =-----
                  


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

Date: Wed, 17 Dec 2003 16:33:32 GMT
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Announcing File::Finder 0.01
Message-Id: <Hq1sw7.9pw@zorch.sf-bay.org>


Now coming to a CPAN near you, File::Finder, a nice wrapper around
File::Find, with a much more find(1)-like syntax than File::Find::Rule,
which can be both a blessing and a curse. :)

>From the synopsis:

         use File::Finder;
         ## simulate "-type f"
         my $all_files = File::Finder->type('f');

         ## any rule can be extended:
         my $all_files_printer = $all_files->print;

         ## traditional use: generating "wanted" subroutines:
         use File::Find;
         find($all_files_printer, @starting_points);

         ## or, we can gather up the results immediately:
         my @results = $all_files->in(@starting_points);

         ## -depth and -follow are noted, but need a bit of help for find:
         my $deep_dirs = File::Finder->depth->type('d')->ls->exec('rmdir','{}');
         find($deep_dirs->as_options, @places);

A few other interesting examples from the manpage:

             my $big_or_old = File::Finder
               ->type('f')
               ->left
                 ->size("+100")->or->mtime("+90")
               ->right;
             find($big_or_old->ls, "/tmp");


             my $files = File::Finder->type('f');
             # find files that are exactly mode 644
             my $files_644 = $files->perm(0644);
             # find files that are at least world executable:
             my $files_world_exec = $files->perm("-1");
             # find files that have some executable bit set:
             my $files_exec = $files->perm("+0111");

             my $blaster = File::Finder->atime("+30")->eval(sub { unlink });

             my $old = File::Finder->atime("+30");
             my $big = File::Finder->size("+100");
             my $old_or_big = File::Finder->eval($old)->or->eval($big);
             my $killer = File::Finder->eval(sub { unlink });
             my $kill_old_or_big = File::Finder
               ->eval($old_or_big)->ls->eval($killer);
             $kill_old_or_big->in('/tmp');

It's functional, but not tested completely.  I have tests for the
mechanism, but not for the individual file tests (except ->eval).
I'm writing up an article for this module for The Perl Journal's
January 2004 issue, and feedback is welcome.

I believe the code is cleaner and faster and easier to extend than
File::Find::Rule. I'm not intending to slight Richard Clamp's work in
the slightest.... I just wanted to take a different approach to the
interface and engine and like the results.

print "Just another Perl hacker,"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



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

Date: 17 Dec 2003 17:48:56 GMT
From: "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
Subject: Re: Creating a list of HASHes
Message-Id: <Xns9454825E92C74asu1cornelledu@132.236.56.8>

jack_luminous@hotmail.com (Patrick Paquet) wrote in 
news:14e35cbb.0312170310.22a6ac66@posting.google.com:

> I'm replying to the original message because both Richard Gration and
> A. Sinan Unur have provided interesting and useful information, I hope
> this isn't a major breach of group etiquette.

I don't think so. Even if it were, you have done enough work to 
compensate for that :)

 ...

> I'm open to suggestions on a different approach.

I would prefer to use references to hashes all around.

> Both Richard Gration and A. Sinan Unur suggested that perhaps I was
> trying to pass %MachineInfo to &EcritureSQL.  This was not the case
> originally, &MachineInfo was meant to contains the existing (if any)

May I suggest dropping the & unless you really need it. (from perldoc 
perlsub:

    &NAME(LIST);   # Circumvent prototypes.
    &NAME;         # Makes current @_ visible to called subroutine.

 ...

> I've modified the code slightly to reflect your suggestions (properly
> scoped variables thru my, and proper formating for easy copy/paste
> execution).

You have not moved all your variables to the smallest possible scope; 
there is still some room for improvment.

> Thanks again for your time and insight.

You are welcome. I am sorry I do not have the time to go through 
everything. I am including below a modified version of your script. I did 
get rid of the comments because they were distracting to me.

I defined a placeholder subroutine called ReadSQL which returns a 
reference to a hash holding the machine information given the machine's 
name. After performing the checks, this reference is then passed on to 
EcritureSQL. Notice the scoping of $Key and $Value in that sub as well as 
the

my $InfosMachine = shift;

line as the first line of the sub. That makes it immediately obvious to 
the reader what the parameters to the sub are. (Compare that to the first 
line of the sub in your version ... which of those variables are 
parameters, which ones are local to the subroutine?)


$ cat t.pl
use strict;
use warnings;
use diagnostics;

my @ListDOM = qw/Machine1 Machine2 Machine3/;

foreach my $Machine (@ListDOM)  {
    my $CheckMachine = 0;
    my $MachineInfo = ReadSQL('dummy', $Machine);
    if ($MachineInfo->{MachineName} ne $Machine) {
        $CheckMachine = 1;
        print "$Machine n'existe pas dans la base.($CheckMachine)\n";
    }
    my $ValeurCle = 123456;
    if ($MachineInfo->{Valeur_CiPatches} != $ValeurCle) {
        $CheckMachine = 1;
        print "$Machine: valeur cle differente.($CheckMachine)\n";
    }
    my ($Ping, $ReverseLookup, $AdresseIP) = ('OK', 'OK', '10.10.10.10');

   if ($MachineInfo->{IP_address} ne $AdresseIP) {
       $CheckMachine = 1;
       print "$Machine: adresse IP differente.($CheckMachine)\n";
   }
   
   if ($CheckMachine == 0) {
       print "Base a jour pour $Machine, machine suivante...\n\n";
   } else {
       print "Checks values on workstation...\n\n";
       EcritureSQL($MachineInfo);
   }
}

sub EcritureSQL {
   my $InfosMachine = shift;

   while (my ($Key, $Value) = each %$InfosMachine) {
       print "Key: $Key \->Value: $Value\n";
   }
   my $Pause = <STDIN>;
}

sub ReadSQL {
    my ($ConnectionSQL, $Machine) = @_;
    return {
        MachineName => $Machine,
        Valeur_CiPatches => 0,
        IP_address => '10.10.10.10',
    };
}
__END__

$ perl t.pl
Machine1: valeur cle differente.(1)
Checks values on workstation...

Key: Valeur_CiPatches ->Value: 0
Key: IP_address ->Value: 10.10.10.10
Key: MachineName ->Value: Machine1

Machine2: valeur cle differente.(1)
Checks values on workstation...

Key: Valeur_CiPatches ->Value: 0
Key: IP_address ->Value: 10.10.10.10
Key: MachineName ->Value: Machine2

Machine3: valeur cle differente.(1)
Checks values on workstation...

Key: Valeur_CiPatches ->Value: 0
Key: IP_address ->Value: 10.10.10.10
Key: MachineName ->Value: Machine3

-- 
A. Sinan Unur
asu1@c-o-r-n-e-l-l.edu
Remove dashes for address
Spam bait: mailto:uce@ftc.gov


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

Date: 17 Dec 2003 09:20:14 -0800
From: g_klinedinst@hotmail.com (G Klinedinst)
Subject: Re: encrypt email address to a string
Message-Id: <168f035a.0312170920.deb08b1@posting.google.com>

"Fengshui" <test@test.com> wrote in message news:<5X1Db.455457$0v4.20982854@bgtnsc04-news.ops.worldnet.att.net>...
> domain rule is as: caseless letters, numbers and -
> 
> username rule is letters. numbers, -, _ and .
> 
> so if I want to covert/encript an email into a letter/number only string,
> how do i do this without adding length to the string? i don't want to just
> exchange ascii code for each one.
If you just want to keep spiders from picking up email addresses I
would simply reverse the string, like Abigail said or remove the
punctuation and replace with something else. Perl's tr or s should
work fine here.

If you want to keep it from prying human eyes, as long as they are
lazy something simple should work.

You don't want to do an even ASCII exchange mapping because you don't
want to access a table like you say in one of your follow ups? You
wouldn't need to even use a table. You could just use a simple
algorithm. Add or subtract some number from your ascii code(make sure
you stay within the bounds of what can be transferred by your medium,
and make a simple escape sequence for illegal characters), then do the
reverse on the flip side.

On the other hand if your issue is that a simple mapping is too easy
and someone could figure it out then I would say you are probably
stuck with increasing the length. I don't see how you could add
complexity using the same number or less of characters and the same
character set, unless the data set had large quantities of repetitive
data which would lend itself to compression. Any mathmaticians want to
advise on this one?

Lastly, I think you are going the wrong direction talking about
converting to a different character set, or encoding using hex. If you
want to represent all usable ASCII characters you are talking a
minimum of 128 characters, and extended ASCII is 256. That means 2
places in hex and 3 in decimal. Then you need to represent that in
"characters" to transfer it, so you are doubling or tripling the size
of the string. In other words, using base-10 or base-16 to represent
base-128 is definately going to make your string longer, since you
will no be transferring integers, you will be transferring characters
which will get implicitly converted back to integers when you use
them.

Let me know if this makes any sense. I am tired and rambling a little.

-GPK


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

Date: Wed, 17 Dec 2003 17:29:17 -0000
From: "David K. Wall" <dwall@fastmail.fm>
Subject: Re: Indigo httpd.conf - mod_perl.so cannot be loaded
Message-Id: <Xns94547F0881CC4dkwwashere@216.168.3.30>

Carsten Aulbert <carsten@welcomes-you.com> wrote:

> Nele Paulsen wrote:
> 
>> What module cannot be found?
> 
> Just a blind guess from my side, since I never ran apache on
> win32: 
> 
> Do you have to use backslashes instead of forward slashes, or does
> apache translate them?
> 
> Sorry if I'm totally wrong

Windows doesn't have a problem with forward slashes in path/filenames.  
AFAIK it's only CMD.EXE that requires backslashes.

To the OP:  please try a newsgroup devoted to web servers, as this has 
nothing to do with Perl (even though Apache is bundled with Indigo 
Perl).  I'd suggest comp.infosystems.www.servers.ms-windows.  You're 
more likely to get a useful answer there.

-- 
David Wall


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

Date: 17 Dec 2003 18:17:18 GMT
From: "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
Subject: Re: Indigo httpd.conf - mod_perl.so cannot be loaded
Message-Id: <Xns9454872DFD45Dasu1cornelledu@132.236.56.8>

"David K. Wall" <dwall@fastmail.fm> wrote in 
news:Xns94547F0881CC4dkwwashere@216.168.3.30:

> AFAIK it's only CMD.EXE that requires backslashes.

Well, at least with Win XP Pro, there does not seem to be such a 
requirement:

C:\Home> c:/perl/bin/perl -v

This is perl, v5.8.1 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2003, Larry Wall

-- 
A. Sinan Unur
asu1@c-o-r-n-e-l-l.edu
Remove dashes for address
Spam bait: mailto:uce@ftc.gov


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

Date: Wed, 17 Dec 2003 19:15:24 +0100
From: ngoc <linh@chello.no>
Subject: PAR error
Message-Id: <Dc1Eb.6851$Y06.108041@news4.e.nsc.no>

Hi
I install PAR "perl Makefile.PL"

Error:
Fetching 'PAR-0.76_98-sun-solaris-5.6.1.par from ftp.cpan.org...Bad file 
number
Fetching failed:
No compiler found, won't generate 'cript/parl'

I do 'which gcc' it can locate to my new gcc. So gcc is there. What is 
problem?
Ngoc



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

Date: 17 Dec 2003 09:56:19 -0800
From: g_klinedinst@hotmail.com (G Klinedinst)
Subject: Re: Passing a hash by reference
Message-Id: <168f035a.0312170956.2f7c471f@posting.google.com>

TORE> sub PrintHashEntries {
TORE>     my $rh_hashref = shift;
TORE> 
TORE>     foreach ( keys %$rh_hashref ) {
TORE>         print "\nKey = [$key], value = $rh_hashref->{$_}";
TORE>     }
TORE> }

TORE> sub AddHashEntries {
TORE>     my $rh_hashref = shift;
TORE> 
TORE>     for ( 1..10 ) {
TORE>         my $value = 'value ' . $_;
TORE>         my $key   = 'key' . $_;
TORE>         $rh_hashref->{$key} = $value;
TORE>     }
TORE> }

URI> 	$rh_hashref->{"key$_"} = "value$_" for 1 .. 10 ;

Thank you Uri and Tore for "Perlizing" his code. I also write Perl
code which looks suspiciously like C, so seeing how everyone else does
it is a great help to me. I particularly like the "1..10" and shifting
the first value out of @_ at the beginning of each function...I mean
subroutine.

-Greg


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

Date: Wed, 17 Dec 2003 18:34:58 GMT
From: Toby <morecoffeeplease@yahoo.com>
Subject: Re: Passing a hash by reference
Message-Id: <ml1Eb.5130$FN.4254@newsfep4-winn.server.ntli.net>

On G Klinedinst wrote:
> TORE> sub PrintHashEntries {
> TORE>     my $rh_hashref = shift;
> TORE> 
> TORE>     foreach ( keys %$rh_hashref ) {
> TORE>         print "\nKey = [$key], value = $rh_hashref->{$_}";

surely:
  print "\nKey = [$_], value = $rh_hashref->{$_}";

> TORE>     }
> TORE> }

-- 
print 'Just learning to be another Perl Hacker'


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

Date: Wed, 17 Dec 2003 18:35:45 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Passing a hash by reference
Message-Id: <x7d6ani96n.fsf@mail.sysarch.com>

>>>>> "GK" == G Klinedinst <g_klinedinst@hotmail.com> writes:

  TORE> sub PrintHashEntries {
  TORE> my $rh_hashref = shift;

  TORE> sub AddHashEntries {
  TORE> my $rh_hashref = shift;

  URI> $rh_hashref->{"key$_"} = "value$_" for 1 .. 10 ;

  > Thank you Uri and Tore for "Perlizing" his code. I also write Perl
  > code which looks suspiciously like C, so seeing how everyone else does
  > it is a great help to me. I particularly like the "1..10" and shifting
  > the first value out of @_ at the beginning of each function...I mean
  > subroutine.

well, since you are in a learning mode, i prefer to assign with @_
instead of shift (except where shifting @_ does something important).

	my ( $arg, $foo ) = @_ ;

that style will usually mean fewer lines of code and it is easier to add
more args or slurp the rest with an array or hash:

	my ( $file, %opts ) = @_ ;

but as i said shift has its place there but IMO only when you need to
have a shorter @_ for use later on.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Wed, 17 Dec 2003 10:32:49 -0600
From: J.W. <jwngaa@att.net>
Subject: Please critique this short script that scans a log file
Message-Id: <m211uvcb5omaorajn8lkk5fnolmik8r48t@4ax.com>

I'm new to Perl and wrote a simple script to scan a database log file
with embedded timestamps.  This is similar to scanning other common
text files with timestamped entries such web server utilization logs,
transaction logs, etc.

This script already works correctly and the -w doesn't report any
warnings.  However, I'd like to get any feedback on making it better.
My experience has been with C++ and ksh/awk, so I'm not sure my brain
is solving problems the "Perl" way yet.

The example input file and resultant output file is at the bottom of
this message.

Notes:
-- purposely didn't use Date::Calc (or any other non-standard module)
-- could've used longer regex instead of nested if(regex) {if (regex)}
but avoided it because of NFA regex engine
-- the timestamp regex could've been simplified to /(...) (...) (..)
(..):(..):(..) (....)/ but I deliberately wanted to use character
classes to only extract valid date strings

-----

#!/usr/bin/perl
#
# Read db2uext2.log.NODE0000 and calculate archive copy 
#   durations (in seconds)  between "Time Started" and 
#  "Time Completed"

use strict;

use Time::Local;
use Time::Local 'timegm_nocheck';

my $regex_ctime;
my %MonthIndex;
my $ts1;
my $ts2;
my $ts1_started;
my $ts2_completed;
my $rc;

#                   $1  $2  $3 $4 $5 $6 $7
#Time Started:      Mon Dec 17 13:47:42 2001
#Time Started:      Wed Jul 23 17:35:35 2003 (20030723173535)

$regex_ctime = qr/ (Sun|Mon|Tue|Wed|Thu|Fri|Sat)
(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ([ |0-3][0-9])
([0-2][0-9]):([0-5][0-9]):([0-5][0-9]) ([0-9][0-9][0-9][0-9])/o;

%MonthIndex = (
	"Jan",  0,
	"Feb",  1,
	"Mar",  2,
	"Apr",  3,
	"May",  4,
	"Jun",  5,
	"Jul",  6,
	"Aug",  7,
	"Sep",  8,
	"Oct",  9,
	"Nov", 10,
	"Dec", 11);

while (<>) {
	# chomp;   # not needed for this type of processing
	if (/^Time Started:/) {
		if ($_ =~ $regex_ctime) {
			$ts1_started = timegm($6, $5, $4, $3,
$MonthIndex{$2}, $7);
			$ts1 = "$1 $2 $3 $4:$5:$6 $7";
		}
	}
	if (/^RC\s+:\s+(\d+)/) {   # Return Code
			$rc = $1;
	}
	if (/^Time Completed:/ && defined($ts1_started)) {
		if ($_ =~ $regex_ctime) {
			$ts2_completed = timegm($6, $5, $4, $3,
$MonthIndex{$2}, $7);
			$ts2 = "$1 $2 $3 $4:$5:$6 $7";
			printf("$ts1  $ts2 %4d   %3d\n", $rc ,
($ts2_completed - $ts1_started));
		}
	}
}


-----

#example log file excerpt used as input
********************************************************************************
Time Started:      Mon Dec 17 13:18:12 2001

Parameters Passed:
  db2uext2 -OSAIX -RLSQL07010 -RQARCHIVE -DBKP1 -NNNODE0000
-LP/db2/KP1/db2kp1/NODE0000/SQL00001/SQLOGDIR/ -LNS0007259.LOG
System Action:     ARCHIVE
Target:            DISK
RC           :     0
Time Completed:    Mon Dec 17 13:18:27 2001

********************************************************************************
Time Started:      Mon Dec 17 13:28:01 2001

Parameters Passed:
  db2uext2 -OSAIX -RLSQL07010 -RQARCHIVE -DBKP1 -NNNODE0000
-LP/db2/KP1/db2kp1/NODE0000/SQL00001/SQLOGDIR/ -LNS0007260.LOG
System Action:     ARCHIVE
Target:            DISK
RC           :     654
Time Completed:    Mon Dec 17 13:28:15 2001

********************************************************************************
Time Started:      Mon Dec 17 13:47:42 2001

Parameters Passed:
  db2uext2 -OSAIX -RLSQL07010 -RQARCHIVE -DBKP1 -NNNODE0000
-LP/db2/KP1/db2kp1/NODE0000/SQL00001/SQLOGDIR/ -LNS0007261.LOG
System Action:     ARCHIVE
Target:            DISK
RC           :     0
Time Completed:    Mon Dec 17 13:47:50 2001

********************************************************************************

# example output from the Perl script:
Mon Dec 17 13:18:12 2001  Mon Dec 17 13:18:27 2001    0    15
Mon Dec 17 13:28:01 2001  Mon Dec 17 13:28:15 2001  654    14
Mon Dec 17 13:47:42 2001  Mon Dec 17 13:47:50 2001    0     8



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

Date: 17 Dec 2003 18:18:14 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Please critique this short script that scans a log file
Message-Id: <u9k74vl34p.fsf@wcl-l.bham.ac.uk>

J.W. <jwngaa@att.net> writes:

> I'm new to Perl and wrote a simple script to scan a database log file
> with embedded timestamps.  This is similar to scanning other common
> text files with timestamped entries such web server utilization logs,
> transaction logs, etc.
> 
> This script already works correctly and the -w doesn't report any
> warnings.  However, I'd like to get any feedback on making it better.

Oooh.

First, "use warnings" rather than -w unless you need to run on Perl <5.6


> My experience has been with C++ and ksh/awk, so I'm not sure my brain
> is solving problems the "Perl" way yet.

> The example input file and resultant output file is at the bottom of
> this message.
> 
> Notes:
> -- purposely didn't use Date::Calc (or any other non-standard module)
> -- could've used longer regex instead of nested if(regex) {if (regex)}
> but avoided it because of NFA regex engine
> -- the timestamp regex could've been simplified to /(...) (...) (..)
> (..):(..):(..) (....)/ but I deliberately wanted to use character
> classes to only extract valid date strings

Hmmm... OK I won't criticise that.  (But it's a bad idea).

> -----
> 
> #!/usr/bin/perl
> #
> # Read db2uext2.log.NODE0000 and calculate archive copy 
> #   durations (in seconds)  between "Time Started" and 
> #  "Time Completed"
> 
> use strict;

Add "use warnings"

> use Time::Local;
> use Time::Local 'timegm_nocheck';
> 
> my $regex_ctime;
> my %MonthIndex;
> my $ts1;
> my $ts2;
> my $ts1_started;
> my $ts2_completed;
> my $rc;

Don't declare all your variables up-top, declare them in the smallest
applicable lexical scope as it defeats half the point of having
explicit declaration in the first place.  99% of the time this means
the declaration should be combined with the first assignment.  This
has nothing particular to do with Perl, it applies equally in many
languages including C++.
 
> #                   $1  $2  $3 $4 $5 $6 $7
> #Time Started:      Mon Dec 17 13:47:42 2001
> #Time Started:      Wed Jul 23 17:35:35 2003 (20030723173535)
> 
> $regex_ctime = qr/ (Sun|Mon|Tue|Wed|Thu|Fri|Sat)
> (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ([ |0-3][0-9])
> ([0-2][0-9]):([0-5][0-9]):([0-5][0-9]) ([0-9][0-9][0-9][0-9])/o;

Never use the /o regex qualifier without understanding it.  Since /o
does nothing in the line above I can reasonably assume you don't
understand it. :-)

> %MonthIndex = (
> 	"Jan",  0,
> 	"Feb",  1,
> 	"Mar",  2,
> 	"Apr",  3,
> 	"May",  4,
> 	"Jun",  5,
> 	"Jul",  6,
> 	"Aug",  7,
> 	"Sep",  8,
> 	"Oct",  9,
> 	"Nov", 10,
> 	"Dec", 11);

Consider using the "fat comma" => for readability.

> while (<>) {
> 	# chomp;   # not needed for this type of processing
> 	if (/^Time Started:/) {
> 		if ($_ =~ $regex_ctime) {

IMHO this is better written as

 		if (/$regex_ctime/) {

> 			$ts1_started = timegm($6, $5, $4, $3,
> $MonthIndex{$2}, $7);
> 			$ts1 = "$1 $2 $3 $4:$5:$6 $7";
> 		}

You probably wanted an else clause to do something if Time Started:
wasn't followed by a valid time.

If not you may as well have combined the regex into 

    if ( /^Time Started:\s*$regex_ctime/)

> 	if (/^RC\s+:\s+(\d+)/) {   # Return Code
> 			$rc = $1;
> 	}

Consider using post-condition syntax

  $rc = $1 if /^RC\s+:\s+(\d+)/ # Return Code

> 	if (/^Time Completed:/ && defined($ts1_started)) {

Why are you checking defined($ts1_started)?  Surely if the input was
invalid you'd _want_ your program to crash out or do something.

It is the bane of my life that inexperienced programmers often think
it is a good idea to make a program that continues without comment if
fed invalid data.  Yes, there are times when this makes sense but in
general it is better that a program terminate or emit some sort of
error rather than do something undefined in the case that it is fed
invalid input.  This has nothing to do with Perl.

> 		if ($_ =~ $regex_ctime) {
> 			$ts2_completed = timegm($6, $5, $4, $3,
> $MonthIndex{$2}, $7);
> 			$ts2 = "$1 $2 $3 $4:$5:$6 $7";

This code is a duplication of what you have above.  Whenever you find
yourself writing the same thing twice you should always look to see
how it can be avoided.  This has nothing to do with Perl, it applies
in all programming languages.

In this case you could have captured both started and completed in one
operation and stored the result in a hash.

  if ( /^Time (Started|Completed):\s*($regex_ctime)/ )
        $t{$1} = timegm($8, $7, $6, $5, $MonthIndex{$4}, $9);
        $ts{$1} = $2;
   )
> 			printf("$ts1  $ts2 %4d   %3d\n", $rc ,

Do not compute the format string of printf() unless you
are really are computing a string of printf template elements.
Instead put %s in the format string and put the data to be
interpolated in the argument list.  This has nothing to do with Perl,
it applies equally in all languages with printf().

> ($ts2_completed - $ts1_started));
> 		}
> 	}
> }
> 
> 
> -----
> 
> #example log file excerpt used as input
> ********************************************************************************
> Time Started:      Mon Dec 17 13:18:12 2001
> 
> Parameters Passed:
>   db2uext2 -OSAIX -RLSQL07010 -RQARCHIVE -DBKP1 -NNNODE0000
> -LP/db2/KP1/db2kp1/NODE0000/SQL00001/SQLOGDIR/ -LNS0007259.LOG
> System Action:     ARCHIVE
> Target:            DISK
> RC           :     0
> Time Completed:    Mon Dec 17 13:18:27 2001
> 
> ********************************************************************************


You probably want a line of ******* to make your program clear all
its variables so that if one stanza is missing a particular data item
id does not carry forward from the previouis stanza.


-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Wed, 17 Dec 2003 18:32:51 -0000
From: "David K. Wall" <dwall@fastmail.fm>
Subject: Re: Please critique this short script that scans a log file
Message-Id: <Xns945489CEE4E9Bdkwwashere@216.168.3.30>

J.W. <jwngaa@att.net> wrote:

> I'm new to Perl and wrote a simple script to scan a database log
> file with embedded timestamps.  This is similar to scanning other
> common text files with timestamped entries such web server
> utilization logs, transaction logs, etc.
> 
> This script already works correctly and the -w doesn't report any
> warnings.  However, I'd like to get any feedback on making it
> better. My experience has been with C++ and ksh/awk, so I'm not
> sure my brain is solving problems the "Perl" way yet.

I'm not an especially good teacher*, but I can show you how I might 
have approached it.

(* Or, I suppose, an especially good programmer -- but I have fun.)

> Notes:
> -- purposely didn't use Date::Calc (or any other non-standard
> module) 

Why not use "non-standard" modules?  Date::Parse is pretty handy for 
something like this and cuts out much of the work.


> my $regex_ctime;
> my %MonthIndex;
> my $ts1;
> my $ts2;
> my $ts1_started;
> my $ts2_completed;
> my $rc;

No need to declare everything up front; this isn't C. :-) If you 
haven't already read it, Mark-Jason Dominus' article "Coping with 
Scoping" is a good read: http://perl.plover.com/FAQs/Namespaces.html.  

Oh, and since you already know C you might benefit from perltrap: 
'perldoc perltrap'.

> $regex_ctime = qr/ (Sun|Mon|Tue|Wed|Thu|Fri|Sat)
> (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ([ |0-3][0-9])
> ([0-2][0-9]):([0-5][0-9]):([0-5][0-9]) ([0-9][0-9][0-9][0-9])/o;

Good use of qr() outside your while() loop.

> 
> %MonthIndex = (
>      "Jan",  0,
>      "Feb",  1,
>      "Mar",  2,
>      "Apr",  3,
>      "May",  4,
>      "Jun",  5,
>      "Jul",  6,
>      "Aug",  7,
>      "Sep",  8,
>      "Oct",  9,
>      "Nov", 10,
>      "Dec", 11);

You could have declared the hash and initialized it in the same 
statement if you wanted.  If you used Date::Parse you wouldn't need 
it, though.

[snip rest of program]

With Date::Parse it can be much shorter and -- more importantly -- 
easier to read.


    use strict;
    use warnings;
    use Date::Parse;
    
    my ($ts1, $ts1_started, $rc);
    while (<DATA>) {
        if (/^Time Started:\s+(.*)/) {
            $ts1 = $1; 
            $ts1_started = str2time($1);
        }
        $rc = $1 if /^RC\s+:\s+(\d+)/;
        if (/^Time Completed:\s+(.*)/ and defined $ts1_started) {
            my $ts2 = $1;
            my $ts2_completed = str2time($1);
            printf "$ts1  $ts2 %4d   %3d\n", $rc,
                ($ts2_completed - $ts1_started);
            $ts1 = $ts1_started = $rc = undef;
        }
    }

-- 
David Wall


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

Date: Wed, 17 Dec 2003 18:45:52 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Please critique this short script that scans a log file
Message-Id: <x7ad5ri8ps.fsf@mail.sysarch.com>

>>>>> "JW" == J W <jwngaa@att.net> writes:

  > #!/usr/bin/perl

you said you ran it with -w but where is it now? you should keep it on
even in production code

  > my $regex_ctime;
  > my %MonthIndex;
  > my $ts1;
  > my $ts2;
  > my $ts1_started;
  > my $ts2_completed;
  > my $rc;

declare those where they are first used. in many cases you can assign
the value in the same statement.

  > %MonthIndex = (

my %MonthIndex = (


  > 	"Jan",  0,
  > 	"Feb",  1,
  > 	"Mar",  2,
  > 	"Apr",  3,
  > 	"May",  4,
  > 	"Jun",  5,
  > 	"Jul",  6,
  > 	"Aug",  7,
  > 	"Sep",  8,
  > 	"Oct",  9,
  > 	"Nov", 10,
  > 	"Dec", 11);

  > while (<>) {
  > 	# chomp;   # not needed for this type of processing
  > 	if (/^Time Started:/) {
  > 		if ($_ =~ $regex_ctime) {

$_ is not needed as it is the default var that // will use

also even though that works, marking off the regex with // is better
(and needed if you don't use $_ and =~

	if ( /$regex_ctime/ ) {

  > 			$ts1_started = timegm($6, $5, $4, $3,
  > $MonthIndex{$2}, $7);
  > 			$ts1 = "$1 $2 $3 $4:$5:$6 $7";


having that many grabbed things without names is scary. what if you
change something? it might be better to assign them to a list of vars
and use those:

	if ( my( $var1, $var2, $foo, $blah ) = /$regex_ctime/ ) {

		$ts1_started = timegm($var1, $var2, $foo, $blah, ....


  > 		}
  > 	}
  > 	if (/^RC\s+:\s+(\d+)/) {   # Return Code
  > 			$rc = $1;
  > 	}


  > 	if (/^RC\s+:\s+(\d+)/) {   # Return Code

so you match against $_ here but not earlier. be consistant. and just
assign $rc

	my ( $rc ) = /^RC\s+:\s+(\d+)/ || '' ;

  > 	if (/^Time Completed:/ && defined($ts1_started)) {
  > 		if ($_ =~ $regex_ctime) {
  > 			$ts2_completed = timegm($6, $5, $4, $3,
  > $MonthIndex{$2}, $7);
  > 			$ts2 = "$1 $2 $3 $4:$5:$6 $7";
  > 			printf("$ts1  $ts2 %4d   %3d\n", $rc ,

what if $rc is not assigned? it would make an undefined warning.

  > ($ts2_completed - $ts1_started));
  > 		}
  > 	}
  > }

not too bad for a first script. keep it up. and post others here for
more reviewing

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Wed, 17 Dec 2003 18:01:37 GMT
From: "Ala Qumsieh" <xxala_qumsiehxx@xxyahooxx.com>
Subject: Re: Q about a module containing more than one class
Message-Id: <5S0Eb.72307$nu6.16351@newssvr25.news.prodigy.com>

"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message
news:d583uvomvch5r79qlnpouoh5p3p8o7qfp6@4ax.com...

> I have a class that relies on other classes (as suggested in many
> docs) that are to be used *exclusively* for this, i.e. not as
> standalone classes.
>
> Now I want to put all these classes in the same (separate) module so
> that only the "main" one is made (explicitly) available to the final
> user, and my question is wether there's any convention/direction for
> assigning a name to the "other" classes:

I guess different people would do it differently. I would make is such that
each module is in a separate file, and would name them such that each '::'
in the module name corresponds to a real directory hierarchy. You don't have
to do that of course, but I find it easier to look for files, and understand
what class uses what. Something like this (untested):

$SOME_PATH/cool/module/foo.pm:

  package cool::module::foo;

  sub new { ... }

$SOME_PATH/cool/module.pm:

  package cool::module;
  use lib $SOME_PATH;
  use cool::module::foo;

  sub new { ... }

That will make it easier if you want to use cool::module::foo in some other
class as well.

--Ala




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

Date: Wed, 17 Dec 2003 13:19:22 -0500
From: Kevin Michael Vail <kevin@vaildc.net>
Subject: Re: Q about a module containing more than one class
Message-Id: <kevin-F53EDE.13192217122003@news101.his.com>

In article <d583uvomvch5r79qlnpouoh5p3p8o7qfp6@4ax.com>,
 Michele Dondi <bik.mido@tiscalinet.it> wrote:

> I apologize in advance if this is a bogus question. I'm just starting
> to understand Perl's OO programming.
> 
> I have a class that relies on other classes (as suggested in many
> docs) that are to be used *exclusively* for this, i.e. not as
> standalone classes.
> 
> Now I want to put all these classes in the same (separate) module so
> that only the "main" one is made (explicitly) available to the final
> user, and my question is wether there's any convention/direction for
> assigning a name to the "other" classes:

The DBI module names its subsidiary classes DBI::st and the like. That 
seems like a good idea.  The few times I've done this, I've also given 
the final component a lowercase name.  If a user is debugging a program 
and happens across an object from the subsidiary class (e.g., cursors in 
DBI are DBI::st as noted above), at least they know what module created 
it.
-- 
Found Poetry (_Science News_, 14-Jun-2003): oldest _homo sapiens_ find
+-----------------------------------------+ ocean eddies' far-flung effects;
|  Kevin Michael Vail <kevin@vaildc.net>  | superior threads spun
+-----------------------------------------+ the pox from prairie dogs.


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

Date: Wed, 17 Dec 2003 17:55:55 GMT
From: "David Oswald" <djo@pacifier.com>
Subject: Re: RegExp check for nothing or pattern
Message-Id: <LM0Eb.2680$9s.1130824@news3.news.adelphia.net>


"Eric" <Eric@nowhere.com> wrote :
>
> I want to write a regexp that matches either a blank value or a pattern.
I'm
> checking user data for a 'telephone' field which I want to allow to be
blank
> OR have at least 11 digits.

I posted my answer to your other post entitled: "RegExp to match pattern or
BLANK?"

Why did you post the same question twice with two different subject lines?




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

Date: Wed, 17 Dec 2003 17:52:24 GMT
From: "David Oswald" <djo@pacifier.com>
Subject: Re: RegExp to match pattern or BLANK?
Message-Id: <sJ0Eb.2679$9s.1130148@news3.news.adelphia.net>


"Eric" <Eric@nowhere.com> wrote:
>
> I want to write a regexp that matches either a blank value or a pattern.
I'm
> checking user data for a 'telephone' field which I want to allow to be
blank
> OR have at least 11 digits.
>
> I've tried
>
> if ($data =~ m/{0}|\d{11,}/) { etc etc
>
> But it doesn't work
>
> OK I know I can do it with some code, but my system reads regexps from a
> config file and I'd like to keep my system versatile.

m/^(?:\d{11,})?$/

That matches a string consisting optionally of eleven or more digits.  It
will not match a string containing anything else, nor will it match a string
containing any number of digits less than eleven, except for zero digits.

If your phone number contains hyphens or paranthesis, you're going to have
to get more creative.

DaveO





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

Date: Wed, 17 Dec 2003 17:22:28 -0000
From: "David K. Wall" <dwall@fastmail.fm>
Subject: Re: Return all points with x km of y (Off-topic)
Message-Id: <Xns94547DE0CC54Ddkwwashere@216.168.3.30>

Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:

> [A complimentary Cc of this posting was sent to
> Gregory Toomey 
><nospam@bigpond.com>], who wrote in article
><1827589.p7hrWbV6h4@gregs-web-hosting-and-pickle-farming>: 
> 
>> 1. To do the exact calculation of distance given lat & long
>> requires 
>      spherical trigonometry. Over small distances, you can get
>      good local approximate results by knowing the numbeer of km
>      for each unit of latitude & longiture. This varies over the
>      earths surface.
> 
> Bulls.  First of all, the "distance along surface" can be easily
> calculated given the "distance along straight tunnel".  To find
> the latter, one just needs to recalculate from spherical
> coordinates to (x,y.z)-rectangular coordinates: 2 cosines and 2
> sines per point. 

Ok, none of this has anything in particular to do with Perl, so...

There once was a fellow named Lloyd
Whom geography made quite annoyed:
    "I'd thought it was clear
    That the earth was a sphere
Now I find it's an oblate spheroid!"

(Yes, I wrote it.  Please don't hit me.)

-- 
David Wall


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

Date: Wed, 17 Dec 2003 18:52:41 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Starting Perl Script at Bootup
Message-Id: <brq8lp$iks$1@wisteria.csv.warwick.ac.uk>


Andy Lester <andy@petdance.com> wrote:
> > &&  What's the point of posting a misinforming reply like this, Abigail?
> > 
> > 
> > What's the point of asking non-Perl questions in a Perl group?
> 
> To get a useful answer, even if it's not the right place to do it.  Far
> better than a malicious lie.

Malicious, maybe, but hardly a lie. I have yet to come across a kernel
written in Perl :).

Ben

-- 
Like all men in Babylon I have been a proconsul; like all, a slave ... During
one lunar year, I have been declared invisible; I shrieked and was not heard,
I stole my bread and was not decapitated.
~ ben@morrow.me.uk ~                   Jorge Luis Borges, 'The Babylon Lottery'


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

Date: Wed, 17 Dec 2003 16:45:25 +0000
From: Gary Mayor <gary@tgpmakers.com>
Subject: Re: Upload directory from browser
Message-Id: <brq125$h3k$2@news7.svr.pol.co.uk>

Ya right mate there seems no way of doing it might offer the user a 
script to easily zip up there images.

Cheers


Gary Mayor wrote:
> Hi,
> I was hopeing someone could tell me if there is a way to upload a 
> directory to a perl script from the browser. I can do it fine with a 
> file at a time but what about a directory.
> 
> Is this possible
> 
> Thanks
> 
> Gary
> 



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

Date: Wed, 17 Dec 2003 16:40:32 GMT
From: "Reportor" <test@test.com>
Subject: What CPU/Memory does a Wait cost?
Message-Id: <4G%Db.474247$0v4.21331654@bgtnsc04-news.ops.worldnet.att.net>

I want to run a cron job like without using a cron job. Let's say I wrote a
script, and then let it for 1 hour in each for loop. It could be in Perl
(just add a timer) or in unix shell (i don't know how to wait in shell
script)

If I do a "perl script.pl &", and let it just run in the back ground
forever.

I want to know it that will take too much CPU/Memory for the system and got
myself kicked out of the server.




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

Date: 17 Dec 2003 18:19:50 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: What CPU/Memory does a Wait cost?
Message-Id: <u9fzfjl321.fsf@wcl-l.bham.ac.uk>

"Reportor" <test@test.com> writes:

> I want to run a cron job like without using a cron job. Let's say I wrote a
> script, and then let it for 1 hour in each for loop. It could be in Perl
> (just add a timer) or in unix shell (i don't know how to wait in shell
> script)
> 
> If I do a "perl script.pl &", and let it just run in the back ground
> forever.
> 
> I want to know it that will take too much CPU/Memory for the system and got
> myself kicked out of the server.

Ask the server admin.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Wed, 17 Dec 2003 10:57:17 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: What CPU/Memory does a Wait cost?
Message-Id: <171220031057179878%jgibson@mail.arc.nasa.gov>

In article
<4G%Db.474247$0v4.21331654@bgtnsc04-news.ops.worldnet.att.net>,
Reportor <test@test.com> wrote:

> I want to run a cron job like without using a cron job. Let's say I wrote a
> script, and then let it for 1 hour in each for loop. It could be in Perl

-------------------------^ sleep?

> (just add a timer) or in unix shell (i don't know how to wait in shell
> script)

You use the "sleep" command in a shell to put a process to sleep. See
"man sleep".

> 
> If I do a "perl script.pl &", and let it just run in the back ground
> forever.
> 
> I want to know it that will take too much CPU/Memory for the system and got
> myself kicked out of the server.
> 
> 

Your job won't take much CPU time while it is sleeping (assuming that
is what you meant). However, your job will die as soon as you log off
in the terminal session that started the job, unless you use the nohup
command or your job can daemonize itself. Your server's system
administator probably won't like either, in any case. Also your jobs
start time can be shown in the ps command, and your sysadmin may get
suspicious and kill your job after it has been running for a few days.
Your job will also die if the server is rebooted.

Why don't you want to use cron? It avoids all of the above problems.


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

Date: 17 Dec 2003 09:20:18 -0800
From: cool_ian10@hotmail.com (ThERiZla)
Subject: Win32API::Net::UserAdd parameter in hash question
Message-Id: <42f55bd6.0312170920.6af726fd@posting.google.com>

Hi,

I want to create a new user on server with the UserAdd function of the
Win32::Net module.

Someone I have an experience with the differents Use info fields ? 
I initialize the parameter unitsPerWeek to 168 but when I execute the
function I have this message: Bad data for unitsPerWeek.
I check on somes website and all initialize unitPerWeek to 168.

I like to know the definition and explain me this parameter.
If anyone have an example with all parameters initialize of the hash.

Thanks


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 5949
***************************************


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