help in coding LHS

2004-05-28 Thread N, Guruguhan \(GEAE, Foreign National, EACOE\)
Hi All,
  Is there any perl code already existing for Latin Hypercube Sampling 
technique? Any help in this regard is welcome.

Thanks
Regards
Guruguhan


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: The >> operator

2004-05-28 Thread John W. Krahn
"Randy W. Sims" wrote:
> 
> On 5/29/2004 12:28 AM, gohaku wrote:
> > Hi all,
> > I'm not sure if ">>" is an official operator in Perl but I have seen
> > ">>" used in conjunction with
> > HTML code or Long Strings.
> > a google search and perldoc doesn't return any useful information.
> > I am looking for code examples that use ">>".
> 
> It has two uses: 1) the bitwise shift operator (see `perldoc perlop`),
> and 2) the use you describe is as a here-document, a way of quoting long
> strings (see `perldoc perldata`, search for the term "here-document").

Oddly enough, unlike most other operators in Perl, >> has only one use,
number 1 above.  Here-docs use <<.


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: The >> operator

2004-05-28 Thread Randy W. Sims
On 5/29/2004 12:28 AM, gohaku wrote:
Hi all,
I'm not sure if ">>" is an official operator in Perl but I have seen 
">>" used in conjunction with
HTML code or Long Strings.
a google search and perldoc doesn't return any useful information.
I am looking for code examples that use ">>".
It has two uses: 1) the bitwise shift operator (see `perldoc perlop`), 
and 2) the use you describe is as a here-document, a way of quoting long 
strings (see `perldoc perldata`, search for the term "here-document").

Randy.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Urgent

2004-05-28 Thread LKTee

Other command can instance? Because after try still no work. 


