RE: How to generate unique log file names for cron?

2006-08-09 Thread siegfried
I'm using cygwin on windows and it does not have logrotate. Hmmm... I see my SuSE has logrotate but that does not help me. -Original Message- From: John W. Krahn Sent: Wednesday, August 09, 2006 5:07 PM To: Perl Beginners Subject: Re: How to generate unique log file names for cron? siegf

Re: How to generate unique log file names for cron?

2006-08-09 Thread John W. Krahn
siegfried wrote: > I have daily cron jobs that clobber their old log files everyday. > > How can I automate keeping the last 3 log files and delete the oldest one > everyday? Are you using logrotate(8)? man logrotate John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PR

Re: How to generate unique log file names for cron?

2006-08-09 Thread Joshua Colson
On Wed, 2006-08-09 at 16:34 -0600, siegfried wrote: > I have daily cron jobs that clobber their old log files everyday. > > How can I automate keeping the last 3 log files and delete the oldest one > everyday? > If you're using a UNIX-like OS, why not just use logrotate? -- Joshua Colson <[EMA

How to generate unique log file names for cron?

2006-08-09 Thread siegfried
I have daily cron jobs that clobber their old log files everyday. How can I automate keeping the last 3 log files and delete the oldest one everyday? Is this a job for bash or perl? I've tried to fabricate a unique log file name inside of "crontab -e" with `date` but the backtick trick does not

Re: Converting Perl Script to Module

2006-08-09 Thread Owen Cook
> Does anyone know of any resources to aid in this? > > I have a few scripts which I am trying to turn into modules, however > the functions which run as a script (CGI) do not run as modules > > Any help etc Have a look at these as they may help; http://www.pcug.org.au/~rcook/PerlModule_HOWTO.h

Re: reading line by line

2006-08-09 Thread John W. Krahn
Octavian Rasnita wrote: > > Thank you very much for your suggestion. It works, but unfortunately very > very slow. > > If I put the data after __DATA__ and read , it works very fast, but if > I create a $text var that holds the same data then open(DATA, "<", \$text), > it works more than 100 time

Re: reading line by line

2006-08-09 Thread John W. Krahn
Octavian Rasnita wrote: > Hi, Hello, > I have a program that contains a pretty big block of text: > > my $text = < line1 > line2 > ... > line 12 > EOF > > I want to read this block of text line by line and analyse each line without > needing to create a big array that contains all these lin

Re: reading line by line

