RE: localtime failing on DST change

2007-03-13 Thread Dial, Joe
 
Hello $Bill,
I love reading your answers to other people's problems.  I hope I can
help you.
Microsoft announced that there is a patch to the MSVCRT.DLL which may be
used by the perl executable.
I don't know the windows equivalent to ldd to be sure MSVCRT.DLL is used
by perl, but if it is, then Microsoft's
KB article number 932950  (URL: http://support.microsoft.com/kb/932590)
seems directly related to the issue
you describe.

Hope this helps,
Joe Dial
"Long Time Lurker"

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Bill Luebkert
Sent: Tuesday, March 13, 2007 10:25 AM
To: [EMAIL PROTECTED]
Cc: Jan Dubois
Subject: localtime failing on DST change

My 'localtime' function output doesn't reflect DST since the Sunday
changeover.

System: XP Pro; Perl B811

The earlier DST change time seems to be picked up OK by Windoze clock.
There
was some mention of the table changes by Microsoft I believe and there
is some
info at http://support.microsoft.com/gp/dst_hu1 based on user type.

GetTimeZoneInformation API call looks OK to me - here's all the
pertinent
output:

ActiveTime:
'-52588' (BIN)
DaylightBias:
'-60' (DW)
StandardBias:
'0' (DW)
DaylightName:
'Pacific Daylight Time' (SZ)
StandardStart:
'720896' (BIN)
ActiveTimeBias:
'420' (DW)
Bias:
'480' (DW)
DaylightStart:
'196608' (BIN)
StandardName:
'Pacific Standard Time' (SZ)

GetTimeZoneInformation ret: 2 (Daylight Savings Time)

UTC bias from localtime: 480

StandardName: Pacific Standard Time
SYear: 0
SMonth: 11
SDayOfWeek: 0
SDay: 1
SHour: 2
SMinute: 0
SSecond: 0
SMilliseconds: 0
StandardBias: 0

DaylightName: Pacific Daylight Time
DYear: 0
DMonth: 3
DDayOfWeek: 0
DDay: 2
DHour: 2
DMinute: 0
DSecond: 0
DaylightBias: -60

StandardDate: first Sunday of November at 2
StandardDate-raw: 0-11-0-1-2-0-0-0
DaylightDate: second Sunday of March at 2
DaylightDate-raw: 0-3-0-2-2-0-0-0

However localtime returns the following:

Perl localtime: Tue Mar 13 05:56:54 2007

Actual time is 06:56 PDT not 05:56 PST.

GMT  : 54 56 13 13 2 107 2 71 0
GMT  : yr=2007, mo=3, day=13, hr=13, min=56, sec=54, DST=no

Local: 54 56 5 13 2 107 2 71 0
Local: yr=2007, mo=3, day=13, hr=5, min=56, sec=54, DST=no

Note the isdst field (last element) is set to 0 (off) and the time is
off
by an hour.

Registry SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation shows
the
following values:

ActiveTime:
'-52588' (BIN)
DaylightBias:
'-60' (DW)
StandardBias:
'0' (DW)
DaylightName:
'Pacific Daylight Time' (SZ)
StandardStart:
'720896' (BIN)
ActiveTimeBias:
'420' (DW)
Bias:
'480' (DW)
DaylightStart:
'196608' (BIN)
StandardName:
'Pacific Standard Time' (SZ)

Microsoft has this info
http://msdn2.microsoft.com/en-us/vstudio/bb264729.aspx
and other Q&A :

Q: I'm a C++ developer who uses the TZ environment variable,
what does this
mean to me?

A: For customers who rely on the TZ environment variable for the
DST
information, they will get outdated DST information for 2007 and
beyond (i.e.,
they will get DST information according to the previous system).
Microsoft is
currently working on a fix for this issue and will post
information about its
availability on the Visual Studio Support page. In the interim,
developers are
advised to test their applications to determine the impact of
the DST update
on their applications. This issue is also fixed in Visual Studio
code name
"Orcas".
Support page:
http://msdn2.microsoft.com/en-us/vstudio/aa718682.aspx
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Need help with range operator

2006-03-17 Thread Dial, Joe

Hi,
When I read the first post, I remembered seeing that somewhere before.
Then, I was amazed to see the "this is not what the range operator was
meant to do." 

So, I looked for it.  Found it in chapter 6 of the Perl Cookbook. Its
Recipe 6.8.
See this URL: http://www.unix.org.ua/orelly/perl/cookbook/ch06_09.htm

I don't understand exactly why the original posted code doesn't work,
but is remarkably
similar to that recipe.

Just had to weigh in...

Joe Dial
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Craig Cardimon
Sent: Friday, March 17, 2006 10:35 AM
To: activeperl@listserv.ActiveState.com
Cc: perl-win32-users@listserv.ActiveState.com
Subject: Re: Need help with range operator

Thanks for the replies, folks! I got all kinds of responses.

I've seen a "here's one way to do it," a "we could use more information
on what you're trying to do," and a "this is not what the range operator
was meant to do."

It's kind of fascinating, really. List members use perl for different
tasks, and our ideas vary a lot, it seems, on how perl should be used.

Keeps things from getting boring.

-- Craig



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0611-2, 03/17/2006
Tested on: 3/17/2006 10:35:10 AM
avast! - copyright (c) 1988-2004 ALWIL Software.
http://www.avast.com




___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Regular expression to test for numeric values

2004-04-01 Thread Dial Joe

How about this (direct from "The Perl Cookbook"[1])  ??


warn "has nondigits"if /\D/;
warn "not a natural number" unless /^\d+$/; # rejects -3
warn "not an integer"   unless /^-?\d+$/;   # rejects +3
warn "not an integer"   unless /^[+-]?\d+$/;
warn "not a decimal number" unless /^-?\d+\.?\d*$/; # rejects .2
warn "not a decimal number" unless /^-?(?:\d+(?:\.\d*)?|\.\d+)$/;
warn "not a C float"
   unless /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/;

The cookbook is the first place I look for this kind of stuff.
HTH,
Joe Dial

[1] 
"Perl Cookbook 
Tips and Tricks for Perl Programmers"
By Tom Christiansen, Nathan Torkington
1st Edition August 1998 
www.oreilly.com 
ISBN: 1-56592-243-3

Current Version is:
"Perl Cookbook, 2nd Edition"
By Tom Christiansen, Nathan Torkington
2nd Edition August 2003 
ISBN: 0-596-00313-7
964 pages, $49.95 US, $77.95 CA, £35.50 UK 

-Original Message-
From: Motter, Jeffrey D [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 01, 2004 1:40 PM
To: Perl-Win32-Users
Subject: Regular expression to test for numeric values


I've read the FAQ's on this, but they don't seem to answer the question.

I have a variable that could contain any value( alpha, alpha-numeric, or
numeric). If the value is NOT numeric, I need to change the variables' value
to "0"( as in zero ).

Examples:
$txtype="2.314";   # is numeric, so keep the value
$txtype="-2.314";  # is numeric, so keep the value
$txtype="7";   # is numeric, so keep the value
$txtype="-7";  # is numeric, so keep the value
$txtype="2.31.4";  # is not numeric, so change the value to 0
$txtype="7-7"; # is not numeric, so change the value to 0
$txtype="UNKNOWN"; # is not numeric, so change the value to 0
$txtype="7+E09";   # is not numeric( even though it really is ), so change
the value to 0


My guess is that I need a regex that will match on any character that is:
not 0-9 
or 
more than one "." 
or 
more than one "-" 
or if "-" is not the first character of the string

Any ideas? Is it possible to do without using additional modules?

Thanks!

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: question about grep

2003-02-13 Thread Dial Joe

I'm gonna de-lurk for this one.
If you look at Peter's example, you will note that grep applies a block-or-something 
to a list and returns a list.
You are applying it to the file name, not the contents.  Perl grep doesn't read files.
If this wasn't the win32 perl list, I would just advise that you really want the 
shell's grep 
[ like $lines = `grep "^Status" $project_file` to get the Status line(s) from one file 
]

Strictly within perl, you would need to open the file and snarf in its contents  to 
grep.
Maybe it would look like this (off the cuff, if errors, please point them out, to add 
value for readers):

 open (IFILE, "<$project_file" ) or die "useful message here:$!";
 @lines = grep /^Status/, ;
 close (IFILE);
 #  At this point, @lines has all the lines from $project_file that start with Status.
 #  If these files are HUGE, it might be better to roll your own match loop with while 
() {...}

HTH,
Joe Dial


-Original Message-
From: Hawley, Eric [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, February 13, 2003 1:49 PM
To: 'Peter Guzis'; Perl-Win32 (E-mail)
Subject: RE: question about grep


I tried what you did suggested and it only pulled out the word Status, here
is the code below;

#location contains the path for the report to be stored
$report_location = $location;
$report_location =~ s/\//\\/;
$report_location = "$report_location" . "\\Reports";
unless( -e $report_location) ){
  mkdir( $report_location ) or die "died creating Report Directory";
}
  
#open Report HTML file
open( FILE, "> $report_location\\$year_$month_$date_Report.htm" ) or die
"Dead creating Report";
#print intial html to report file
print FILE
"\n\n$year_$month_$date_report\n\n\n
";
  
#file paths include paths to the files, that Status should be greped from
#ex) C:\\Test.htm
foreach $project_file ( @file_paths ){
  #grep Status line from $project_file 
  @status_line = grep /^Status/, $project_file;
}
print FILE "\n\n";
close(FILE);


Hope this can point to any failures.

Thanks
Eric

--

-Original Message-
From: Peter Guzis [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003 1:33 PM
To: Perl-Win32 (E-mail)
Subject: RE: question about grep


@matches = grep /^Status/, @data;

If this doesn't do it you might consider posting some sample data.

Peter Guzis
Web Administrator, Sr.
ENCAD, Inc.
- A Kodak Company
email: [EMAIL PROTECTED]
www.encad.com 

-Original Message-
From: Hawley, Eric [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003 10:23 AM
To: Perl-Win32 (E-mail)
Subject: question about grep


I got a question concerning grep.  I would like to use it to pull out all
full lines of text, that starts with the word "Status", from a list of
files.  I am not really too experienced with using Metacharacters and
Metasymbols and do not know how to go about doing this with grep.  Can
someone help me out with this?

Thanks in advanced
Eric
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs