[30944] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2189 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Feb 7 03:09:43 2009

Date: Sat, 7 Feb 2009 00:09: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           Sat, 7 Feb 2009     Volume: 11 Number: 2189

Today's topics:
        Date/Time module <fake@phony.invalid>
    Re: Date/Time module <tim@burlyhost.com>
    Re: Date/Time module <fake@phony.invalid>
    Re: Date/Time module <tim@burlyhost.com>
    Re: Date/Time module <tadmc@seesig.invalid>
    Re: Date/Time module <fake@phony.invalid>
    Re: Date/Time module <fake@phony.invalid>
    Re: Date/Time module <tim@burlyhost.com>
    Re: Date/Time module (Mordechai T. Abzug)
        Extracting functions from C/C++ using Perl, would like  sln@netherlands.com
    Re: FAQ 4.76 How do I verify a credit card checksum? sln@netherlands.com
    Re: FAQ 4.76 How do I verify a credit card checksum? (Randal L. Schwartz)
        new CPAN modules on Sat Feb  7 2009 (Randal Schwartz)
        Reducing log size <XXjbhuntxx@white-star.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 06 Feb 2009 17:35:08 -0700
From: Shawn N Blank <fake@phony.invalid>
Subject: Date/Time module
Message-Id: <rhjpo4ppgtrduv35hd2ei5d6mq9d2bjr7k@4ax.com>

Searching for 'date' on CPAN gives too many results.

What (lightweight) date/time manipulation module do you recommend?

I've used DateTime -- wonderfully comprehensive, but awfully heavy and
bloated. I'm using it in an inetd launched server that is trapped on
an ancient PII -- moving it is not an option; users are complaining
about the long load times.

Thanks,
Shawn


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

Date: Fri, 06 Feb 2009 16:50:51 -0800
From: Tim Greer <tim@burlyhost.com>
Subject: Re: Date/Time module
Message-Id: <MV4jl.36$Qn1.30@newsfe19.iad>

Shawn N Blank wrote:

> Searching for 'date' on CPAN gives too many results.
> 
> What (lightweight) date/time manipulation module do you recommend?
> 
> I've used DateTime -- wonderfully comprehensive, but awfully heavy and
> bloated. I'm using it in an inetd launched server that is trapped on
> an ancient PII -- moving it is not an option; users are complaining
> about the long load times.
> 
> Thanks,
> Shawn

What sort of functions/features are you looking for in a module?  What
are you using the current module for now?  Are you sure the long load
times are related to this module now and the functions you're using?
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Fri, 06 Feb 2009 18:40:56 -0700
From: Shawn N Blank <fake@phony.invalid>
Subject: Re: Date/Time module
Message-Id: <k3npo4pgikoqtpiuctmn8lp0de5vshf0ei@4ax.com>

On Fri, 06 Feb 2009 16:50:51 -0800, Tim Greer <tim@burlyhost.com>
wrote:

>What sort of functions/features are you looking for in a module?  What
>are you using the current module for now?  Are you sure the long load
>times are related to this module now and the functions you're using?

I need date-parameters after time/date addition and subtraction. No
parsing. Functions like 'What day of the week is four hour from now?'
'What month/day was it 394 hours ago? What year will it be 234 days
after that?'

Commenting out 'use DataTime;' and exiting before the first date using
bit gets me a (useless) response in ~2 secs. Running that first
DateTime instansiation/calculation, then exiting, pushes that back to
~6 secs.

Memory is the big problem. Constant swapping... Rampant management
fear of opening the box with the ancient irreplacable custom ISA
card...

--
Shawn


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

Date: Fri, 06 Feb 2009 17:59:49 -0800
From: Tim Greer <tim@burlyhost.com>
Subject: Re: Date/Time module
Message-Id: <qW5jl.499$AC1.93@newsfe24.iad>

Shawn N Blank wrote:

> On Fri, 06 Feb 2009 16:50:51 -0800, Tim Greer <tim@burlyhost.com>
> wrote:
> 
>>What sort of functions/features are you looking for in a module?  What
>>are you using the current module for now?  Are you sure the long load
>>times are related to this module now and the functions you're using?
> 
> I need date-parameters after time/date addition and subtraction. No
> parsing. Functions like 'What day of the week is four hour from now?'
> 'What month/day was it 394 hours ago? What year will it be 234 days
> after that?'
> 
> Commenting out 'use DataTime;' and exiting before the first date using
> bit gets me a (useless) response in ~2 secs. Running that first
> DateTime instansiation/calculation, then exiting, pushes that back to
> ~6 secs.
> 
> Memory is the big problem. Constant swapping... Rampant management
> fear of opening the box with the ancient irreplacable custom ISA
> card...
> 
> --
> Shawn