-Original Message-
From: John W. Krahn [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 27, 2004 9:37 AM
To: [EMAIL PROTECTED]
Subject: Re: How to find same filename in subdirectory

 
> Hi, John thanks you comment, the coding is work. But i'm detect have some
small
> problem in line 7 print "$File::Find::name\n" if $_ eq 'File1'; I test as
below
> sample 2 is follow you coding. From here i detect nothing return from
script.
> 
> But after i amend the coding become print "$File::Find::name\n" if $_ =
'File1';
> this work and return the result i expected. But why perl show "Found = in
> conditional, should be == at ./callback line 7."? Any idea? I try put "=="
to
> replace "=", the result return like sample 2.

Perhaps you want this instead:

print "$File::Find::name\n" if /File1$/;


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




The >> operator

2004-05-28 Thread gohaku
Hi all,
I'm not sure if ">>" is an official operator in Perl but I have seen 
">>" used in conjunction with
HTML code or Long Strings.
a google search and perldoc doesn't return any useful information.
I am looking for code examples that use ">>".

TIA,
-gohaku
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: regular expression

2004-05-28 Thread Beau E. Cox
On Friday 28 May 2004 05:47 pm, John W. Krahn wrote:
> "Beau E. Cox" wrote:
> > On Friday 28 May 2004 03:31 pm, Mandar Rahurkar wrote:
> > > for(@cont) {
> > >   tr/A-Z/a-z/;
> >
> > You forgot the 'g':
> >tr/A-Z/a-z/g;
>
> tr/// doesn't have a /g option.
>
> perldoc perlop

OK. I was thinking s///.

>
>
> John
> --
> use Perl;
> program
> fulfillment


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: regular expression

2004-05-28 Thread John W. Krahn
"Beau E. Cox" wrote:
> 
> On Friday 28 May 2004 03:31 pm, Mandar Rahurkar wrote:
> >
> > for(@cont) {
> >   tr/A-Z/a-z/;
> 
> You forgot the 'g':
>tr/A-Z/a-z/g;

tr/// doesn't have a /g option.

perldoc perlop


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: regular expression (made more clearer)

2004-05-28 Thread John W. Krahn
Mandar Rahurkar wrote:
> 
> Hi,

Hello,

>   I am trying to remove from file :
>1. all characters but any alphabet and numbers (i.e., file shd not contain 
> anything
>   but "alphabets and numbers" that means NO punctuation etc...

Do you consider these
"ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ" to be
"alphabet" or just A-Za-z?

>2. all trailing spaces should be made to one space.
> 
>   following code doesnt seem to work for objective [1] mentioned above.
> Can anyone please point whats wrong with the
> second line and what changes should I make ?
> 
> ---
> open(fp,$file) or die "Cant open $file :$!\n";
> @cont=;
> 
> for(@cont) {
>  tr/A-Z/a-z/; # converts all uppercase to lowercase

If you want alphabetic characters other than A-Za-z use:

$_ = lc;

>  s/^[a-z0-9]+/ /; # substitute all non alphabets and numbers by space
>  s/\s+/ /g;   # removes trailing spaces

The first substitution should have been s/[^a-z0-9]+/ /g and the second
substitution isn't required at all or you could have done it like this:

tr/a-z0-9/ /cs;

Or if you are using alphabetic characters other than A-Za-z use:

s/[^[:alnum:]]+/ /g;

> }


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: regular expression

2004-05-28 Thread Beau E. Cox
On Friday 28 May 2004 03:31 pm, Mandar Rahurkar wrote:
> Hi,
>I am trying to remove from file :
> 1. all characters but any alphabet and numbers.
> 2. all trailing spaces should be made to one space.
>
>following code doesnt seem to work for objective [1] mentioned above.
> Can anyone please point out why ?
>
> Thanks,
> Mandar
> ---
> open(fp,$file) or die "Cant open $file :$!\n";
> @cont=;
> [EMAIL PROTECTED];
>
> for(@cont) {
>   tr/A-Z/a-z/;

You forgot the 'g':
   tr/A-Z/a-z/g;
(but that will remove ALL spaces too!)

>   s/^[a-z0-9]/ /;
>   s/\s+/ /g;
> }
> ---

Hi Mandar -

Please restate your goals.

 Do yYou you want to remove spaces too?
 What about nls and tabs?
 Do you want to lowercase everthing (what your script does now)?

Assume you want to  to remove from file :
1. all characters but any alphabet and numbers and whitespace.
2. all non nl whitespace should be made to one space.
3. rewrite the file.

Then:

#
# open for update (using caps for handle as per normal convention).
open( FP, "+< $file" ) or die "Cant open $file :$!\n";
# 'slurp" file to scalar (avoids having to 'for' thru array
$_ = do { local $/; ; };

# remove non alphebetics
s/[^A-Za-z0-9\s]//sg;
# change non-nl whitespace to one space
s/[\t ]+/ /sg;

# seek to start, rewrite, and close
seek FP, 0, 0;
print FP $_;
close FP;
#

Aloha => Beau;


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




regular expression (made more clearer)

2004-05-28 Thread Mandar Rahurkar
Hi,
  I am trying to remove from file :
   1. all characters but any alphabet and numbers (i.e., file shd not contain 
anything 
  but "alphabets and numbers" that means NO punctuation etc...
   2. all trailing spaces should be made to one space.
  
  following code doesnt seem to work for objective [1] mentioned above. Can anyone 
please point whats wrong with the
second line and what changes should I make ?

Thanks,
Mandar
---
open(fp,$file) or die "Cant open $file :$!\n";
@cont=;

for(@cont) { 
 tr/A-Z/a-z/; # converts all uppercase to lowercase   
 s/^[a-z0-9]+/ /; # substitute all non alphabets and numbers by space
 s/\s+/ /g;   # removes trailing spaces
}   
--- 

---
Mandar Rahurkar
ECE,   UIUC
---

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: regular expression

2004-05-28 Thread James Edward Gray II
On May 28, 2004, at 8:31 PM, Mandar Rahurkar wrote:
Hi,
   I am trying to remove from file :
1. all characters but any alphabet and numbers.
tr/A-Za-z0-9//cd;   # should handle that
2. all trailing spaces should be made to one space.
I'm not 100% sure I understand this, but I'm guessing you want:
s/ +/ /g;
   following code doesnt seem to work for objective [1] mentioned 
above. Can anyone please point out why ?
See inline comments below...
Thanks,
Mandar
---
open(fp,$file) or die "Cant open $file :$!\n";
@cont=;
[EMAIL PROTECTED];
Is there a reason for this?  Code not shown maybe.
for(@cont) {
  tr/A-Z/a-z/;
This changes all uppercase letters to their lowercase eqivalents.
  s/^[a-z0-9]/ /;
This replaces one lowercase letter or digit at the beginning of the 
matched string with a space.

  s/\s+/ /g;
This replaces a run of tabs, spaces and newlines with a single space.
}
Finally, do you really need to slurp the file?  Why not process it line 
by line?

James
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



regular expression

2004-05-28 Thread Mandar Rahurkar
Hi,
   I am trying to remove from file :
1. all characters but any alphabet and numbers.
2. all trailing spaces should be made to one space.
   
   following code doesnt seem to work for objective [1] mentioned above. Can anyone 
please point out why ?

Thanks,
Mandar 
---
open(fp,$file) or die "Cant open $file :$!\n"; 
@cont=; 
[EMAIL PROTECTED];

for(@cont) {
  tr/A-Z/a-z/;
  s/^[a-z0-9]/ /;
  s/\s+/ /g; 
}   
---
---
Mandar Rahurkar
ECE,   UIUC
---

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: regex help

2004-05-28 Thread Andrew Gaffney
Roberto Etcheverry wrote:
On Fri, 28 May 2004, Andrew Gaffney wrote:

I'm trying to write a regex to parse the following data. Each group is a string
to parse.
05/28/04

Purchase With Pin Pin

$10.00(pending)
$1,224.45
05/27/04

Purchase With Pin Shell Service Stlake
St. Loumo

$1.78
$1,234.45
05/21/04

Atm Withdrawal One O'fallon Squo'fallon
Mo 1

$20.00
$
1,134.79
This is the regex I put together:
my $regex = ']+?>(\d{2})/(\d{2})/(\d{2}).+?';
$regex   .= ']+?>(.*?).+?';
$regex   .= ']+?>(.+?).+?';
$regex   .= ']+?>(?:\$(\d+\.\d{2})).*?.+?';
$regex   .= ']+?>(?:\$(\d+\.\d{2})).*?.+?';
$regex   .= ']+?>.*?(?:\$(\d+\.\d{2})).*?';
The first field will always be in the form 'mm/dd/yy'. The second and third
field need to be captured as they are. As for the fourth and fifth fields, only
one will contain a value. The other one will be empty (nothing between
). The format is '$123.45' with the possibility of trailing HTML before
the . I only want the number without the $. The sixth field will contain a
dollar amount like the fourth and fifth fields. It could be surrounded by HTML.
Again, I only need the number without the $. What is wrong with the above regex?
I am using it with the 's' modifier.
It seems two things are missing:
1) A '?' after the 4th and  5th group (because they may be empty).
2) Include ',' on the regex matching the amounts (to match '1,234.45' for
example).
So the regex would be:
my $regex = ']+?>(\d{2})/(\d{2})/(\d{2}).+?';
$regex   .= ']+?>(.*?).+?';
$regex   .= ']+?>(.+?).+?';
$regex   .= ']+?>(?:\$([\d,]+\.\d{2}))?.*?.+?';
$regex   .= ']+?>(?:\$([\d,]+\.\d{2}))?.*?.+?';
$regex   .= ']+?>.*?(?:\$([\d,]+\.\d{2})).*?';
Ah, thank you. Those changes worked.
--
Andrew Gaffney
Network Administrator
Skyline Aeronautics, LLC.
636-357-1548
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: A ref too far: assign an array ref to an array ref to a hash element

2004-05-28 Thread John W. Krahn
Angie Ahl wrote:
> 
> Hi people

Hello,

> I'm trying to create a hash of arrays of arrays and I'm having a mind
> twisting time with references.
> 
> my $key = "some_varying_text"
> my %pathhash;
> my @link = ($LinkUrl, $LinkTitle);
> 
> I'm trying to set $pathhash{$key} to an array that contains the array
> @link.
> ie there will be multiple @link arrays in $pathhash{$key}.
> 
> I just can't work out how to assign an array ref to an array ref to a
> hash element. I think that's right.
> 
> Any clues anyone... please, 4 hours down and a lot of RTFM'ing hasn't
> helped (quite the opposite actually;)

If @link is lexically scoped then use a reference:

$pathhash{ $key }[ 0 ] = [EMAIL PROTECTED];
# or
push @{ $pathhash{ $key } }, [EMAIL PROTECTED];


If not then you have to copy it to an anonymous array:

$pathhash{ $key }[ 0 ] = [ @link ];
# or
push @{ $pathhash{ $key } }, [ @link ];



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: hour -1 routine

2004-05-28 Thread John W. Krahn
Anthony J Segelhorst wrote:
> 
> I am trying to set up a script that will do the do a current time -1
> routine.
> 
> Examples:
> 
> Current Time:
> mmddyy:hhss
> 052804:1030
> 
> Output:
> 052804:0930
> 
> Current Time:
> 052704:0015
> 
> Output:
> 052604:23:15
> 
> I think the add_delta module is where I need to go, but I have never used
> modules before.

$ perl -e'
use POSIX qw/ strftime /; 
my @current_time = localtime time;
my @minus_one_hour = localtime time - 3600;
print strftime( "%m%d%y:%H%M\n", @current_time ),
  strftime( "%m%d%y:%H%M\n", @minus_one_hour );
'
052804:1530
052804:1430



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




A ref too far: assign an array ref to an array ref to a hash element

2004-05-28 Thread Angie Ahl
Hi people
I'm trying to create a hash of arrays of arrays and I'm having a mind 
twisting time with references.

my $key = "some_varying_text"
my %pathhash;
my @link = ($LinkUrl, $LinkTitle);
I'm trying to set $pathhash{$key} to an array that contains the array 
@link.
ie there will be multiple @link arrays in $pathhash{$key}.

I just can't work out how to assign an array ref to an array ref to a 
hash element. I think that's right.

Any clues anyone... please, 4 hours down and a lot of RTFM'ing hasn't 
helped (quite the opposite actually;)

Angie
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: Request Tracker and HTML::FormatText

2004-05-28 Thread Robert Citek
On Friday, May 28, 2004, at 16:29 US/Central, Roberto Etcheverry wrote:
http://search.cpan.org/src/GAAS/HTML-Format-1.23/lib/HTML/FormatText.pm
Thanks.  I looked for that tar file and couldn't find one.  So, I used 
a wget to download the module:

  wget -m -nH -np 
http://search.cpan.org/src/GAAS/HTML-Format-1.23/lib/HTML/FormatText.pm

and removed the index.html files:
  find src/GAAS/ -name 'index.html*' | xargs rm
From then on it was the normal: perl Makefile.pl, make, make test, make 
install.

Two questions:
 - how did you find the file?
 - is there a tarball of the same?
Again, thanks.
Regards,
- Robert
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: Request Tracker and HTML::FormatText

2004-05-28 Thread Roberto Etcheverry
Look in search.cpan.org.
Sources are found at
http://search.cpan.org/src/GAAS/HTML-Format-1.23/lib/HTML/FormatText.pm


On Fri, 28 May 2004, Robert Citek wrote:

>
> Hello all,
>
> We are in the process of installing Request Tracker (
> http://www.bestpractical.com/rt/ -- rt.3.0.11 ) on a Fedora box and are
> running into an issue with installing the CPAN module HTML::FormatText.
>   RT requires it, yet CPAN no longer has it.
>
> A google search find some in cache, but then going to those pages
> produces nothing.
>
> Any thoughts on how to get HTML::FormatText?
>
> Regards,
> - Robert
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
>
>
>

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Request Tracker and HTML::FormatText

2004-05-28 Thread Robert Citek
Hello all,
We are in the process of installing Request Tracker ( 
http://www.bestpractical.com/rt/ -- rt.3.0.11 ) on a Fedora box and are 
running into an issue with installing the CPAN module HTML::FormatText. 
 RT requires it, yet CPAN no longer has it.

A google search find some in cache, but then going to those pages 
produces nothing.

Any thoughts on how to get HTML::FormatText?
Regards,
- Robert
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: regex help

2004-05-28 Thread Roberto Etcheverry


On Fri, 28 May 2004, Andrew Gaffney wrote:

> I'm trying to write a regex to parse the following data. Each group is a string
> to parse.
>
> 05/28/04
> 
> Purchase With Pin Pin
> 
> $10.00(pending) href='javascript: ShowHelp("PENDING TRANSACTION")'> border="0">
> $1,224.45
>
> 05/27/04
> 
> Purchase With Pin Shell Service Stlake
> St. Loumo
> 
> $1.78
> $1,234.45
>
> 05/21/04
> 
> Atm Withdrawal One O'fallon Squo'fallon
> Mo 1
> 
> $20.00
> $
> 1,134.79
>
> This is the regex I put together:
>
>  my $regex = ']+?>(\d{2})/(\d{2})/(\d{2}).+?';
>  $regex   .= ']+?>(.*?).+?';
>  $regex   .= ']+?>(.+?).+?';
>  $regex   .= ']+?>(?:\$(\d+\.\d{2})).*?.+?';
>  $regex   .= ']+?>(?:\$(\d+\.\d{2})).*?.+?';
>  $regex   .= ']+?>.*?(?:\$(\d+\.\d{2})).*?';
>
> The first field will always be in the form 'mm/dd/yy'. The second and third
> field need to be captured as they are. As for the fourth and fifth fields, only
> one will contain a value. The other one will be empty (nothing between
> ). The format is '$123.45' with the possibility of trailing HTML before
> the . I only want the number without the $. The sixth field will contain a
> dollar amount like the fourth and fifth fields. It could be surrounded by HTML.
> Again, I only need the number without the $. What is wrong with the above regex?
> I am using it with the 's' modifier.
>
> --
> Andrew Gaffney
> Network Administrator
> Skyline Aeronautics, LLC.
> 636-357-1548
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
>
>
>
It seems two things are missing:

1) A '?' after the 4th and  5th group (because they may be empty).
2) Include ',' on the regex matching the amounts (to match '1,234.45' for
example).

So the regex would be:

my $regex = ']+?>(\d{2})/(\d{2})/(\d{2}).+?';
$regex   .= ']+?>(.*?).+?';
$regex   .= ']+?>(.+?).+?';
$regex   .= ']+?>(?:\$([\d,]+\.\d{2}))?.*?.+?';
$regex   .= ']+?>(?:\$([\d,]+\.\d{2}))?.*?.+?';
$regex   .= ']+?>.*?(?:\$([\d,]+\.\d{2})).*?';


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: weird math

2004-05-28 Thread Andrew Gaffney
Kevin Old wrote:
On Thu, 2004-05-27 at 23:31, Andrew Gaffney wrote:
I am writing a program to parse a CSV file downloaded from my bank. I have it 
keep a running balance, but I'm getting a weird total. Apparently, -457.16 + 
460.93 = 3.769998. But when 20 is subtracted from that, I get -16.23. 
There are no weird numbers like that in my input data. All numbers have no more 
than 2 numbers after the decimal point. Here is my code:
[...]
  print "$balance\n";

Andrew,
Try using this when you print out the $balance:
printf "%.2f", $balance;
You'll get 3.77.
I was going to use that for output, but I was just curious why it was happening 
in the first place. I think all the other posts answered that question.

--
Andrew Gaffney
Network Administrator
Skyline Aeronautics, LLC.
636-357-1548
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



regex help

2004-05-28 Thread Andrew Gaffney
I'm trying to write a regex to parse the following data. Each group is a string 
to parse.

05/28/04

Purchase With Pin Pin

$10.00(pending)
$1,224.45

05/27/04

Purchase With Pin Shell Service Stlake 
St. Loumo

$1.78
$1,234.45

05/21/04

Atm Withdrawal One O'fallon Squo'fallon 
Mo 1

$20.00
$
1,134.79

This is the regex I put together:
my $regex = ']+?>(\d{2})/(\d{2})/(\d{2}).+?';
$regex   .= ']+?>(.*?).+?';
$regex   .= ']+?>(.+?).+?';
$regex   .= ']+?>(?:\$(\d+\.\d{2})).*?.+?';
$regex   .= ']+?>(?:\$(\d+\.\d{2})).*?.+?';
$regex   .= ']+?>.*?(?:\$(\d+\.\d{2})).*?';
The first field will always be in the form 'mm/dd/yy'. The second and third 
field need to be captured as they are. As for the fourth and fifth fields, only 
one will contain a value. The other one will be empty (nothing between 
). The format is '$123.45' with the possibility of trailing HTML before 
the . I only want the number without the $. The sixth field will contain a 
dollar amount like the fourth and fifth fields. It could be surrounded by HTML. 
Again, I only need the number without the $. What is wrong with the above regex? 
I am using it with the 's' modifier.

--
Andrew Gaffney
Network Administrator
Skyline Aeronautics, LLC.
636-357-1548
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



RE: max number of data within an array

2004-05-28 Thread Charles K. Clarkson
Boon Chong Ang <[EMAIL PROTECTED]> wrote:
: 
: May I know what is the maximum number of data that I
: can stored within an array?

AFAIK it depends on the amount of resources
available to that process. Unless you have only a
limited amount of resources you should be able to
store extremely large arrays.


: It seems that if the number of data exist 265, then
: it will be miss already or it is due to memory
: problem?

I doubt you are hitting the limit for array size
with such a small array, unless each element is huge.
Show us your code. There is probably some other error
that looks like a memory problem.


HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Regexp

2004-05-28 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> I have the following lines:
> 
> g00:~> perl -e '
> $a = "aa** a";
Since you have * which in a regex stands for zero or more occurances, then you 
must turn this off as part of the processing. You use \Q and \E as in /^\Q$b\E/ would 
take the aa** a as just that.

I would get away from the $a and $b as variables since this are default 
variables for sort and can cause you problems in the future if not careful.

Wags ;)

> $b = $a;
> $b =~ qw/$b/;
> print "Yes\n" if $a =~ /^$b/;
> print $b'
> Nested quantifiers in regex; marked by <-- HERE in m/^aa** <-- HERE 
> a/ at -e line 5.
> 
> Is there a way to make the regexp takes '$b' as string, because
> I see the non characters are problem.
> 
> Thanks
> 
> -
> This mail is from: <[EMAIL PROTECTED]>
> -



  Any questions and/or problems, please let me know.

  Thanks.

Wags ;)
Int: 9-8-002-2224
Ext: 408-323-4225x2224



***
This message conatains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Regexp

2004-05-28 Thread max4o
I have the following lines:

g00:~> perl -e '
$a = "aa** a";
$b = $a;
$b =~ qw/$b/;
print "Yes\n" if $a =~ /^$b/;
print $b'
Nested quantifiers in regex; marked by <-- HERE in m/^aa** <-- HERE  a/ at
-e line 5.

Is there a way to make the regexp takes '$b' as string, because
I see the non characters are problem.

Thanks

-
This mail is from: <[EMAIL PROTECTED]>
-

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: weird math

2004-05-28 Thread Peter Scott
In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Andrew Gaffney) writes:
>I am writing a program to parse a CSV file downloaded from my bank. I have it 
>keep a running balance, but I'm getting a weird total. Apparently, -457.16 + 
>460.93 = 3.769998. But when 20 is subtracted from that, I get -16.23. 

