[27889] in Perl-Users-Digest
Perl-Users Digest, Issue: 9253 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 3 18:05:50 2006
Date: Sat, 3 Jun 2006 15:05:04 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 3 Jun 2006 Volume: 10 Number: 9253
Today's topics:
default value <nospam@home.com>
Re: default value <bart@nijlen.com>
Re: How to mark UTF-8 string as being UTF-8 <ynleder@nspark.org>
Re: How to mark UTF-8 string as being UTF-8 <ynleder@nspark.org>
Re: How to mark UTF-8 string as being UTF-8 <rvtol+news@isolution.nl>
Re: Howto share filehandles between threads? <zentara@highstream.net>
new CPAN modules on Sat Jun 3 2006 (Randal Schwartz)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 03 Jun 2006 13:11:49 GMT
From: "Nospam" <nospam@home.com>
Subject: default value
Message-Id: <pUfgg.1735$uP.380@newsfe2-gui.ntli.net>
does anyone know a command to leave the default value for a field in a
browser i.e something like field('value',); would something like this leave
the default value in?
------------------------------
Date: 3 Jun 2006 06:32:15 -0700
From: "Bart Van der Donck" <bart@nijlen.com>
Subject: Re: default value
Message-Id: <1149341535.307390.210370@f6g2000cwb.googlegroups.com>
Nospam wrote:
> does anyone know a command to leave the default value for a field in a
> browser i.e something like field('value',); would something like this leave
> the default value in?
This sounds (!) like an HTML question, please see alt.html. Maybe you
mean:
<input type="text" size="5" value="apple">
--
Bart
------------------------------
Date: Sat, 3 Jun 2006 12:19:08 +0200
From: Yohan N. Leder <ynleder@nspark.org>
Subject: Re: How to mark UTF-8 string as being UTF-8
Message-Id: <MPG.1eeb8089c7d5fa12989873@news.tiscali.fr>
In article <1149321710.483553.215980@u72g2000cwu.googlegroups.com>,
bart@nijlen.com says...
> Are you sure of that ? Maybe the web form didn't give you utf8 in the
> first place. As basic rule, the browser performs the form submission in
> the same charset as the webpage of the form, but only IF the sent
> characters can be represented in that charset. Setting the webpage of
> the form to "charset=utf-8" should help.
It's what I've done using http header and in html head too :
print "Content-type: text/html; charset=utf-8\n\n";
print "<meta http-equiv='Content-Type' content='text/html; charset=utf-
8'>";
> In my experience, Perl + utf8 = headache.
From what I've seen until now, it seems to be an headache when you want
to manage several charset. So, it's because of that I've decided to
switch in full toward UTF-8 : it means, about literal strings ("use
utf8;" and taking care to use an unicode-enabled editor), treatment
("require 5.8.0;"), browser outputs ("binmode(STDOUT, ":utf8");" and
content-type + meta tag above), browser inputs (the subject of the
current thread), files i/o (use open ':utf8';).
> But I've a feeling you're
> rather looking at a form encoding issue in stead of a Perl issue.
> Encoding at CGI/browser level (tip):
> http://ppewww.ph.gla.ac.uk/~flavell/charset/form-i18n.html
Already read this page. Unless, mistake, no.
> Encoding at Perl level:
> http://perldoc.perl.org/Encode.html
> http://perldoc.perl.org/Encode/Supported.html
Crtainly here, I'll found the solution to mak the input text values as
UTF-8... But', I have to read these page : not done, yet.
------------------------------
Date: Sat, 3 Jun 2006 12:20:18 +0200
From: Yohan N. Leder <ynleder@nspark.org>
Subject: Re: How to mark UTF-8 string as being UTF-8
Message-Id: <MPG.1eeb80d050c45948989874@news.tiscali.fr>
In article <e5q78d.fs.1@news.isolution.nl>, rvtol+news@isolution.nl
says...
> Yohan N. Leder schreef:
>
> > how to do to mark these string as being UTF-8
>
> See `perldoc Encode`.
>
>
Thanks. Started to read. Not sure about understanding : I have to do
real trials to well understood.
------------------------------
Date: Sat, 3 Jun 2006 14:02:10 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: How to mark UTF-8 string as being UTF-8
Message-Id: <e5s50p.1f0.1@news.isolution.nl>
Yohan N. Leder schreef:
> rvtol:
>> Yohan N. Leder:
>>> how to do to mark these string as being UTF-8
>>
>> See `perldoc Encode`.
>
> Thanks. Started to read. Not sure about understanding : I have to do
> real trials to well understood.
You shouldn't fall back on trials, just read again until you understand.
The article talks about octets, bytes and characters; see the
TERMINOLOGY section.
Perl's utf8 is not the same as UTF-8, but don't worry about the
difference.
To set the UTF-8/utf8 flag on for a $string, you can use $string =
decode_utf8( $string ), but read the CAVEAT section on decode(), about
the case where $string contains only ASCII data.
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Sat, 03 Jun 2006 11:50:14 GMT
From: zentara <zentara@highstream.net>
Subject: Re: Howto share filehandles between threads?
Message-Id: <2bt2825j727hfnal98fo02s6jn71utesbk@4ax.com>
On Fri, 02 Jun 2006 08:23:07 -0500, Sako <riderjunk@NOSPAMdls.net>
wrote:
>Any help on how to share a filehandle opened in a thread would be
>GREATLY appreciated.
Hi, BrowserUk figured it out on perlmonks awhile back, what you
need to do basically is get the fileno of the filehandle, and pass
it around through shared variables.
See:
http://perlmonks.org?node_id=395513
Also of interest may be
http://perlmonks.org?node_id=501725
Here is a little demo I worked up for myself.
#!/usr/bin/perl
use warnings;
use strict;
use threads;
use threads::shared;
my %shash;
#share(%shash); #will work only for first level keys
my %hash;
share ($shash{'go'});
share ($shash{'fileno'});
share ($shash{'pid'});
share ($shash{'die'});
$shash{'go'} = 0;
$shash{'fileno'} = -1;
$shash{'pid'} = -1;
$shash{'die'} = 0;
$hash{'thread'} = threads->new(\&work);
$shash{'go'} = 1;
sleep 1; # cheap hack to allow thread to setup
my $fileno = $shash{'fileno'};
open (my $fh, "<&=$fileno") or warn "$!\n";
while ( <$fh> ){ print "In main-> $_"; }
#wait for keypress to keep main thread alive
<>;
# control-c to exit
##################################################################
sub work{
$|++;
while(1){
if($shash{'die'} == 1){ return };
if ( $shash{'go'} == 1 ){
my $pid = open(FH, "top -b |" ) or warn "$!\n";
my $fileno = fileno(FH);
print "fileno->$fileno\n";
$shash{'fileno'} = $fileno;
$shash{'go'} = 0; #turn off self before returning
}else
{ sleep 1 }
}
}
#####################################################################
__END__
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
------------------------------
Date: Sat, 3 Jun 2006 04:42:06 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sat Jun 3 2006
Message-Id: <J09p26.FFA@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
Catalyst-Plugin-Authentication-Credential-JugemKey-0.02
http://search.cpan.org/~mizzy/Catalyst-Plugin-Authentication-Credential-JugemKey-0.02/
JugemKey authentication plugin for Catalyst
----
DBIx-JSON-0.02
http://search.cpan.org/~yosty/DBIx-JSON-0.02/
Perl extension for creating JSON from existing DBI datasources
----
POE-Component-SNMP-1.03
http://search.cpan.org/~rdb/POE-Component-SNMP-1.03/
POE interface to Net::SNMP
----
Curses-1.14
http://search.cpan.org/~giraffed/Curses-1.14/
terminal screen handling and optimization
----
Digest-SHA-PurePerl-5.40
http://search.cpan.org/~mshelor/Digest-SHA-PurePerl-5.40/
Perl implementation of SHA-1/224/256/384/512
----
Digest-SHA-5.40
http://search.cpan.org/~mshelor/Digest-SHA-5.40/
Perl extension for SHA-1/224/256/384/512
----
Test-WWW-Simple-0.24
http://search.cpan.org/~mcmahon/Test-WWW-Simple-0.24/
Test Web applications using TAP
----
Proc-Queue-1.18
http://search.cpan.org/~salva/Proc-Queue-1.18/
limit the number of child processes running
----
Net-DNSBL-MultiDaemon-0.17
http://search.cpan.org/~miker/Net-DNSBL-MultiDaemon-0.17/
multi DNSBL prioritization
----
Net-Connection-Sniffer-0.12
http://search.cpan.org/~miker/Net-Connection-Sniffer-0.12/
gather stats on network connections
----
GD-Tiler-0.10
http://search.cpan.org/~darnold/GD-Tiler-0.10/
package to aggregate images into a single tiled image via GD
----
Net-Connection-Sniffer-0.11
http://search.cpan.org/~miker/Net-Connection-Sniffer-0.11/
gather stats on network connections
----
Excel-Template-0.26
http://search.cpan.org/~rkinyon/Excel-Template-0.26/
Excel::Template
----
Module-Dependency-1.81
http://search.cpan.org/~timb/Module-Dependency-1.81/
Collection of modules for examining dependencies between parents and children, like Perl files
----
CGI-PathParam-0.04
http://search.cpan.org/~yoshida/CGI-PathParam-0.04/
Add the feature of parsing path_info to CGI.
----
Net-Connection-Sniffer-0.10
http://search.cpan.org/~miker/Net-Connection-Sniffer-0.10/
gather stats on network connections
----
ACH-Generator-0.01
http://search.cpan.org/~cpkois/ACH-Generator-0.01/
Generates an ACH formatted file from an ACH perl object
----
ACH-Parser-0.01
http://search.cpan.org/~cpkois/ACH-Parser-0.01/
Parse an ACH formatted file to ACH perl object
----
ACH-0.01
http://search.cpan.org/~cpkois/ACH-0.01/
ACH perl object
----
Net-FeedBurner-0.06
http://search.cpan.org/~sock/Net-FeedBurner-0.06/
The great new Net::FeedBurner!
----
Net-oRTP-0.02
http://search.cpan.org/~njh/Net-oRTP-0.02/
Perl interface to the oRTP C library
----
Net-SDP-0.04
http://search.cpan.org/~njh/Net-SDP-0.04/
Session Description Protocol (rfc2327)
----
JavaScript-Lint-0.01
http://search.cpan.org/~hdm/JavaScript-Lint-0.01/
Check JavaScript code for problems
----
Email-Valid-0.16
http://search.cpan.org/~rjbs/Email-Valid-0.16/
Check validity of Internet email addresses
----
Template-Stash-Encode-0.01
http://search.cpan.org/~zigorou/Template-Stash-Encode-0.01/
Encode charactor code on stash variables
----
Catalyst-Plugin-Authentication-Credential-JugemKey-0.01
http://search.cpan.org/~mizzy/Catalyst-Plugin-Authentication-Credential-JugemKey-0.01/
JugemKey authentication plugin for Catalyst
----
SVN-Agent-0.01
http://search.cpan.org/~bosu/SVN-Agent-0.01/
simple svn manipulation.
----
PAR-0.94
http://search.cpan.org/~smueller/PAR-0.94/
Perl Archive Toolkit
----
Mail-Karmasphere-Client-1.16
http://search.cpan.org/~shevek/Mail-Karmasphere-Client-1.16/
Client for Karmasphere Reputation Server
----
HTML-Template-Compiled-0.65
http://search.cpan.org/~tinita/HTML-Template-Compiled-0.65/
Template System Compiles HTML::Template files to Perl code
----
InSilicoSpectro-0.9.22
http://search.cpan.org/~alexmass/InSilicoSpectro-0.9.22/
Open source Perl library for proteomics
----
FEAR-API-0.487.3
http://search.cpan.org/~xern/FEAR-API-0.487.3/
Web Scraping Zen
----
Plagger-0.7.2
http://search.cpan.org/~miyagawa/Plagger-0.7.2/
Pluggable RSS/Atom Aggregator
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
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 9253
***************************************