[26548] in Perl-Users-Digest
Perl-Users Digest, Issue: 8690 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Nov 20 14:05:42 2005
Date: Sun, 20 Nov 2005 11:05:06 -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 Sun, 20 Nov 2005 Volume: 10 Number: 8690
Today's topics:
LWP::Useragent and Javascript function <francis@nospam.com>
Re: Module to handle substitution in error messages? <nobull@mail.com>
Re: sprintf formating <no@email.com>
Re: sprintf formating <tadmc@augustmail.com>
Re: sprintf formating <nobull@mail.com>
Re: Web based Image library recommendations <tuxedo@mailinator.com>
Re: Win32::GUI: Accessability <rm@nospam.popeslane.clara.co.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 20 Nov 2005 19:04:18 GMT
From: "Francis Sylvester" <francis@nospam.com>
Subject: LWP::Useragent and Javascript function
Message-Id: <SM3gf.2377$Hm2.2232@fe1.news.blueyonder.co.uk>
Dear all,
I'm trying to scrape a site with LWP::Useragent which contains a javascript
function (__doPostBack) within the links. From investigation - this appears
to be an ASP.NET function to validate the client. Does anybody know if a
Javascript module exists for perl? ...or if anybody is familiar with
scraping this function or could point me to a site with more info I'd really
appreciate it. The function appears to post an __EVENTTARGET and an
__EVENTARGUMENT to the server. I've tried setting these in the LWP header
but no joy.
Thanks,
Francis
------------------------------
Date: Sun, 20 Nov 2005 15:21:05 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Module to handle substitution in error messages?
Message-Id: <dlq492$kr4$1@slavica.ukpost.com>
Henry Law wrote:
> In previous programming projects, using languages other than Perl, I
> created a set of routines which managed the issuing of error messages.
> In summary my program would issue a call (speaking Perl now)
>
> write_error_message(203,"foo","zurb failed",$zurb_rc);
>
> In some file stored separately the error messages would be defined, with
> placeholders for the bits that would vary from one invocation to
> another; perhaps (I used XML but that's not essential)
> Is there a Message::Parameterise module, or something?
Consider Data::Phrasebook
------------------------------
Date: Sun, 20 Nov 2005 12:05:52 +0000
From: Brian Wakem <no@email.com>
Subject: Re: sprintf formating
Message-Id: <3ub750F10gct4U1@individual.net>
stig wrote:
> Hello,
> i need some help to format a value with sprintf.
> lets say i have the value: 1234567.8
>
> i would with, help of sprintf, like it too have a space every third digit,
> change the dot to a comma and round the decimals to 2 digits.
>
> i have come up with sprintf("%.2f", 1234567.8) which gives me: 1234567.80
>
> after that i have had no luck to make it look like: 1 234 567,80
> how should i write the sprintf format to acheive the above format?
I'm not 100% up to speed on sprintf, but I don't think you can do that with
just sprintf.
This will work though:
#!/usr/bin/perl
use strict;
my $val = 1234567.8;
$val = sprintf("%.2f", $val);
1 while $val =~ s/(.*\d)(\d\d\d)/$1 $2/;
$val =~ s/\./,/;
print "$val\n";
--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png
------------------------------
Date: Sun, 20 Nov 2005 08:46:54 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: sprintf formating
Message-Id: <slrndo132u.1l1.tadmc@magna.augustmail.com>
stig <_nospam_stigerikson@yahoo.se> wrote:
> i would with, help of sprintf, like it too have a space every third digit,
> change the dot to a comma and round the decimals to 2 digits.
sprintf() can help with the rounding part.
tr/// can help with transliterating characters.
The Perl FAQ shows how to insert a comma every 3 digits:
perldoc -q numbers
How can I output my numbers with commas added?
> i have come up with sprintf("%.2f", 1234567.8) which gives me: 1234567.80
So you have the rounding handled. Good.
> after that i have had no luck to make it look like: 1 234 567,80
> how should i write the sprintf format to acheive the above format?
Use the FAQ solution to insert commas, then change the characters
that you want changed with:
tr/,./ ,/; # comma->space and dot->comma
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 20 Nov 2005 15:16:07 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: sprintf formating
Message-Id: <dlq3vv$kqh$1@slavica.ukpost.com>
stig wrote:
> i have come up with sprintf("%.2f", 1234567.8) which gives me: 1234567.80
>
> after that i have had no luck to make it look like: 1 234 567,80
> how should i write the sprintf format to acheive the above format?
Sorry, sprintf can't do that.
perldoc -q commas
Note: I've always felt the wording of this FAQ is none too helpful for
people in countries where the natural character used to delmit thousands
is not a comma.
------------------------------
Date: Sun, 20 Nov 2005 16:30:30 +0100
From: Tuxedo <tuxedo@mailinator.com>
Subject: Re: Web based Image library recommendations
Message-Id: <dlq5il$ei$02$1@news.t-online.com>
I wrote:
> Thanks - it should keep me busy evaluating more applications than I
> want...
I did a qick evaluation of the all there was. Many links are broken but
these 3 seem interesting in case anyone is looking for the same:
http://www.spyderscripts.com/scripts/18.shtml
http://cgi.woscripts.com/photo_gallery.html
http://perl.bobbitt.ca/album/
------------------------------
Date: Sun, 20 Nov 2005 15:48:52 +0000
From: Rob <rm@nospam.popeslane.clara.co.uk>
Subject: Re: Win32::GUI: Accessability
Message-Id: <L9GdnTTiLOB1Bx3eRVnyjg@pipex.net>
Veli-Pekka Tätilä wrote:
> Hi Rob,
> Thanks for the clarifications in the other sections. As I don't have further
> comments to add to them, I've snipped everything but accessibility.
>
> Rob wrote:
> <grids and taborder>
>
>>appears that either the Win32::GUI wrapper or the underlying control
>>that is used is not honouring the WS_TABSTOP style correctly.
>
> Oh it would be good to know which. If it is the control's fault I reckon
> there's nothing you can do. APart from specifying a modified "default"
> window procedure, which might not be wise if people expect things to work
> exactly like they do using the Win32 API.
Win32::GUI::Grid is built on top an open source grid control, so we
would have the luxury of fixing it if we can find where the problems lie.
>>>Maybe the Win32::GUI could add certain controls in the tab order
>>>automatically. <snip> these controls ought to be in the tab
>>>order in the first place. <snip>
[snip]
>>The order is defined by the win32 api as the control creation order,
>>which in Win32::GUI is the object creation order.
>
> I see. This is a safe bet, in a way, but chances are the user may not wish
> to layout things in exactly the tab order, however. I know you can specify
> the tab order in the VC dialog editor explicitly, but can you change it in
> Win32::GUI?
Yes, by changing the object creation order.
Regards,
Rob.
--
Robert May
Win32::GUI, a perl extension for native Win32 applications
http://perl-win32-gui.sourceforge.net/
------------------------------
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 8690
***************************************