[26605] in Perl-Users-Digest
Perl-Users Digest, Issue: 8717 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 1 21:06:43 2005
Date: Thu, 1 Dec 2005 18:06:12 -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 Thu, 1 Dec 2005 Volume: 10 Number: 8717
Today's topics:
ANNOUNCE: CGI::Session::Driver::oracle V 1.00 <ron@savage.net.au>
ANNOUNCE: Last chance to register for OSDC 2005 <simon@unisolve.com.au>
ANNOUNCE: Win32::GUI v1.03 <rmay@popeslane.clara.co.uk>
ASTM checksum <cNaOlSePbA@MvPeLtEsAtSaEr.com>
Re: ASTM checksum (Anno Siegel)
Re: ASTM checksum <cNaOlSePbA@MvPeLtEsAtSaEr.com>
Re: CGI file upload missing from STDIN <noreply@gunnar.cc>
Re: CGI file upload missing from STDIN <nospam@thanksanyway.org>
Re: CGI file upload missing from STDIN <nospam@thanksanyway.org>
Re: CGI file upload missing from STDIN <noreply@gunnar.cc>
Re: from a file to an array of words robic0
Re: Hash's Regex Transformation with Map robic0
Re: Help: String search in Windows 2000 doesn't find t <armingaud@noos.fr>
How to push some file to user, without show path of fil <marko@ginat.com>
Re: How to push some file to user, without show path of <glex_no-spam@qwest-spam-no.invalid>
Re: How to push some file to user, without show path of (Jamie)
Re: How to push some file to user, without show path of <tadmc@augustmail.com>
How to tell if a method exists <brian.miller@alcatel.com>
Re: How to tell if a method exists (Malcolm Dew-Jones)
Re: How to tell if a method exists <jeff@schwabcenter.com>
Is it needed to lock open file for write? <info@t-com.hr>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 28 Nov 2005 09:34:50 GMT
From: Ron Savage <ron@savage.net.au>
Subject: ANNOUNCE: CGI::Session::Driver::oracle V 1.00
Message-Id: <IqqCrw.v08@zorch.sf-bay.org>
The pure Perl module CGI::Session::Driver::oracle V 1.00
is available immediately from CPAN,
and from http://savage.net.au/Perl-modules.html.
On-line docs, and a *.ppd for ActivePerl are also
available from the latter site.
This module allows you to use Oracle to store sessions managed by CGI::Session.
------------------------------
Date: Wed, 30 Nov 2005 17:50:11 +1100
From: Simon Taylor <simon@unisolve.com.au>
Subject: ANNOUNCE: Last chance to register for OSDC 2005
Message-Id: <dmji4f$1bm7$1@otis.netspace.net.au>
OSDC 2005 is almost upon us.
If you haven't already registered, then you have until 4pm this Friday
to do so.
See http://www.osdc.com.au/registration/
Don't miss out on this unique and exciting Australian Open Source event
- which includes an "Introduction to Pugs: Perl 6 in Haskell" keynote
from Autrijus Tang
Regards,
Simon Taylor
------------------------------
Date: Tue, 29 Nov 2005 21:45:05 GMT
From: Robert May <rmay@popeslane.clara.co.uk>
Subject: ANNOUNCE: Win32::GUI v1.03
Message-Id: <Iqqt89.1Hvq@zorch.sf-bay.org>
I am please to announce that v1.03 of Win32::GUI is available for
download from SourceForge.
Win32::GUI is a Perl extension allowing creation of native Win32 GUI
applications.
MORE INFORMATION
Project Homepage:
http://perl-win32-gui.sourceforge.net/
Project summary and download:
http://sourceforge.net/projects/perl-win32-gui/
Release notes:
http://sourceforge.net/project/shownotes.php?group_id=16572&release_id=373056
RELEASE SUMMARY
This is a summary of changes between Win32-GUI V1.02 and V1.03
See the CHANGELOG file in the distribution for the
full detail.
V1.03 is primarily a bug-fix release.
New Features in V1.03
=====================
+ New methods:
- Win32::GUI::DC StretchBlt
- Win32::GUI GetParent UserData
+ New events:
- none
+ New Documentation:
- Win32::GUI::RichEdit SetCharFormat GetCharFormat SetEventMask
- Win32::GUI::GetAsyncKeyState
- Win32::GUI::Timer and all Timer methods
- various other minor documentation corrections and enhancements
+ Other New things
- Added Version information to GUI.dll: right-click to see Version
- many tests added
- added listvew_drag_drop.pl to the samples demonstrating the use
of drag/drop with a ListView
- ImageList support is now complete under MinGW and Cygwin if
headers are recent enough (w32api V3.2 or higher)
- Updated all the Tutorial documentation and added tutorial
examples to the demos directory.
Fixes in V1.03
==============
+ Reported Bugs
- Fix to 4 item call to TrackPopupMenu. Tracker 1241830
- GUI.pm Fix to logic in Win32::GUI::Class::new for perl 5.8.6
and above. Tracker:1236053
- GUI.pm fixed Win32::GUI::Brush to return undef on failure
- GUI_messageloops.cpp: Tracker 1246429 fixed WM_CTLCOLORSTATIC
for handling readonly Edit controls
- Tooltip.xs, GUI.xs fixed Tooltip styles (Tracker: 1273134)
- GUI_MessageLoops.cpp change all mouse event handlers to use
GET_X_LPARAM and GET_Y_LPARAM rather than HIWORD and
LOWORD (Tracker: 1262098)
- GUI.xs fixed UnHook() to resolve perl 5.6/5.8 differences in
av_delete, causing a warning in perl 5.8 (Tracker: 1164766)
- GUI.xs: Changed DoModal's use of GetParent to
GetWindow(hwnd, GW_OWNER). (Tracker: 1165626)
- GUI_messageloops.cpp: Tracker:1236283 Change to WM_ERASEBACKGROUND
to allow -background to work with windows
+ Other Bugs
- GUI_messageloops.cpp: Fixed WM_CTLCOLOR* to use window class
background brush if there is one
- Richedit.xs fix SetCharCofmat/GetCharFormat option
- GUI.pm Timer fixes (Reini Urban)
- GUI.pm fixed Win32::GUI::DC::new() with no params to return a
correct object
- GUI_Constants.cpp: correct TMP_NONOTIFY to TPM_NONOTIFY
(aschwarz1309)
- Listbox.xs: fixed buffer overrun in GetText causing crash (Jez White)
- Combobox.xs: fixed buffer overrun in GetLBText causing crash
(Jez White)
- GUI.xs: fixed return value of GetAsyncKeyState
- Re-worked Win32::GUI::Timer package implementation. Now destruction
works correctly.
Contributors to this release:
=============================
Dan Dascalescu
Reini Urban
Jeremy White
aschwarz1309
Robert May
My thanks to all the others who have provided invaluable comments and
testing.
Rob. 22nd November 2005
------------------------------
Date: Tue, 29 Nov 2005 11:50:04 -0600
From: Spin <cNaOlSePbA@MvPeLtEsAtSaEr.com>
Subject: ASTM checksum
Message-Id: <11op568i1bsgp37@corp.supernews.com>
Could I have some help calculating a checksum for data transmission to a
lab machine? Here are the ASTM specs for the checksum:
The checksum is computed by adding the binary values of the characters,
keeping the least significant eight bits of the result. Each character
in the message text is added to the checksum (modulo 256). The checksum
is an integer represented by eight bits, it can be considered as two
groups of four bits. The groups of four bits are converted to the ASCII
characters of the hexadecimal representation. The two ASCII characters
are transmitted as the checksum, with the most significant character first.
This is a sample message, where '40' is the checksum and the checksum is
calculated using the 7 through to the <ETX>:
<STX>7L|1|N<CR><ETX>40<CR><LF>
Thus the checksum is calculated with this portion of the string:
7L|1|N<CR><ETX>
Of course the <CR> and <ETX> are sent as chr(13) and chr(03), not as
they appear in the email here.
I have been working with unpack and the % operator but to no avail.
TIA
Spin
------------------------------
Date: 30 Nov 2005 16:09:19 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: ASTM checksum
Message-Id: <dmkirf$7ki$2@mamenchi.zrz.TU-Berlin.DE>
Spin <cNaOlSePbA@MvPeLtEsAtSaEr.com> wrote in comp.lang.perl.misc:
> Anno Siegel wrote:
I didn't write what follows, I replied to it. Please watch the
attributions.
Anno
> >>
> >>For the string '7L|1|N<CR><ETX>' I get a checksum of 10, or hexadecimal
> >>0x0a, not the 0x40 (=64) that you say you get. How did you arrive at
> >>the value of 0x40?
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
------------------------------
Date: Wed, 30 Nov 2005 14:21:41 -0600
From: Spin <cNaOlSePbA@MvPeLtEsAtSaEr.com>
Subject: Re: ASTM checksum
Message-Id: <11os2ehl294g25f@corp.supernews.com>
Anno Siegel wrote:
> I didn't write what follows, I replied to it. Please watch the
> attributions.
>
> Anno
Right. I didn't get Jim's post in my news reader so I assumed it was you
(your post was next). Apologies,
Caleb
------------------------------
Date: Mon, 28 Nov 2005 20:30:43 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: CGI file upload missing from STDIN
Message-Id: <3v1475F13cr84U1@individual.net>
Mark wrote:
> I am beginning to experiment with HTML forms and CGI.
> I have an HTML form that uploads a file using the
> multipart/form-data encoding and the POST method.
> The form target is a simple Perl script which opens a file and
> writes out the data that it received via STDIN.
>
> The output file shows all the various inputs from my
> HTML form, except for the file stream. Any idea
> why the file isn't showing up?
>
> Of course, I will use the CGI module for any
> serious work.
Try the CPAN module CGI::UploadEasy. Among other things, it helps you
detect common mistakes in connection with file uploads.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Mon, 28 Nov 2005 11:30:55 -0800
From: "Mark" <nospam@thanksanyway.org>
Subject: Re: CGI file upload missing from STDIN
Message-Id: <FJSdna5yaup0xxbeRVn-pA@w-link.net>
Ok, I was editing my sample code for posting purposes,
and I discovered that the file input statement preceded my
opening FORM tag. Problem solved (buggy HTML form.)
Having a bunch of people telling me to look at my code
again was, in fact helpful. Thank you!
-Mark
------------------------------
Date: Mon, 28 Nov 2005 11:34:08 -0800
From: "Mark" <nospam@thanksanyway.org>
Subject: Re: CGI file upload missing from STDIN
Message-Id: <KMadneRlfaM3xhbeRVn-tg@w-link.net>
"Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote:
>
> Try the CPAN module CGI::UploadEasy. Among other things, it helps you
> detect common mistakes in connection with file uploads.
Good suggestion, thanks. Yes, I will definitely use the CGI:: module
if I proceed with this. So far I just wanted to do something educational
(which it was), and produce a quick proof-of-concept for a client.
-Mark
------------------------------
Date: Mon, 28 Nov 2005 20:41:32 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: CGI file upload missing from STDIN
Message-Id: <3v14reF13bljiU1@individual.net>
Mark wrote:
> Gunnar Hjalmarsson wrote:
>>Try the CPAN module CGI::UploadEasy. Among other things, it helps you
>>detect common mistakes in connection with file uploads.
>
> Good suggestion, thanks. Yes, I will definitely use the CGI:: module
> if I proceed with this.
Well, CGI::UploadEasy isn't part of "the" CGI:: module (assuming you are
referring to Lincoln Stein's modules). But it does make use of CGI.pm
for parsing the upload request.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Tue, 29 Nov 2005 01:27:49 -0800
From: robic0
Subject: Re: from a file to an array of words
Message-Id: <7n7oo1ptc03ra35ne6poqq50a88cod4bbn@4ax.com>
On Mon, 28 Nov 2005 13:34:41 +0100, "Dr.Ruud"
<rvtol+news@isolution.nl> wrote:
>ngoc schreef:
>> I want to compare two text(html) files. "diff" command in Linux
>> compares only by line.
>> In Perl, I can use "getlines" of FileHandle object and "split" later.
>> Is there a single function(method) to go from a file to an array of
>> words. Thanks
>
>Or normalize the files, and then use diff.
What do you mean by "normalize"?
------------------------------
Date: Tue, 29 Nov 2005 01:53:49 -0800
From: robic0
Subject: Re: Hash's Regex Transformation with Map
Message-Id: <t89oo11jm5vcbo2lkafq43lhek2403rsip@4ax.com>
On 28 Nov 2005 13:39:09 GMT, anno4000@lublin.zrz.tu-berlin.de (Anno
Siegel) wrote:
>Tad McClellan <tadmc@augustmail.com> wrote in comp.lang.perl.misc:
>> robic0 <> wrote:
>> > On 26 Nov 2005 12:47:57 GMT, Glenn Jackman <xx087@freenet.carleton.ca>
>> > wrote:
>> >
>> >>At 2005-11-25 10:49PM, Edward WIJAYA <ewijaya@singnet.com.sg> wrote:
>> >>> Hi all,
>> >>>
>> >>> How can I make my snippet below:
>> >>>
>> >>>
>> >>> $ perl -MData::Dumper -e '
>> >>> $h = {"A[TCG]GG 3" => foo, "CTG[AA] 2" => bar};
>> >>> %nh = map { my $k =~ s/\[[ATCG]+\]/S/g; $k=> $h->{$_} } (keys %{$h});
>> >>> print Dumper \%nh;'
>> >>
>> >>$k is undefined
>> >>
>> >> %nh = map { ($k = $_) =~ s/\[[ATCG]+\]/S/g; $k=> $h->{$_} } (keys %{$h});
>> > ^^
>> > Yeah but get the can't use global in "my ($k = $_)"
>>
>>
>> Did you try it?
>>
>> Did in not work when you did?
>
> my ( $k = $_) =~ ...
>
>does indeed complain about use of global $_ in "my".
>
> ( my $k = $_) =~ ...
>
>works.
>
>Anno
hehe...
------------------------------
Date: Wed, 30 Nov 2005 08:47:41 +0100
From: fda <armingaud@noos.fr>
Subject: Re: Help: String search in Windows 2000 doesn't find text in Windows XP: MS Word document SOLVED: binmode
Message-Id: <438d591c$0$445$79c14f64@nan-newsreader-05.noos.net>
Mark Clements wrote:
>
> Even a stopped clock tells the right time twice a day.
And even tells us when it does so : exactly at the time where it is stopped.
------------------------------
Date: Thu, 1 Dec 2005 18:17:38 +0100
From: "news.t-com.hr" <marko@ginat.com>
Subject: How to push some file to user, without show path of file?
Message-Id: <dmnb7e$53d$1@ss405.t-com.hr>
How to push some file to user, without show path of file?
------------------------------
Date: Thu, 01 Dec 2005 11:54:51 -0600
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: How to push some file to user, without show path of file?
Message-Id: <LNGjf.9$2_5.931@news.uswest.net>
news.t-com.hr wrote:
> How to push some file to user, without show path of file?
Hu?
Is this a hidden CGI/HTML question?
------------------------------
Date: Thu, 01 Dec 2005 20:03:56 GMT
From: nospam@geniegate.com (Jamie)
Subject: Re: How to push some file to user, without show path of file?
Message-Id: <Lucy1133467075108850xcdec8c@air.tunestar.net>
In: <dmnb7e$53d$1@ss405.t-com.hr>, "news.t-com.hr" <marko@ginat.com> wrote:
>How to push some file to user, without show path of file?
This isn't a perl question, but:
You sneak into his/her office (being very careful not to leave tracks)
and push the file into their lap. Do this when they're sitting down.
Then, quickly take a different route back, again, being careful not to leave
any tracks that might reveal the path you took to get there. The reason you
wait until they're sitting (ideally in the middle of some task) is so they cannot
immediately get up to follow you.
Jamie
--
http://www.geniegate.com Custom web programming
guhzo_42@lnubb.pbz (rot13) User Management Solutions
------------------------------
Date: Thu, 1 Dec 2005 15:54:50 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: How to push some file to user, without show path of file?
Message-Id: <slrndous9a.dgm.tadmc@magna.augustmail.com>
news.t-com.hr <marko@ginat.com> wrote:
> How to push some file to user, without show path of file?
print;
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 30 Nov 2005 13:59:59 -0500
From: Brian Miller <brian.miller@alcatel.com>
Subject: How to tell if a method exists
Message-Id: <438df6b0@news.alcatel.com>
Hello All,
I am attempting to find a way to see if a method exists within a
specific package. I cannot use the PACKAGE->can(method) because
it follows the class hierarchy and it is possible that the method
exists somewhere else. What I was hopping to do is to have a base class
that scans the class hierarchy of an object and executes (in a specific
order) a method (let's say post_init). This would eliminate the need
for each method to run through it's package @ISA array and execute the
parents version of the method. If anyone has a suggestion I would
greatly appreciate it.
Thanks
Brian Miller
brian.miller@alcatel.com
------------------------------
Date: 30 Nov 2005 14:13:33 -0700
From: yf110@victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: How to tell if a method exists
Message-Id: <438e240d$1@news.victoria.tc.ca>
Brian Miller (brian.miller@alcatel.com) wrote:
: Hello All,
: I am attempting to find a way to see if a method exists within a
: specific package. I cannot use the PACKAGE->can(method) because
: it follows the class hierarchy and it is possible that the method
: exists somewhere else. What I was hopping to do is to have a base class
: that scans the class hierarchy of an object and executes (in a specific
: order) a method (let's say post_init). This would eliminate the need
: for each method to run through it's package @ISA array and execute the
: parents version of the method. If anyone has a suggestion I would
: greatly appreciate it.
: Thanks
: Brian Miller
: brian.miller@alcatel.com
Localize the appropriate @ISA and then do the lookup.
The syntax of the following should be made prettier, but it illustrates
the point. The output from running the following shows that when
"can_no_isa" is called with the correct package (TWO) then the object
can't. The other package names are just to confirm that the routine is
doing the right thing.
I guess you could also check if the routine was defined in the package
hash but that didn't work in my quick example (!) so I gave up and just
tried the following instead.
#!perl
use strict;
sub can_no_isa
{
my ($pack,$meth,$obj) = @_;
no strict;
local @{"${pack}::ISA"} = ();
return $obj->can($meth);
}
package ONE;
sub try {'ta-dah!'}
package TWO;
our @ISA = qw(ONE);
package main;
my $obj = bless \my $x , 'TWO';
print 'obj can try = ' , $obj->can('try') , "\n";
print 'obj can_no_is try in THR = ' , can_no_isa('THR','try',$obj) , "\n";
print 'obj can_no_is try in TWO = ' , can_no_isa('TWO','try',$obj) , "\n";
print 'obj can_no_is try in ONE = ' , can_no_isa('ONE','try',$obj) , "\n";
------------------------------
Date: Wed, 30 Nov 2005 23:20:39 GMT
From: Jeffrey Schwab <jeff@schwabcenter.com>
Subject: Re: How to tell if a method exists
Message-Id: <btqjf.18$7b4.14525@twister.southeast.rr.com>
Brian Miller wrote:
> Hello All,
>
> I am attempting to find a way to see if a method exists within a
> specific package. I cannot use the PACKAGE->can(method) because
> it follows the class hierarchy and it is possible that the method
> exists somewhere else. What I was hopping to do is to have a base class
Let's call this base class BaseClass.
> that scans the class hierarchy of an object
Let's call this object Object, and its class ObjectClass. Is
ObjectClass a descendant of BaseClass? Also, I thought the problem with
PACKAGE->can(method) was that method might not be in the class
hierarchy, so why do you want to scan that hierarchy?
> and executes (in a specific
> order) a method (let's say post_init).
Do you mean the post_init method of each class in ObjectClass's hierarchy?
> This would eliminate the need
> for each method to run through it's package @ISA array and execute the
> parents version of the method.
....at the expense of having a method in BaseClass run through the same
set of classes. Or have I misunderstood?
------------------------------
Date: Thu, 1 Dec 2005 18:15:41 +0100
From: "news.t-com.hr" <info@t-com.hr>
Subject: Is it needed to lock open file for write?
Message-Id: <dmnb3o$4rd$1@ss405.t-com.hr>
Is it needed to lock open file for write?
use Fcntl qw(:flock);
open(FH, ">codes.txt") or die "can't open codes.txt $!";
flock(FH, LOCK_EX) or die "can't flock codes.txt $!";
Or is also good only to use command open
open(FH, ">codes.txt") or die "can't open codes.txt $!";
TNX
------------------------------
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 V10 Issue 8717
***************************************