Would you mind posting some of the code in question?  The differences
shouldn't be that dramatic, at least I'd not think they should be.  I'm
sure people wouldn't mind offering suggestions and providing ideas and
benchmarking them, including for the current module.  Something more
efficient for your needs might also be suggested and possible (I don't
personally know of any, since my needs for date/time functions have
never been so involved that I needed to use a feature-rich module for
that purpose), but I'm betting that your current code could be improved
a bit.  It's not that I've not used such modules on some projects, but
I never recall seeing such a significant impact.  It's certainly
possible the calculations don't lend themselves to a super efficient
way, but I'm betting they do.
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Fri, 6 Feb 2009 20:46:38 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Date/Time module
Message-Id: <slrngoptge.v8u.tadmc@tadmc30.sbcglobal.net>

Shawn N Blank <fake@phony.invalid> wrote:
> On Fri, 06 Feb 2009 16:50:51 -0800, Tim Greer <tim@burlyhost.com>
> wrote:
>
>>What sort of functions/features are you looking for in a module?  What
>>are you using the current module for now?  Are you sure the long load
>>times are related to this module now and the functions you're using?


> Functions like 'What day of the week is four hour from now?'

    my $now = time;

    my @wday = qw/Sun Mon Tues Wed Thu Fri Sat/;
    my $now4 = $wday[ (localtime $now + 4 * 60 * 60)[6] ];
    print "$now4 four hours from now.\n";


> 'What month/day was it 394 hours ago? 

    my($day, $mon) = (localtime $now - 394 * 60 * 60)[3,4];
    $mon++;
    print "$mon/$day was 394 hours ago\n";


> What year will it be 234 days
> after that?'

    my $that = $now - 394 * 60 * 60;
    my $year = (localtime $that + 234 * 24 * 60 * 60)[5] + 1900;
    print "$mon/$day + 234 days will be the year $year\n";

:-)


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Fri, 06 Feb 2009 20:01:28 -0700
From: Shawn N Blank <fake@phony.invalid>
Subject: Re: Date/Time module
Message-Id: <sispo450ruuh30gi84trlarg0dsvijldni@4ax.com>

On Fri, 06 Feb 2009 17:59:49 -0800, Tim Greer <tim@burlyhost.com>
wrote:

>Would you mind posting some of the code in question?  The differences
>shouldn't be that dramatic, at least I'd not think they should be.

~$ time perl -e'1'

real    0m0.171s
user    0m0.040s
sys     0m0.003s

~$ time perl -MDateTime -e'$d=DateTime->now()'

real    0m3.192s
user    0m1.704s
sys     0m0.080s

Slow computer, too little memory -- swapping to make room for the the
~3.5MB that DateTime wants just to load. It all adds up.

Date::Simple is looking tolerable. It does most of what I need (DST
shouldn't screw me up *too* often) and saves 2.5MB/2secs. 

Still open to suggestions/impressions/experiences with other modules.

--
Shawn


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

Date: Fri, 06 Feb 2009 20:07:37 -0700
From: Shawn N Blank <fake@phony.invalid>
Subject: Re: Date/Time module
Message-Id: <hfupo4h5rmte1vhrigbmjucc7981hgvg1l@4ax.com>

On Fri, 6 Feb 2009 20:46:38 -0600, Tad J McClellan
<tadmc@seesig.invalid> wrote:

>localtime ...
>
>:-)

Yeah, if I have too. 

I'd rather be lazy and re-use someone else's hard work.

--
Shawn


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

Date: Fri, 06 Feb 2009 20:57:11 -0800
From: Tim Greer <tim@burlyhost.com>
Subject: Re: Date/Time module
Message-Id: <Iw8jl.245$0v.154@newsfe17.iad>

Shawn N Blank wrote:

> On Fri, 6 Feb 2009 20:46:38 -0600, Tad J McClellan
> <tadmc@seesig.invalid> wrote:
> 
>>localtime ...
>>
>>:-)
> 
> Yeah, if I have too.
> 
> I'd rather be lazy and re-use someone else's hard work.
> 
> --
> Shawn