perldoc -q decimals

-- 
Peter Scott
http://www.perldebugged.com/
*** NEW *** http://www.perlmedic.com/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: weird math

2004-05-28 Thread Rob Dixon
Hi Andrew.

Andrew Gaffney wrote:
>
> I am writing a program to parse a CSV file downloaded from my bank. I have it 
> keep a running balance, but I'm getting a weird total. Apparently, -457.16 + 
> 460.93 = 3.769998. But when 20 is subtracted from that, I get -16.23. 
> There are no weird numbers like that in my input data. All numbers have no more 
> than 2 numbers after the decimal point. Here is my code:
> 
> #!/usr/bin/perl
> 
> do './money.pl';
> # use strict and warnings is defined in money.pl

'strict' and 'warnings' are lexically scoped so they won't be effective
outside money.pl and you need them in this file as well.

> my $balance = 0;
> 
> print $cgi->header;
> print "\n";
> print "\nDateType width=350>DescriptionWithdrawlDeposit my $csvdata = parse_csv("/tmp/usbank.csv");
> foreach(@{$csvdata}) {
>print "$_->{date}$_->{type}$_->{descr}";
>if($_->{amount} > 0) {
>  print "$_->{amount}";
>} else {
>  print "$_->{amount}";
>}
>$balance += $_->{amount};
>print "$balance\n";

This is a very common problem. Floating point numbers can't usually be held
to a precision of 15 significant figures so Perl often prints a recurring
decimal for the results of arithmetic. The best way around this for
financial applications is to work in integral numbers of pennies (cents)
and divide them down for the display. In this case you should be OK
rounding to two decimal places with

  $balance += $_->{amount};
  $balance = sprintf '%.2f', $balance;
  print "$balance\n";

> }
> print "";
> 
> money.pl is an include file that contains the parse_csv() function which pulls 
> apart each line of the downloaded CSV and pushes it into an array as an 
> anonymous hash.