2006-08-09 Thread Mumia W.
On 08/09/2006 11:15 AM, Octavian Rasnita wrote: Hi, I have a program that contains a pretty big block of text: my $text = <), but the program contains 2 blocks of text. Is there a solution for this? There are two solutions I can think of. You can open an "in memory" variable (see perldoc -

Re: reading line by line

2006-08-09 Thread Octavian Rasnita
From: "Rob Dixon" <[EMAIL PROTECTED]> > > I have a program that contains a pretty big block of text: > > > > my $text = < > line1 > > line2 > > ... > > line 12 > > EOF > > > > I want to read this block of text line by line and analyse each line without > > needing to create a big ar

Re: reading line by line

2006-08-09 Thread Jay Savage
On 8/9/06, Rob Dixon <[EMAIL PROTECTED]> wrote: In Perl 5.8 and onwards you can read directly from the string as if it were a file by just opening with a scalar reference instead of a filname. That seems to be exactly what you want. HTH, Rob use strict; use warnings; die "Too old a versio

Re: reading line by line

2006-08-09 Thread Rob Dixon
Octavian Rasnita wrote: > Hi, > > I have a program that contains a pretty big block of text: > > my $text = < line1 > line2 > ... > line 12 > EOF > > I want to read this block of text line by line and analyse each line without > needing to create a big array that contains all these lines (exac

Re: Access MDF files

2006-08-09 Thread Mike Blezien
- Original Message - From: "Timothy Johnson" <[EMAIL PROTECTED]> To: "Mike Blezien" <[EMAIL PROTECTED]>; "Peter Hoose" <[EMAIL PROTECTED]>; "Perl List" Sent: Wednesday, August 09, 2006 11:14 AM Subject: RE: Access MDF files Have you taken a look at the DBI documentation? my $sth =

reading line by line

2006-08-09 Thread Octavian Rasnita
Hi, I have a program that contains a pretty big block of text: my $text = <), but the program contains 2 blocks of text. Is there a solution for this? Thank you. Octavian -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Access MDF files

2006-08-09 Thread Timothy Johnson
Have you taken a look at the DBI documentation? my $sth = $dbh->prepare('SELECT * FROM Table'); $sth->execute(); while(my $row = $sth->fetchrow_hashref()){ my $name = $row->{NAME}; } -Original Message- From: Mike Blezien [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 09, 2006 9:

Re: Access MDF files

2006-08-09 Thread Mike Blezien
Thx's Peter. Is there a way or simple means of just extracting the data from the mdb files so we can import it into a MySQL database, something like a dump file or similar ? Mike - Original Message - From: "Mike Blezien" <[EMAIL PROTECTED]> To: "Perl List" Sent: Wednesday, August 09

Re: Access MDF files

2006-08-09 Thread Peter Hoose
- Original Message - From: "Mike Blezien" <[EMAIL PROTECTED]> To: "Perl List" Sent: Wednesday, August 09, 2006 11:20 AM Subject: Access MDF files Hello, is there a Perl module available to obtain data from Access .mdf files ? thx's Mike(mickalo)Blezien -- To unsubscribe, e-mail: [

Access MDF files

2006-08-09 Thread Mike Blezien
Hello, is there a Perl module available to obtain data from Access .mdf files ? thx's Mike(mickalo)Blezien -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Converting Perl Script to Module

2006-08-09 Thread Mike Martin
On 09/08/06, Beginner <[EMAIL PROTECTED]> wrote: On 9 Aug 2006 at 14:28, Mike Martin wrote: > Does anyone know of any resources to aid in this? > > I have a few scripts which I am trying to turn into modules, however > the functions which run as a script (CGI) do not run as modules > > Any help

Re: Writing to XML using XML::Writer

2006-08-09 Thread Robin Norwood
"Nath, Alok (STSD)" <[EMAIL PROTECTED]> writes: > Hi, > Can anybody give me a simple code snippet which writes or > modifies this xml ? > > > > Tom > Aug 2006 > > > Dicken > Aug 2006 >

Re: Header ("Location")

2006-08-09 Thread WCJ d/b/a http://ccsh.us/
On 8/9/06, Umar Draz <[EMAIL PROTECTED]> wrote: > Please give me the link where i can read about that You can see a HTTP Response Code summary here: http://dw.ccsh.us/doku.php?id=http -- WC (Bill) Jones -- http://youve-reached-the.endoftheinternet.org/ -- To unsubscribe, e-mail: [EMAIL PROTE

Re: Header ("Location")

2006-08-09 Thread WCJ d/b/a http://ccsh.us/
On 8/9/06, Umar Draz <[EMAIL PROTECTED]> wrote: Please give me the link where i can read about that http://www.w3.org/Protocols/ http://www.ietf.org/rfc/rfc2616.txt http://search.cpan.org/perldoc?HTTP::Response http://www.anomaly.org/wade/projects/httptest/HTTPtest.html http://www.faqs.org/faqs

RE: Converting Perl Script to Module

2006-08-09 Thread Venkat Saranathan
Mike, I am not sure if I had understood your question correctly. If you're trying to run modules directly in Perl, it won't work. Modules are like dlls/libraries and they provide functionality to the executables (.pl files in Perl). So after writing the modules (.pm), you should write a script

Re: Converting Perl Script to Module

2006-08-09 Thread Beginner
On 9 Aug 2006 at 14:28, Mike Martin wrote: > Does anyone know of any resources to aid in this? > > I have a few scripts which I am trying to turn into modules, however > the functions which run as a script (CGI) do not run as modules > > Any help etc This sounds like a job for modperl. Persuma

Converting Perl Script to Module

2006-08-09 Thread Mike Martin
Does anyone know of any resources to aid in this? I have a few scripts which I am trying to turn into modules, however the functions which run as a script (CGI) do not run as modules Any help etc -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Trouble simplifying hash of array access

2006-08-09 Thread Smith, Jim R
Try this: @[EMAIL PROTECTED]'EST'}}; print $info[3]; regards, jimbob __ -Original Message- From: n[ate]vw [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 08, 2006 1:12 PM To: beginners@perl.org Subject: Trouble simplifying hash of array

Writing to XML using XML::Writer

2006-08-09 Thread Nath, Alok (STSD)
Hi, Can anybody give me a simple code snippet which writes or modifies this xml ? Tom Aug 2006 Dicken Aug 2006 I want to read and write into

Re: Can't count array in hash in array

2006-08-09 Thread Rob Dixon
James Marks wrote: > > Down, near the bottom of this example code (marked), I'm trying to count > the number of elements of an array which is the value of a key in a hash > which is, itself, an element of an array. So far, I've been unsuccessful > and I'm stumped as to what to try next. > > Help?

Re: Can't count array in hash in array

2006-08-09 Thread John W. Krahn
James Marks wrote: > Down, near the bottom of this example code (marked), I'm trying to count > the number of elements of an array which is the value of a key in a hash > which is, itself, an element of an array. So far, I've been unsuccessful > and I'm stumped as to what to try next. > > Help? >

Re: Creating Directories on Windows

2006-08-09 Thread Rob Dixon
Omega -1911 wrote: > > I recently decided to host a site on one of my machines (Win XP, > Active State 5.8.8) for testing a couple of scripts since my host > objects to installing a few modules. Anyway, can someone explain why > the following code will create directories and the the code below it

Re: Can't count array in hash in array - correx

2006-08-09 Thread James Marks
On Aug 9, 2006, at 12:59 AM, Beginner wrote: Are you using this $subdirectory_count = $web_sites_directory_tree[$i]{subdirectory}; or this. my $subdirectory_count = @{$web_sites_directory_tree[$i]{subdirectory} }; print "SUB= $subdirectory_count\n"; Because the first outputs: SUB= array(

Re: Can't count array in hash in array - correx

2006-08-09 Thread Beginner
On 9 Aug 2006 at 0:54, James Marks wrote: > > On Aug 9, 2006, at 12:33 AM, James Marks wrote: > > > Down, near the bottom of this example code (marked), I'm trying to > > count the number of elements of an array which is the value of a key > > in a hash which is, itself, an element of an array

Re: Can't count array in hash in array - correx

2006-08-09 Thread James Marks
On Aug 9, 2006, at 12:33 AM, James Marks wrote: Down, near the bottom of this example code (marked), I'm trying to count the number of elements of an array which is the value of a key in a hash which is, itself, an element of an array. So far, I've been unsuccessful and I'm stumped as to what

Re: Can't count array in hash in array

2006-08-09 Thread James Marks
On Aug 9, 2006, at 12:40 AM, Beginner wrote: On 9 Aug 2006 at 0:33, James Marks wrote: Ohh ohh. I think I know this (they'll flame me if I'm wrong). Is it? use strict; use warnings; my $no_dirs = @{ $web_sites_directory_tree[$i]{subdirectory} }; I tried that (including strict/warnings

Re: Can't count array in hash in array

2006-08-09 Thread Beginner
On 9 Aug 2006 at 0:33, James Marks wrote: Ohh ohh. I think I know this (they'll flame me if I'm wrong). Is it? use strict; use warnings; my $no_dirs = @{ $web_sites_directory_tree[$i]{subdirectory} }; I hope I'm right..fingers crossed. Dp. > # COUNT NUMBER OF DIRECTORIES - (THIS WORKS)

Can't count array in hash in array

2006-08-09 Thread James Marks
Down, near the bottom of this example code (marked), I'm trying to count the number of elements of an array which is the value of a key in a hash which is, itself, an element of an array. So far, I've been unsuccessful and I'm stumped as to what to try next. Help? my @web_sites_directory_tree