You just did above, no need for the heavy module if it's really causing
a significant load or time delay. :-)
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Sat, 7 Feb 2009 07:51:41 +0000 (UTC)
From: morty@sanctuary.arbutus.md.us (Mordechai T. Abzug)
Subject: Re: Date/Time module
Message-Id: <gmjeid$gjq$1@news.motzarella.org>

In article <sispo450ruuh30gi84trlarg0dsvijldni@4ax.com>,
"Shawn N Blank " <fake@phony.invalid> spake thusly:

> Slow computer, too little memory -- swapping to make room for the the
> ~3.5MB that DateTime wants just to load. It all adds up.

Then instead of starting up for each connection via inetd, make it a
standalone daemon.  It's not hard to do, and should eliminate most of
the startup cost.

Or just upgrade your hardware to something that isn't so desperately
tight.

- Morty


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

Date: Fri, 06 Feb 2009 23:09:47 GMT
From: sln@netherlands.com
Subject: Extracting functions from C/C++ using Perl, would like Code Review Help if possible
Message-Id: <f6gpo4d0o8s7575ugdu7atfmjqoant25d8@4ax.com>

First installment.
This was inspired by some other post on here.
I was wondering if I could get a review of my preliminary.
I need constructive critque's.

Thank you!
- sln

## ===============================================
## C_FunctionParser_v1.pl
## -------------------------------
## C/C++ Style Function Parser
##  Idea - To parse out C/C++ style functions
##  that have parenthetical closures (some don't).
##  (Could be a package some day, dunno, maybe ..)
##  - sln  ***  @  2/6/09
## ===============================================
my $VERSION = 1.0;
$|=1;

use strict;
use warnings;

# Prototype's
  sub Find_Function(\$\@);

# File-scoped variables
  my ($FxParse,$FName,$Preamble);

# Set default function name
  SetFunctionName();

## ----------------------
## Main (user play area)
## ----------------------

# Source file
   my $Source = join '', <DATA>;

# Extended, possibly non-compliant, function name - pattern examples:
#  SetFunctionName(qr/_T/);
#  SetFunctionName(qr/\(\s*void\s*\)\s*function/);
#  SetFunctionName("\\(\\s*void\\s*\\)\\s*function");


# Parse some functions
   # func ...
    my @Funct = ();
    Find_Function($Source, @Funct);
   # func2 ...
    my @Funct2 = ();
    SetFunctionName(qr/_T/);
    Find_Function($Source, @Funct2);


# Print @Funct functions found
# Note that segments can be modified and collated.
   if (!@Funct) {
	print "Function name pattern: '$FName' not found!\n";
   } else {
	print "\nFound ".@Funct." matches.\nFunction pattern: '$FName' \n";
   }
   for my $ref (@Funct) {
	printf "\n\@: %6d - %s\n", $$ref[3], substr($Source, $$ref[0], $$ref[2] - $$ref[0]);
   }

## ----------
## End Main
## ----------


# ---------------------------------------------------------