HTH,

Rob


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: weird math

2004-05-28 Thread Paul Johnson
On Thu, May 27, 2004 at 10:31:08PM -0500, Andrew Gaffney wrote:

> I am writing a program to parse a CSV file downloaded from my bank. I have 
> it keep a running balance, but I'm getting a weird total. Apparently, 
> -457.16 + 460.93 = 3.769998. But when 20 is subtracted from that, I 
> get -16.23. There are no weird numbers like that in my input data. All 
> numbers have no more than 2 numbers after the decimal point. Here is my 
> code:

perldoc -q decimal

The last two paragraphs are probably particularly appropriate to you.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: weird math

2004-05-28 Thread Kevin Old
On Thu, 2004-05-27 at 23:31, Andrew Gaffney wrote:
> I am writing a program to parse a CSV file downloaded from my bank. I have it 
> keep a running balance, but I'm getting a weird total. Apparently, -457.16 + 
> 460.93 = 3.769998. But when 20 is subtracted from that, I get -16.23. 
> There are no weird numbers like that in my input data. All numbers have no more 
> than 2 numbers after the decimal point. Here is my code:
[...]
>print "$balance\n";

Andrew,

Try using this when you print out the $balance:

printf "%.2f", $balance;

You'll get 3.77.

Hope this helps,
Kevin
-- 
Kevin Old <[EMAIL PROTECTED]>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: hour -1 routine