# Set the parser's function regex pattern
#
sub SetFunctionName
{
	if (!@_) {
		$FName = "_*[a-zA-Z][\\w]*"; # Matches all compliant function names (default)
	} else {
		$FName = shift;
	}
	$Preamble   = "\\s*\\(";

	# Compile function parser regular expression
	  # Regex condensed:
	  # $FxParse = qr!/{2}.*?\n|/\*.*?\*/|\\.|'["()]'|(")|($FName$Preamble)|(\()|(\))!s;
	  #                        |               |       |1 1|2               2|3  3|4  4
	  # Note - Non-Captured, matching items, are meant to consume!
	  # -----------------------------------------------------------
	  # Regex /xpanded (with commentary):
	  $FxParse =                      # Regex Precedence (items MUST be in this order):
	    qr!                           # -----------------------------------------------
	         /{2}.*?\n  |             # comment - // + anything + end of line
	         /\*.*?\*/   |            # comment - /*  + anything + */
	         \\.       |              # escaped char - backslash + ANY character
	         '["()]'    |             # single quote char - quote then one of ", (, or ), then quote
	         (")       |              # capture $1 - double quote as a flag
	         ($FName$Preamble) |      # capture $2 - $FName + $Preamble
	         (\()  |                  # capture $3 - ( as a flag
	         (\))                     # capture $4 - ) as a flag
	  !xs;
}

# Recursive procedure that finds C/C++ style functions
# (the engine)
# Notes:
#   - This is not a syntax checker !!!
#   - Nested functions are found recursively, but the search is still streamed and single pass.
#   - Parenthetical closures are determined via counter that persists in recursion.
#   - This precedence avoids all ambigous paranthetical open/close conditions:
#       1. Dual comment styles.
#       2. Escapes.
#       3. Single quoted characters.
#       4. Double quotes, fip-flopped to determine closure.
#   - Improper closures are reported, index removed from the stack and processing continues
#     (this would be a syntax error, ie: the code won't complie, but it is reported as a closure error).
#
sub Find_Function(\$\@)
{
	my ($src,$Funct,$offset,$pos,$Ndx,$Lines) = @_;

	my ($closure,$dquotes,$aref,$misc) = (1,0,[],1);
	$pos    = 0 if (!defined $pos);
	$offset = 0 if (!defined $offset);
	$Ndx    = $aref if (!defined $Ndx);
	$Lines  = \$misc if (!defined $Lines);
	pos($$src) = $pos;

	while ($$src =~ /$FxParse/gc)
	{
		if (defined $1)  # double quote "
		{
			$dquotes = !$dquotes;
		}
		next if ($dquotes);

		if (defined $2)  # 'function name'
		{
			# ------------------------------------
			# Placeholder for exclusions......
			# ------------------------------------

			# Cache the current function index
			  push  @$Ndx, scalar(@$Funct);
			  my ($funcpos, $parampos) = ( $-[0], pos($$src) );

			# Get newlines since last function
			  $$Lines += substr ($$src, $offset, $funcpos - $offset) =~ tr/\n//;
			  # print $$Lines,"\n";

			# Save positions:   function(   parms     )
			  push  @$Funct  ,  [$funcpos, $parampos, 0, $$Lines];

			# Recurse this procedure
			  ($offset, pos($$src)) = &Find_Function ( $src, $Funct, $funcpos, $parampos, $Ndx, $Lines );
		}
		elsif (defined $3)  # '('
		{
			++$closure;
		}
		elsif (defined $4)  # ')'
		{
			--$closure;
			if ($closure <= 0)
			{
				$closure = 0;
				if (@$Ndx)
				{
					# Pop index stack, assign closure, return function/closure positions
					  $$Funct[pop @$Ndx][2] = pos($$src);
					  return ($offset, pos($$src));
				}
			}
		}
	}

	# To test an error, either take off the closure of a function in its source,
	# or force it this way (but is pseudo error, make sure you have data in @$Funct):
	# push @$Ndx, 1;

	# Should only get here once.
	# Its an error if index stack has elements
	if (@$Ndx)
	{
		## BAD RETURN ... take this one off, try to recover
		  my $func_index = pop @$Ndx;
		  my $ref = $$Funct[$func_index];
		  $$ref[2] = $$ref[1];
		  print STDERR "** Bad return, index = $func_index\n";
		  print "** Error! Unclosed function [$func_index], line ".
		     $$ref[3].": '".substr ($$src, $$ref[0], $$ref[2] - $$ref[0] )."'\n";
	}
	return ($offset, pos($$src));
}

__DATA__



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

Date: Sat, 07 Feb 2009 03:13:29 GMT
From: sln@netherlands.com
Subject: Re: FAQ 4.76 How do I verify a credit card checksum?
Message-Id: <e0vpo45irc13h55r9menkokj4h6ra0cdep@4ax.com>

On Fri, 6 Feb 2009 18:03:02 -0800, PerlFAQ Server <brian@stonehenge.com> wrote:

>This is an excerpt from the latest version perlfaq4.pod, which
>comes with the standard Perl distribution. These postings aim to 
>reduce the number of repeated questions as well as allow the community
>to review and update the answers. The latest version of the complete
>perlfaq is at http://faq.perl.org .
>
>--------------------------------------------------------------------
>
>4.76: How do I verify a credit card checksum?
>
>    Get the "Business::CreditCard" module from CPAN.

What FAQ worker can I sue for giving this advice?

sln


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

Date: Fri, 06 Feb 2009 22:33:25 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: FAQ 4.76 How do I verify a credit card checksum?
Message-Id: <86skmqpxhm.fsf@blue.stonehenge.com>

>>>>> "sln" == sln  <sln@netherlands.com> writes:

sln> What FAQ worker can I sue for giving this advice?

What usenet poster can I sue for libel?

:-)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


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