2004-05-28 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Anthony J Segelhorst wrote:
> "Wiggins d Anconia" <[EMAIL PROTECTED]> wrote on 05/28/2004
> 12:37:56 PM:
> 
>>> 
>>> I am trying to set up a script that will do the do a current time
>>> -1 routine. 
>>> 
>>> Examples:
>>> 
>>> Current Time:
>>> mmddyy:hhss
>>> 052804:1030
>>> 
>>> Output:
>>> 052804:0930
>>> 
>>> 
>>> Current Time:
>>> 052704:0015
>>> 
>>> Output:
>>> 052604:23:15
>>> 
>>> 
>>> I think the add_delta module is where I need to go, but I have
>>> never used modules before. 
>>> 
>> 
>> add_delta is probably a method/function in Date::Calc or Date::Manip
>> modules. But in this case is probably overkill.
>> 
>> You can use the built-in functions 'time' and 'localtime' to get the
>> desired effect. 
>> 
>> perldoc -f time
>> perldoc -f localtime
>> 
>> 'time' will return the current time, from which you can subtract
>> 60*60 (60 seconds in each of 60 minutes), which gives 1 hour ago.
>> You can then use localtime to retrieve the values for the specific
>> fields you need at the calculated time.  Alternatively you could use
>> POSIX::strftime for the formatting. 
>> 
>> perldoc POSIX
>> 
>> HTH,
>> 
>> http://danconia.org
> 
> If I understand what you are saying about subtract 60 seconds in each
> of 60 minutes, how will this be able to handle:
> 
> 1.  When it is 00:15, because if it is 00:15 I will actually
> want 23:15
What they are saying is that you subtract using seconds from time:
$My1Hour = time - ( 60 * 60);
my @MyTime = localtime($My1Hour);
# These are the values returened by localtime;
#012 3 45 6 7 8
#   ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$MyTime[4]++;
# need to add 1 to month since the months come back in 0 to 11 vs 1 thru 12.
   Now @MyTime  has the info in the format you want for getting one hour back.
If you want 2 digit year then $MyTime[5] % 100 will give you 04.

A start.

Wags ;)  ps When you do it this way, it will handle all the year ehds, month end, etc 
correctly for you.  The gotchas can be at the time of Day Light Savings if in US.


> 2.  I can not just subtract 1 from the date because 010104
> needs to really be 123104.
> 
> If this is not what you are suggesting, let me know.  You might be
> onto something.
> 
> 
> This is the part that is confusing me currently.  I am just trying to
> get logical understanding of what I want to do before I start writing
> the code.
> 