Date: Sat, 7 Feb 2009 05:42:24 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sat Feb  7 2009
Message-Id: <KEoL6o.pBD@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

Algorithm-Evolutionary-0.62_2
http://search.cpan.org/~jmerelo/Algorithm-Evolutionary-0.62_2/
Perl extension for performing paradigm-free evolutionary algorithms. 
----
Ante-Deluvian-Dialog-0.02
http://search.cpan.org/~bhm/Ante-Deluvian-Dialog-0.02/
Perl extension for very old style user interaction 
----
App-CPAN2Pkg-0.3.1
http://search.cpan.org/~jquelin/App-CPAN2Pkg-0.3.1/
generating native linux packages from cpan 
----
App-CPAN2Pkg-0.4.0
http://search.cpan.org/~jquelin/App-CPAN2Pkg-0.4.0/
generating native linux packages from cpan 
----
Archive-Extract-0.31_01
http://search.cpan.org/~kane/Archive-Extract-0.31_01/
A generic archive extracting mechanism 
----
CGI-IDS-1.0109
http://search.cpan.org/~hinnerk/CGI-IDS-1.0109/
PerlIDS - Perl Website Intrusion Detection System (XSS, CSRF, SQLI, LFI etc.) 
----
Catalyst-View-Component-SubInclude-0.02
http://search.cpan.org/~nilsonsfj/Catalyst-View-Component-SubInclude-0.02/
Use subincludes in your Catalyst views 
----
Catalyst-View-Component-SubInclude-0.03
http://search.cpan.org/~nilsonsfj/Catalyst-View-Component-SubInclude-0.03/
Use subincludes in your Catalyst views 
----
Catalyst-View-Text-Template-0.001
http://search.cpan.org/~rjbs/Catalyst-View-Text-Template-0.001/
Text::Template views for Catalyst 
----
CatalystX-CMS-0.003
http://search.cpan.org/~karman/CatalystX-CMS-0.003/
drop-in content management system 
----
ClearPress-310
http://search.cpan.org/~rpettett/ClearPress-310/
Simple, fresh & fruity MVC framework 
----
Devel-OnDestruct-0.01
http://search.cpan.org/~leont/Devel-OnDestruct-0.01/
Call a subroutine on destruction of a variable. 
----
EBook-Tools-0.4.2
http://search.cpan.org/~azed/EBook-Tools-0.4.2/
Object class for manipulating and generating E-books 
----
Fey-DBIManager-0.10
http://search.cpan.org/~drolsky/Fey-DBIManager-0.10/
Manage a set of DBI handles 
----
Fey-Loader-0.08
http://search.cpan.org/~drolsky/Fey-Loader-0.08/
Load your schema defintion from a DBMS 
----
File-Scan-ClamAV-1.91
http://search.cpan.org/~jamtur/File-Scan-ClamAV-1.91/
Connect to a local Clam Anti-Virus clamd service and send commands 
----
Finance-Bank-Cahoot-1.04
http://search.cpan.org/~masaccio/Finance-Bank-Cahoot-1.04/
Check your Cahoot bank accounts from Perl 
----
Graphics-Primitive-Driver-Cairo-0.33
http://search.cpan.org/~gphat/Graphics-Primitive-Driver-Cairo-0.33/
Cairo backend for Graphics::Primitive 
----
Graphics-Primitive-Driver-CairoPango-0.51
http://search.cpan.org/~gphat/Graphics-Primitive-Driver-CairoPango-0.51/
Cairo/Pango backend for Graphics::Primitive 
----
HTML-FormHandler-0.14
http://search.cpan.org/~gshank/HTML-FormHandler-0.14/
form handler written in Moose 
----
HTTP-Engine-0.1.1
http://search.cpan.org/~yappo/HTTP-Engine-0.1.1/
Web Server Gateway Interface and HTTP Server Engine Drivers (Yet Another Catalyst::Engine) 
----
IO-Pty-Easy-0.05
http://search.cpan.org/~doy/IO-Pty-Easy-0.05/
Easy interface to IO::Pty 
----
LEOCHARRE-Class2-1.16
http://search.cpan.org/~leocharre/LEOCHARRE-Class2-1.16/
----
LedgerSMB-API-0.01
http://search.cpan.org/~hesco/LedgerSMB-API-0.01/
The great new LedgerSMB::API! 
----
Lemonldap-Config-Parameters-3.2.3
http://search.cpan.org/~egerman/Lemonldap-Config-Parameters-3.2.3/
Backend of configuration for lemonldap SSO system 
----
Lemonldap-Handlers-Generic-3.5.7
http://search.cpan.org/~egerman/Lemonldap-Handlers-Generic-3.5.7/
Perl extension for Lemonldap sso system 
----
Log-Dispatch-Gtk2-Notify-0.01
http://search.cpan.org/~flora/Log-Dispatch-Gtk2-Notify-0.01/
send log messages to a desktop notification daemon 
----
Mail-SPF-Iterator-1.06
http://search.cpan.org/~sullr/Mail-SPF-Iterator-1.06/
iterative SPF lookup 
----
Module-Load-0.16
http://search.cpan.org/~kane/Module-Load-0.16/
runtime require of both modules and files 
----
MooseX-Attribute-Prototype-0.05
http://search.cpan.org/~ctbrown/MooseX-Attribute-Prototype-0.05/
Borrow and Extend Moose Attrtibutes 
----
MouseX-ConfigFromFile-0.02
http://search.cpan.org/~masaki/MouseX-ConfigFromFile-0.02/
An abstract Mouse role for setting attributes from a configfile 
----
MouseX-Getopt-0.04
http://search.cpan.org/~masaki/MouseX-Getopt-0.04/
A Mouse role for processing command line options 
----
MouseX-Log-Dispatch-Config-0.04
http://search.cpan.org/~masaki/MouseX-Log-Dispatch-Config-0.04/
A Mouse role for logging 
----
MouseX-Types-DateTime-0.02
http://search.cpan.org/~masaki/MouseX-Types-DateTime-0.02/
A DateTime type library for Mouse 
----
MouseX-Types-URI-0.02
http://search.cpan.org/~masaki/MouseX-Types-URI-0.02/
A URI type library for Mouse 
----
Net-DNS-ZoneFile-Fast-1.1
http://search.cpan.org/~hardaker/Net-DNS-ZoneFile-Fast-1.1/
parse BIND8/9 zone files 
----
Net-LastFM-Submission-0.3
http://search.cpan.org/~sharifuln/Net-LastFM-Submission-0.3/
Perl interface to the Last.fm Submissions Protocol 
----
Net-SCP-Expect-0.16
http://search.cpan.org/~rybskej/Net-SCP-Expect-0.16/
Wrapper for scp that allows passwords via Expect. 
----
POE-Component-SmokeBox-Recent-1.12
http://search.cpan.org/~bingos/POE-Component-SmokeBox-Recent-1.12/
A POE component to retrieve recent CPAN uploads. 
----
Parallel-SubFork-0.06_02
http://search.cpan.org/~potyl/Parallel-SubFork-0.06_02/
Manage Perl functions in forked processes. 
----
Pigment-0.01
http://search.cpan.org/~flora/Pigment-0.01/
User interfaces with embedded multimedia 
----
Provision-Unix-0.44
http://search.cpan.org/~msimerson/Provision-Unix-0.44/
provision accounts on unix systems 
----
Rose-DB-Object-0.778
http://search.cpan.org/~jsiracusa/Rose-DB-Object-0.778/
Extensible, high performance object-relational mapper (ORM). 
----
SQL-Statement-1.19
http://search.cpan.org/~rehsack/SQL-Statement-1.19/
SQL parsing and processing engine 
----
Set-Relation-0.4.0
http://search.cpan.org/~duncand/Set-Relation-0.4.0/
Relation data type for Perl 
----
Statistics-Descriptive-Weighted-0.4
http://search.cpan.org/~dhard/Statistics-Descriptive-Weighted-0.4/
Module of basic descriptive statistical functions for weighted variates. 
----
Storable-AMF-0.52
http://search.cpan.org/~grian/Storable-AMF-0.52/
Perl extension for serialize/deserialize AMF0/AMF3 data 
----
Sys-Mmap-Simple-0.12
http://search.cpan.org/~leont/Sys-Mmap-Simple-0.12/
Memory mapping made simple and safe. 
----
Test-WWW-Mechanize-JSON-0.1
http://search.cpan.org/~lgoddard/Test-WWW-Mechanize-JSON-0.1/
Adds a JSON method to WWW::Mechanize::Test 
----
Test-WWW-Mechanize-JSON-0.2
http://search.cpan.org/~lgoddard/Test-WWW-Mechanize-JSON-0.2/
add a JSON method to the super-class 
----
Time-Progress-1.5
http://search.cpan.org/~cade/Time-Progress-1.5/
Elapsed and estimated finish time reporting. 
----
Tkx-FindBar-0.09
http://search.cpan.org/~mjcarman/Tkx-FindBar-0.09/
Perl Tkx extension for an incremental search toolbar 
----
Tkx-ROText-0.06
http://search.cpan.org/~mjcarman/Tkx-ROText-0.06/
Tkx text widget that supports a read-only state. 
----
WWW-Search-Rambler-0.04
http://search.cpan.org/~arto/WWW-Search-Rambler-0.04/
class for searching http://www.rambler.ru. 
----
WWW-WhoCallsMe-0.02
http://search.cpan.org/~wilsond/WWW-WhoCallsMe-0.02/
Query WhoCallsMe.com for details about a caller's phone number 
----
WebService-Etsy-0.1
http://search.cpan.org/~imalpass/WebService-Etsy-0.1/
Access the Etsy REST API. 
----
WebService-Etsy-0.2
http://search.cpan.org/~imalpass/WebService-Etsy-0.2/
Access the Etsy REST API. 
----
WebService-Etsy-0.3
http://search.cpan.org/~imalpass/WebService-Etsy-0.3/
Access the Etsy REST API. 
----
WebService-Google-Language-0.09
http://search.cpan.org/~hma/WebService-Google-Language-0.09/
Perl interface to the Google AJAX Language API 
----
XML-LibXML-1.69_2
http://search.cpan.org/~pajas/XML-LibXML-1.69_2/
Perl Binding for libxml2 
----
XML-Writer-Simple-0.02
http://search.cpan.org/~ambs/XML-Writer-Simple-0.02/
Create XML files easily! 
----
ex-lib-0.04
http://search.cpan.org/~mons/ex-lib-0.04/
The same as lib, but makes relative path absolute. 
----
minismokebox-0.14
http://search.cpan.org/~bingos/minismokebox-0.14/
a small lightweight SmokeBox 


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
  http://www.stonehenge.com/merlyn/LinuxMag/col82.html