***
This message conatains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: hour -1 routine

2004-05-28 Thread Wiggins d Anconia
> 
> "Wiggins d Anconia" <[EMAIL PROTECTED]> wrote on 05/28/2004 12:37:56 
> PM:
> 
> > > 
> > > I am trying to set up a script that will do the do a current time -1 
> > > routine.
> > > 
> > > Examples:
> > > 
> > > Current Time:
> > > mmddyy:hhss
> > > 052804:1030
> > > 
> > > Output:
> > > 052804:0930
> > > 
> > > 
> > > Current Time:
> > > 052704:0015
> > > 
> > > Output:
> > > 052604:23:15
> > > 
> > > 
> > > I think the add_delta module is where I need to go, but I have never 
> used 
> > > modules before. 
> > > 
> > 
> > add_delta is probably a method/function in Date::Calc or Date::Manip
> > modules. But in this case is probably overkill.
> > 
> > You can use the built-in functions 'time' and 'localtime' to get the
> > desired effect.
> > 
> > perldoc -f time
> > perldoc -f localtime
> > 
> > 'time' will return the current time, from which you can subtract 60*60
> > (60 seconds in each of 60 minutes), which gives 1 hour ago. You can then
> > use localtime to retrieve the values for the specific fields you need at
> > the calculated time.  Alternatively you could use POSIX::strftime for
> > the formatting.
> > 
> > perldoc POSIX
> > 
> > HTH,
> > 
> > http://danconia.org
> 
> If I understand what you are saying about subtract 60 seconds in each of 
> 60 minutes, how will this be able to handle:
> 
> 1.  When it is 00:15, because if it is 00:15 I will actually want 
> 23:15
> 2.  I can not just subtract 1 from the date because 010104 needs 
> to really be 123104.
> 
> If this is not what you are suggesting, let me know.  You might be onto 
> something.
> 
> 
> This is the part that is confusing me currently.  I am just trying to get 
> logical understanding of what I want to do before I start writing the 
> code.
> 

Excellent questions.  'time' returns the number of seconds from a
specific point in time, in most cases Jan 1 1970, 00:00:00. So for
instance when I started this sentence, I had the following # of seconds:

1085762425

>From this I can subtract 60*60 to get 1 hour ago from the point when the
time was read as it relates to that initial starting point (also known
as the epoch, Jan 1 1970).

Then using 'localtime' I can translate that time back into a readable
format. Because localtime is just translating a set point in time, and
all of my calculations were done using seconds, I don't have to worry
about boundaries, such as hour, day, month, or years.

There are a lot of caveats about working with times, but the same is
going to hold whether you are using something like 'add_delta' or the
built-ins.

Make sense?   I am reluctant to just give code since it doesn't
reinforce the learning, but if you are still stuck post again, we will
get you sorted.

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: weird math

2004-05-28 Thread John W. Krahn
Andrew Gaffney wrote:
> 
> I am writing a program to parse a CSV file downloaded from my bank. I have it
> keep a running balance, but I'm getting a weird total. Apparently, -457.16 +
> 460.93 = 3.769998. But when 20 is subtracted from that, I get -16.23.
> There are no weird numbers like that in my input data. All numbers have no more
> than 2 numbers after the decimal point.

Perhaps this will help explain what is going on:

perldoc -q "long decimals"


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Question on Net::FTP.

2004-05-28 Thread Silky Manwani
I was doing this from a Windows to Mac OSX machine. I had a "firewall" 
turned on in "Sharing".
Not sure why it doesn't work with firewall turned on.


On May 28, 2004, at 2:41 AM, NYIMI Jose (BMB) wrote:
-Original Message-
From: Silky Manwani [mailto:[EMAIL PROTECTED]
Sent: Friday, May 28, 2004 3:42 AM
Cc: [EMAIL PROTECTED]
Subject: Re: Question on Net::FTP.
Never mind.
Figured it out.
:)
Could you share the solution ?
José.
 DISCLAIMER 
"This e-mail and any attachment thereto may contain information which 
is confidential and/or protected by intellectual property rights and 
are intended for the sole use of the recipient(s) named above.
Any use of the information contained herein (including, but not 
limited to, total or partial reproduction, communication or 
distribution in any form) by other persons than the designated 
recipient(s) is prohibited.
If you have received this e-mail in error, please notify the sender 
either by telephone or by e-mail and delete the material from any 
computer".

Thank you for your cooperation.
For further information about Proximus mobile phone services please 
see our website at http://www.proximus.be or refer to any Proximus 
agent.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: hour -1 routine

2004-05-28 Thread Anthony J Segelhorst
"Wiggins d Anconia" <[EMAIL PROTECTED]> wrote on 05/28/2004 12:37:56 
PM:

> > 
> > I am trying to set up a script that will do the do a current time -1 
> > routine.
> > 
> > Examples:
> > 
> > Current Time:
> > mmddyy:hhss
> > 052804:1030
> > 
> > Output:
> > 052804:0930
> > 
> > 
> > Current Time:
> > 052704:0015
> > 
> > Output:
> > 052604:23:15
> > 
> > 
> > I think the add_delta module is where I need to go, but I have never 
used 
> > modules before. 
> > 
> 
> add_delta is probably a method/function in Date::Calc or Date::Manip
> modules. But in this case is probably overkill.
> 
> You can use the built-in functions 'time' and 'localtime' to get the
> desired effect.
> 
> perldoc -f time
> perldoc -f localtime
> 
> 'time' will return the current time, from which you can subtract 60*60
> (60 seconds in each of 60 minutes), which gives 1 hour ago. You can then
> use localtime to retrieve the values for the specific fields you need at
> the calculated time.  Alternatively you could use POSIX::strftime for
> the formatting.
> 
> perldoc POSIX
> 
> HTH,
> 
> http://danconia.org