print "Just another Perl hacker," # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


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

Date: Sat, 07 Feb 2009 05:53:44 GMT
From: Cosmic Cruizer <XXjbhuntxx@white-star.com>
Subject: Reducing log size
Message-Id: <Xns9BAADE75B44Fccruizermydejacom@207.115.33.102>

I searched, but could not find suggestions on reducing the size of log 
files on Windows. Truncate did not work since it keeps to top portion of 
the log. I did not try to use tail.

Now that I wrote something that does what I want... what is a cleaner way 
of doing this?

### Manage logfile size ###
sub getLogFile {
  use File::Copy "move";
  my $max_line_count = 50000;   # Number of lines for replaced file
  my $max_file_size = 3000000;  # Maximum logfile size
  my $size = (stat("$log"))[7]; # Get current logfile size
  my $x;                        # Incrementer for counter

  if($size > $max_file_size) {
    # Get the number of lines in the logfile
    open my $in,  '<',  $log    or die "cannot open $log: $!";
      1 while <$in>;
      my $lines = $.;
    close $in;

    # Number of preceding lines to ignore (not copy)
    my $target_size = $lines - $max_line_count;

    # Open to read old log and write new temp log
    open my $out,  '>>',  "TEMP.txt" or die "cannot open TEMP.txt: $!";
    open my $in,  '<',  $log    or die "cannot open $log: $!";
      while (<$in>){
        $x+=1;
        print $out $_ if($x > $target_size);
      }
      print $out "\n$time_stamp\tFile size truncated\n\n";
    close $in;
    close $out;

    # Replace old logfile and clean up temp
    unlink $log;
    move ("TEMP.txt", "$log");
    unlink "TEMP.txt";
  }
}


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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V11 Issue 2189
***************************************


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