If I understand what you are saying about subtract 60 seconds in each of 
60 minutes, how will this be able to handle:

1.  When it is 00:15, because if it is 00:15 I will actually want 
23:15
2.  I can not just subtract 1 from the date because 010104 needs 
to really be 123104.

If this is not what you are suggesting, let me know.  You might be onto 
something.


This is the part that is confusing me currently.  I am just trying to get 
logical understanding of what I want to do before I start writing the 
code.







This email has been scanned for all viruses by the MessageLabs SkyScan
service.___

This electronic message contains information from MeadWestvaco
Corporation or subsidiary companies, which may be confidential,
privileged or otherwise protected from disclosure.  The
information is intended to be used solely by the recipient(s)
named.  If you are not an intended recipient, be aware that
any review, disclosure, copying, distribution or use of this
transmission or its contents is prohibited.  If you have
received this transmission in error, please notify MeadWestvaco
immediately at [EMAIL PROTECTED]
___

Re: weird math

2004-05-28 Thread Wiggins d Anconia
> I am writing a program to parse a CSV file downloaded from my bank. I
have it 
> keep a running balance, but I'm getting a weird total. Apparently,
-457.16 + 
> 460.93 = 3.769998. But when 20 is subtracted from that, I get
-16.23. 
> There are no weird numbers like that in my input data. All numbers
have no more 
> than 2 numbers after the decimal point. Here is my code:
> 

perldoc -q decimal
perldoc perlnum

http://danconia.org


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: max number of data within an array

2004-05-28 Thread Jeff 'japhy' Pinyan
On May 28, Boon Chong Ang said:

>May I know what is the maximum number of data that I can stored within an
>array?

I don't know what the maximum number of data YOU can store in an array is,
because I don't know how much memory your computer has.  The size of your
data structures in Perl is dependent upon how much memory there is.

>It seems that if the number of data exist 265, then it will be
>miss already or it is due to memory problem?

That's a rather arbitrary number.  You're probably doing something wrong
if your arrays aren't letting you hold as many elements as you want.

-- 
Jeff "japhy" Pinyan  [EMAIL PROTECTED]  http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
CPAN ID: PINYAN[Need a programmer?  If you like my work, let me know.]
 what does y/// stand for?   why, yansliterate of course.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: weird math

2004-05-28 Thread Jeff 'japhy' Pinyan
On May 27, Andrew Gaffney said:

>I am writing a program to parse a CSV file downloaded from my bank. I have it
>keep a running balance, but I'm getting a weird total. Apparently, -457.16 +
>460.93 = 3.769998. But when 20 is subtracted from that, I get -16.23.
>There are no weird numbers like that in my input data. All numbers have no more
>than 2 numbers after the decimal point. Here is my code:

I suggest 'perldoc -q numbers'

Found in /usr/local/lib/perl5/5.8.4/pod/perlfaq4.pod
  Why am I getting long decimals (eg, 19.94999) instead of the
  numbers I should be getting (eg, 19.95)?

Internally, your computer represents floating-point numbers in binary.
Digital (as in powers of two) computers cannot store all numbers
exactly.  Some real numbers lose precision in the process.  This is a
problem with how computers store numbers and affects all computer lan-
guages, not just Perl.

perlnumber show the gory details of number representations and conver-
sions.

To limit the number of decimal places in your numbers, you can use the
printf or sprintf function.  See the "Floating Point Arithmetic" for
more details.

  printf "%.2f", 10/3;

  my $number = sprintf "%.2f", 10/3;

I think the 'perlnumber' documentation is new to Perl 5.8, but it might
exist back to 5.6.

Anyway, just use sprintf() or printf() when you need to be sure your
precision is what you expect it to be.

-- 
Jeff "japhy" Pinyan  [EMAIL PROTECTED]  http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
CPAN ID: PINYAN[Need a programmer?  If you like my work, let me know.]
 what does y/// stand for?   why, yansliterate of course.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: weird math

2004-05-28 Thread Angie Ahl
On 28 May 2004, at 04:31, Andrew Gaffney wrote:
I am writing a program to parse a CSV file downloaded from my bank. I 
have it keep a running balance, but I'm getting a weird total. 
Apparently, -457.16 + 460.93 = 3.769998. But when 20 is 
subtracted from that, I get -16.23. There are no weird numbers like 
that in my input data. All numbers have no more than 2 numbers after 
the decimal point. Here is my code:

Those numbers are correct -457 + 460 does = 3.
It sounds like you're saying you shouldn't have negative numbers in 
there. or what do you mean by weird. Is it because perl is returning 
more that 2 digits as the remainder.

Angie
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: max number of data within an array

2004-05-28 Thread Rob Dixon
Boon Chong Ang wrote:
>
> May I know what is the maximum number of data that I can stored within an
> array? It seems that if the number of data exist 265, then it will be miss
> already or it is due to memory problem?

Hi.

I'm pretty sure that the theoretical size of Perl arrays is limited only by the
maximum integer that can be used for the index. This is almost always a signed
32-bit value which can be up to about 2,000 million. The real limit is the
amount of memory available to your process, but you should be fine with well
over 265 elements. Please say why you think you can't exceed this number. What
problem are you seeing?

Rob




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Question on Net::FTP.

2004-05-28 Thread NYIMI Jose (BMB)
> -Original Message-
> From: Silky Manwani [mailto:[EMAIL PROTECTED] 
> Sent: Friday, May 28, 2004 3:42 AM
> Cc: [EMAIL PROTECTED]
> Subject: Re: Question on Net::FTP.
> 
> 
> Never mind.
> 
> Figured it out.
> 
> :)

Could you share the solution ?

José.


 DISCLAIMER 

"This e-mail and any attachment thereto may contain information which is confidential 
and/or protected by intellectual property rights and are intended for the sole use of 
the recipient(s) named above. 
Any use of the information contained herein (including, but not limited to, total or 
partial reproduction, communication or distribution in any form) by other persons than 
the designated recipient(s) is prohibited. 
If you have received this e-mail in error, please notify the sender either by 
telephone or by e-mail and delete the material from any computer".

Thank you for your cooperation.

For further information about Proximus mobile phone services please see our website at 
http://www.proximus.be or refer to any Proximus agent.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: hour -1 routine

2004-05-28 Thread u235sentinel
What have you tried so far?  Perhaps we can help tweak the code.

Anthony J Segelhorst wrote:
I am trying to set up a script that will do the do a current time -1 
routine.

Examples:
Current Time:
mmddyy:hhss
052804:1030
Output:
052804:0930
Current Time:
052704:0015
Output:
052604:23:15
I think the add_delta module is where I need to go, but I have never used 
modules before. 

Anthony J Segelhorst
Enterprise Systems Management Team
Phone: 937-495-1876
Email: [EMAIL PROTECTED]

This email has been scanned for all viruses by the MessageLabs SkyScan
service.___
This electronic message contains information from MeadWestvaco
Corporation or subsidiary companies, which may be confidential,
privileged or otherwise protected from disclosure.  The
information is intended to be used solely by the recipient(s)
named.  If you are not an intended recipient, be aware that
any review, disclosure, copying, distribution or use of this
transmission or its contents is prohibited.  If you have
received this transmission in error, please notify MeadWestvaco
immediately at [EMAIL PROTECTED]
___
 


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: hour -1 routine

2004-05-28 Thread Wiggins d Anconia
> 
> I am trying to set up a script that will do the do a current time -1 
> routine.
> 
> Examples:
> 
> Current Time:
> mmddyy:hhss
> 052804:1030
> 
> Output:
> 052804:0930
> 
> 
> Current Time:
> 052704:0015
> 
> Output:
> 052604:23:15
> 
> 
> I think the add_delta module is where I need to go, but I have never used 
> modules before. 
> 

add_delta is probably a method/function in Date::Calc or Date::Manip
modules. But in this case is probably overkill.

You can use the built-in functions 'time' and 'localtime' to get the
desired effect.

perldoc -f time
perldoc -f localtime

'time' will return the current time, from which you can subtract 60*60
(60 seconds in each of 60 minutes), which gives 1 hour ago. You can then
use localtime to retrieve the values for the specific fields you need at
the calculated time.  Alternatively you could use POSIX::strftime for
the formatting.

perldoc POSIX

HTH,

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




hour -1 routine

2004-05-28 Thread Anthony J Segelhorst
I am trying to set up a script that will do the do a current time -1 
routine.

Examples:

Current Time:
mmddyy:hhss
052804:1030

Output:
052804:0930


Current Time:
052704:0015

Output:
052604:23:15


I think the add_delta module is where I need to go, but I have never used 
modules before. 


Anthony J Segelhorst
Enterprise Systems Management Team
Phone: 937-495-1876
Email: [EMAIL PROTECTED]


This email has been scanned for all viruses by the MessageLabs SkyScan
service.___

This electronic message contains information from MeadWestvaco
Corporation or subsidiary companies, which may be confidential,
privileged or otherwise protected from disclosure.  The
information is intended to be used solely by the recipient(s)
named.  If you are not an intended recipient, be aware that
any review, disclosure, copying, distribution or use of this
transmission or its contents is prohibited.  If you have
received this transmission in error, please notify MeadWestvaco
immediately at [EMAIL PROTECTED]
___

Form Help

2004-05-28 Thread John Pretti
All,
 
I have created a CGI promotion script that allows users to push files from
one server to another. By nature I know you can only select one radio
button, but how can I send an error to the user if they accidentally press
submit without selecting a radio button?
 
Thanks in advance,
John


RE: Program to scan dictionary for words with letters in a particul ar set?

2004-05-28 Thread McMahon, Chris
 
List::Compare.
http://search.cpan.org/search?query=list-compare&mode=all
-Chris  

-Original Message-
From: Jim Witte [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 26, 2004 10:15 PM
To: [EMAIL PROTECTED]
Subject: Program to scan dictionary for words with letters in a
particular set?

Given a file of words W such as 'cat dog at home ...' (or perhaps read
into an array, though that would be a very large array), and a set of
letters L (a string 'aoeuidhtns' - perhaps put into a array), how would
I write a program to extract all words in W whose letters are all in L? 
  I'm thinking of a program to generate a string of words for a
typing-tutor program.

Jim Witte
[EMAIL PROTECTED]
Indiana University CS




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Looking for a thread safe logging module

2004-05-28 Thread Rajesh Dorairajan
Hello All,

I am looking for a thread-safe Perl logging module to log output from a
Multi-threaded Perl Application. When I tried to write to a log file using
simple redirection, the threads contest for the log file. Creating a log
file for each thread creates a bunch of log files in my machine. Is there a
logger module that can log to a single from multiple threads? Last I checked
log4perl was still not thread safe. A search in CPAN did not yield any
result. Any help would be deeply appreciated.

Thanks,

--Rajesh 


Perl/TK hang on windows ?

2004-05-28 Thread Peter
Hi,

I have a Perl/Tk program that seems to hang in the following way. I have
narrowed it down to
the following situation, so it is not the real code I have. In a subroutine
that handles button
click event, I have an infinite loop with a sleep 60 in it and nothing else.
When this button is
clicked, the entire Perl/Tk screen freezes - I can not bring it in or out of
focus by clicking on
it, I can not move the screen. This infinite loop is try to simulate the
situation when the program
is waiting for a response message from a remote server that may take some
time to come back.

I am using Active State Perl on Win 2000. Any help/comments would be
appreciated.

Thanks.

Peter



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




max number of data within an array

2004-05-28 Thread Boon Chong Ang
Hi,

May I know what is the maximum number of data that I can stored within an array? It 
seems that if the number of data exist 265, then it will be miss already or it is due 
to memory problem? 

 

Thank you & best regards,

ABC