[28813] in Perl-Users-Digest
Perl-Users Digest, Issue: 57 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jan 21 03:05:55 2007
Date: Sun, 21 Jan 2007 00:05:05 -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, 21 Jan 2007 Volume: 11 Number: 57
Today's topics:
Re: Can't get output from pipe with autoflush on <stahl.karl@gmail.com>
Re: Could someone help me with this source code? <joe@inwap.com>
Re: How much more money can I make using Perl over C++? <DJStunks@gmail.com>
Re: I/O open() <novafyre@hotmail.com>
new CPAN modules on Sun Jan 21 2007 (Randal Schwartz)
problems cgi and sendmail <john.swilting@wanadoo.fr>
Re: problems cgi and sendmail <john.swilting@wanadoo.fr>
Re: Search pattern not terminated at (Spreadsheet::Read <awkster@yahoo.com>
Re: Win32 vs UNIX sl123@netherlands.area
Re: Win32 vs UNIX <vilain@spamcop.net>
Re: Win32 vs UNIX <spamtrap@dot-app.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 20 Jan 2007 21:57:57 -0800
From: "Ishmael" <stahl.karl@gmail.com>
Subject: Re: Can't get output from pipe with autoflush on
Message-Id: <1169359077.266975.117910@q2g2000cwa.googlegroups.com>
Thanks for the help! The Expect module is fantastic!
------------------------------
Date: Sun, 21 Jan 2007 00:02:02 -0800
From: Joe Smith <joe@inwap.com>
Subject: Re: Could someone help me with this source code?
Message-Id: <m8ydnV0AoeZggC7YnZ2dnUVZ_ozinZ2d@comcast.com>
Caduceus wrote:
> I need to know how to specify Mozilla thunderbird as the email client
That's a Windows thing, not a Perl thing.
Go to the section in Windows where the default email client is set
and change it to Thunderbird.
------------------------------
Date: 20 Jan 2007 15:32:02 -0800
From: "DJ Stunks" <DJStunks@gmail.com>
Subject: Re: How much more money can I make using Perl over C++?
Message-Id: <1169335922.625319.284660@l53g2000cwa.googlegroups.com>
sl123@netherlands.area wrote:
> Hi all,
>
> I'm thinking of changing programming flavors as a career change.
> Was wondering how Perl jobs compare to the others cash wise.
perhaps the results of this study commissioned last year by the Perl
Mongers will be of some use to you.
Perl Developers' Average Annual Salary
based on Average Quality of Questions Asked
+---------------------------------------------------+
$198,000| *|
| * |
| * |
S | * |
a | * |
l | * |
a | ** |
r | **** |
y | *** |
| **** |
| ****** |
| ************* |
$4,400| ************* |
+---------------------------------------------------+
Moronic Pedestrian Clever Trenchant
Average Question Quality
(c) 2006 pm.org
-jp
------------------------------
Date: Sun, 21 Jan 2007 00:03:30 -0700
From: Mark Donovan <novafyre@hotmail.com>
Subject: Re: I/O open()
Message-Id: <C1D85E52.9783%novafyre@hotmail.com>
Dondi,
I showed you two examples of *irony*. Here's an example of an ad hominem
attack.
On 1/19/07 15:53, "Sherm Pendley" <spamtrap@dot-app.org> wrote:
> Or better still, how about you just quit being such a crybaby and STFU
> already! Do you intend to piss and moan about every damned post your
> "enemy" makes from now on? What are you, five years old??? GROW UP.
Regards,
Mark Donovan
------------------------------
Date: Sun, 21 Jan 2007 05:42:12 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sun Jan 21 2007
Message-Id: <JC7EIC.1Itp@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.
Audio-PortAudio-0.01
http://search.cpan.org/~jdiepen/Audio-PortAudio-0.01/
----
Audio-PortAudio-0.02
http://search.cpan.org/~jdiepen/Audio-PortAudio-0.02/
portable audio I/O
----
Authen-Passphrase-0.005
http://search.cpan.org/~zefram/Authen-Passphrase-0.005/
hashed passwords/passphrases as objects
----
Bryar-3.0
http://search.cpan.org/~dcantrell/Bryar-3.0/
A modular, extensible weblog tool
----
Catalyst-Plugin-Upload-SHA1-0.01
http://search.cpan.org/~avar/Catalyst-Plugin-Upload-SHA1-0.01/
Compute SHA1 message digest of uploads
----
Compass-Bearing-0.04
http://search.cpan.org/~mrdvt/Compass-Bearing-0.04/
Convert angle to text bearing (aka heading)
----
Config-XPath-0.06
http://search.cpan.org/~pevans/Config-XPath-0.06/
a module for retrieving configuration data from XML files by using XPath queries
----
Data-Entropy-0.003
http://search.cpan.org/~zefram/Data-Entropy-0.003/
entropy (randomness) management
----
Date-JD-0.001
http://search.cpan.org/~zefram/Date-JD-0.001/
conversion between flavours of Julian Date
----
DateTime-Format-DB2-0.05
http://search.cpan.org/~jrobinson/DateTime-Format-DB2-0.05/
Parse and format DB2 dates and times
----
FindBin-libs-1.32
http://search.cpan.org/~lembark/FindBin-libs-1.32/
Locate and 'use lib' directories along the path of $FindBin::Bin to automate locating modules. Uses File::Spec and Cwd's abs_path to accomodate multiple O/S and redundant symlinks.
----
Fuse-0.09_1
http://search.cpan.org/~dpavlin/Fuse-0.09_1/
write filesystems in Perl using FUSE
----
Image-Pngslimmer-0.02
http://search.cpan.org/~acmcmen/Image-Pngslimmer-0.02/
slims (dynamically created) PNGs
----
Mac-iPhoto-Shell-0.13
http://search.cpan.org/~bdfoy/Mac-iPhoto-Shell-0.13/
----
Mac-iPhoto-Shell-0.14
http://search.cpan.org/~bdfoy/Mac-iPhoto-Shell-0.14/
----
Mac-iTerm-LaunchPad-1.001
http://search.cpan.org/~bdfoy/Mac-iTerm-LaunchPad-1.001/
----
Mac-iTerm-LaunchPad-1.002
http://search.cpan.org/~bdfoy/Mac-iTerm-LaunchPad-1.002/
----
Mac-iTerm-LaunchPad-1.004
http://search.cpan.org/~bdfoy/Mac-iTerm-LaunchPad-1.004/
----
Mac-iTerm-LaunchPad-1.005
http://search.cpan.org/~bdfoy/Mac-iTerm-LaunchPad-1.005/
----
Math-Interpolator-0.001
http://search.cpan.org/~zefram/Math-Interpolator-0.001/
interpolate between lazily-evaluated points
----
Math-Symbolic-0.507
http://search.cpan.org/~smueller/Math-Symbolic-0.507/
Symbolic calculations
----
Math-Symbolic-Custom-Transformation-2.00
http://search.cpan.org/~smueller/Math-Symbolic-Custom-Transformation-2.00/
Transform Math::Symbolic trees
----
Mirror-YAML-0.02
http://search.cpan.org/~adamk/Mirror-YAML-0.02/
Mirror Configuration and Auto-Discovery
----
Net-Random-1.3
http://search.cpan.org/~dcantrell/Net-Random-1.3/
get random data from online sources
----
OpenOffice-OODoc-2.032
http://search.cpan.org/~jmgdoc/OpenOffice-OODoc-2.032/
The Perl Open OpenDocument Connector
----
POE-Component-Jabber-2.0
http://search.cpan.org/~nperez/POE-Component-Jabber-2.0/
A POE Component for communicating over Jabber
----
POE-Filter-XML-0.33
http://search.cpan.org/~nperez/POE-Filter-XML-0.33/
A POE Filter for parsing XML
----
Perl-Critic-0.23
http://search.cpan.org/~thaljef/Perl-Critic-0.23/
Critique Perl source code for best-practices
----
PerlSpeak-0.50
http://search.cpan.org/~jkamphaus/PerlSpeak-0.50/
Perl Module for text to speach with festival, cepstral and others.
----
Template-Provider-DBI-0.01
http://search.cpan.org/~jrobinson/Template-Provider-DBI-0.01/
A class to allow retrieval of templates from a DB
----
Time-TT-0.002
http://search.cpan.org/~zefram/Time-TT-0.002/
Terrestrial Time and its realisations
----
WWW-Baidu-0.05
http://search.cpan.org/~agent/WWW-Baidu-0.05/
Perl interface for the www.baidu.com search engine
----
Web-Scaffold-0.07
http://search.cpan.org/~miker/Web-Scaffold-0.07/
build minimalist fancy web sites
----
XML-XPathScript-1.47
http://search.cpan.org/~yanick/XML-XPathScript-1.47/
a Perl framework for XML stylesheets
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.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
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: Sun, 21 Jan 2007 06:36:32 +0100
From: "john.swilting" <john.swilting@wanadoo.fr>
Subject: problems cgi and sendmail
Message-Id: <45b2fbdf$0$27401$ba4acef3@news.orange.fr>
Why the e-mail is not to send
Why on every page he indicates to me No recipient addresses found in header
my code
#!/usr/bin/perl -w
use strict;
use CGI qw(:standard escapeHTML);
use CGI::Carp qw(fatalsToBrowser);
my %Etats;
my @liste_param;
my $Ecran_actuel;
## hachage des documents et des fonctions
%Etats = (
'Défaut' =>\&document_de_garde,
'Chemises' =>\&chemise,
'Chaussures' =>\&chaussures,
'Passage à la caisse' =>\&passage_a_la_caisse,
'Carte' =>\&carte_de_credit,
'Commande' =>\&commande,
'Annnulation' =>\&document_de_garde,
);
$Ecran_actuel = param(".Etat") || "Défaut";
die "Pas d'écran pour $Ecran_actuel" unless $Etats{$Ecran_actuel};
## engendre le document courant
en_tete_standard();
while ( my ($nom_ecran,$fonction) = each %Etats){
$fonction->($nom_ecran eq $Ecran_actuel);
}
open(COURRIER, "|/usr/lib/sendmail -oi -t")
or die "fork de sendmail impossible : $!";
print COURRIER <<EOF;
From: $0(votre script cgi)
To:john.swilting\@wanadoo.fr
Subject: soumission de formulaire par courrier electronique
$Etats{'Defaut'};
$Etats{'Chemises'};
$Etats{'Chaussures'};
$Etats{'Passage à la caisse'};
$Etats{'Carte'};
$Etats{'Commande'};
@liste_param;
EOF
close(COURRIER)or die "je ne peux fermer sendmail";
pied_de_page_standard();
exit;
########################################################################
## fonctions d'en-tete, de pied de page, de menu #######################
########################################################################
sub en_tete_standard {
print header(),
start_html(-Title => "Chemises", -BGCOLOR=>"White");
print start_form(); ##start_multipart_form()
##s'il faut exporter des fichiers sur le reseau
}
sub pied_de_page_standard { print end_form(), end_html() }
sub menu_boutique {
print p(defaults("Vider mon caddie"),
vers_doc("Chemises"),
vers_doc("Chaussures"),
vers_doc("Passage à la caisse"));
}
#######################################################################
## sous-programmes pour chaque écran ##################################
#######################################################################
## le document par defaut
sub document_de_garde {
my $actif = shift;
return unless $actif;
print "<H1>salut!</H1>\n";
print "bienvenue dans notre magasin d'habillement!\n",
print "faites votre choix dans le menu ci-dessous.\n";
menu_boutique();
}
## document à partir duquel commander une chemise
sub chemise {
my $actif = shift;
my @tailles = qw(XL L M S);
my @couleurs = qw(Noire Blanche);
my ($taille, $couleur, $compte) =
(param("taille_chemises"), param("couleur_chemises"),
param("nombre_chemises"));
##verification des donnees reçus
if ($compte) {
$couleur = $couleurs[0]
unless grep { $_ eq $couleur } @couleurs;
$taille = $tailles[0]
unless grep {$_ eq $taille } @tailles;
param("couleur_chemises" , $couleur);
param("taille_chemises" , $taille);
}
unless ( $actif ) {
print hidden("taille_chemises") if $taille;
print hidden("couleur_chemises") if $couleur;
print hidden("nombre_chemises") if $compte;
return;
}
print h1("chemises");
print p("quelle chemise! cette petite merveille est\n","livree avec
toutes les options.doublure de luxe,\n",
"finitions avec toutes les options. doublure de luxe\n","finitions en
coton, et un col à en avoir les\n",
"Prix unitaire: 33.00 euros.");
print h2("options");
print p("nombre ?",textfield("nombre_chemises"));
print p("taille ?",popup_menu("taille_chemises",\@tailles ),
"couleur ?", popup_menu("couleur_chemises",\@couleurs ));
menu_boutique();
push(@liste_param,$taille);
push(@liste_param,$couleur);
push(@liste_param,$compte);
}
## document à partir duquel commander des chaussures
sub chaussures {
my $actif = shift;
my @tailles = qw(35 36 37 38 39 40 41 42 43 44 45 46 47 48);
my @couleurs = qw(Ivoire Noisette Ebene);
my ( $taille, $couleur, $compte) =
(param("taille_chaussures"), param("couleur_chaussures"),
param("nombre_chaussures"));
##verification des donnees reçus
if ( $compte ) {
$couleur = $couleurs[0]
unless grep { $_ eq $couleur } @couleurs;
$taille = $tailles[0]
unless grep { $_ eq $taille } @tailles;
param("couleur_chaussures",$couleur);
param("taille_chaussures", $taille);
}
unless ( $actif ) {
print hidden("taille_chaussures") if $taille;
print hidden("couleur_chaussures") if $couleur;
print hidden("nombre_chaussures") if $compte;
return;
}
print h1("chaussures");
print p("vous ne serez jamais aussi elegant que chausse de
ces\n", "souliers magnifiques\n",
"prix unitaires: 49.99 euros.");
print h2("options");
print p("nombre de paires?", textfield("nombre_chaussures"));
print p("pointure?", popup_menu("taille_chaussures",\@tailles));
print p("teinte?",popup_menu("couleur_chaussures",\@couleurs));
menu_boutique();
push(@liste_param,$taille);
push(@liste_param,$couleur);
push(@liste_param,$compte);
}
## document qui affiche la commande actuelle en attente de comfirmation
sub passage_a_la_caisse {
my $actif = shift;
return unless $actif;
print h1("confirmation de la commande");
print p("vous avez commande:");
print texte_commande();
print p("est-ce correct?\nn",
"choissisez «Carte» pour regler ces\n",
"objets, ou «chemises» ou\n",
"«chaussures» pour continuer vos courses.");
print p(vers_doc("Carte"),
vers_doc("Chemises"),
vers_doc("Chaussures"));
}
## document pour ollecter les informations relatives à la carte de credit
sub carte_de_credit {
my $actif = shift;
my @gadgets = qw(Nom Adresse1 Adresse2 Ville Code_postal Pays Telephone
Carte Expire_en);
unless ( $actif ) {
print map { hidden($_) } @gadgets;
return;
}
print pre ( p ("Nom\ : ",textfield("Nom")),
p ("Adresse\ : ",textfield("Adresse1")),
p (" ",textfield("Adresse2")),
p ("Ville\ : ",textfield("Ville")),
p ("Code Postal\ : ",textfield("Code_postal")),
p ("Pays\ : ",textfield("Pays")),
p ("Telephone\ : ",textfield("Teléphone")),
p ("Carte numéro\ : ",textfield("Carte")),
p ("Expire en\ : ",textfield("Expire_en")));
print p ( "Selectionner «Commande» pour commander\n",
"ces objets. selectionner «Annulation»\n");
print p ( vers_doc("Commande"), vers_doc("Annulation"));
push(@liste_param,$gadgets[0]);
push(@liste_param,$gadgets[1]);
push(@liste_param,$gadgets[2]);
push(@liste_param,$gadgets[3]);
push(@liste_param,$gadgets[4]);
push(@liste_param,$gadgets[5]);
push(@liste_param,$gadgets[6]);
push(@liste_param,$gadgets[7]);
push(@liste_param,$gadgets[8]);
}
## document pour terminer une commande
sub commande {
my $actif = shift;
unless ( $actif) {
return;
}
## ici on verifie les valeurs donnees pour la carte de credit
print h1("Commandé\ !");
print p("vous avez commandé ce qui suit:");
print texte_commande();
print p (defaults ("Retour au debut"));
}
## renvoie de l ' HTML pour la commande actuelle("vous avez ommande")
sub texte_commande {
my $html = '';
if ( param ("nombre_chemises")) {
$html .= p("vous avez commandé" , param("nombre_chemises"),
"chemises de taille", param("taille_chemises"),
" et de couleur " , param("couleur_chemises"),",");
}
if ( param ("nombre_chaussures")) {
$html .= p("vous avez comandé",param("nombre_chaussures"),
"paires de chaussures de pointures" ,
param("taille_chaussures"),
" et de teinte ", param ("couleur_chaussures"),".");
}
$html = p("Rien!") unless $html;
$html .= p("pour un prix total de ",calcule_prix());
return $html;
}
sub calcule_prix {
my $chemises = param("nombre_chemises") || 0 ;
my $chaussures = param("nombre_chaussures") || 0;
return sprintf("%.2f\ euros", $chemises * 33 + $chaussures *
49.99);
}
sub vers_doc { submit (-NAME => ".Etat", -VALUE => shift) }
------------------------------
Date: Sun, 21 Jan 2007 08:00:22 +0100
From: "john.swilting" <john.swilting@wanadoo.fr>
Subject: Re: problems cgi and sendmail
Message-Id: <45b30f92$0$25945$ba4acef3@news.orange.fr>
john.swilting wrote:
> Why the e-mail is not to send
> Why on every page he indicates to me No recipient addresses found in
> header
>
> my code
> #!/usr/bin/perl -w
>
> use strict;
> use CGI qw(:standard escapeHTML);
> use CGI::Carp qw(fatalsToBrowser);
>
> my %Etats;
> my @liste_param;
> my $Ecran_actuel;
>
> ## hachage des documents et des fonctions
>
> %Etats = (
> 'Défaut' =>\&document_de_garde,
> 'Chemises' =>\&chemise,
> 'Chaussures' =>\&chaussures,
> 'Passage à la caisse' =>\&passage_a_la_caisse,
> 'Carte' =>\&carte_de_credit,
> 'Commande' =>\&commande,
> 'Annnulation' =>\&document_de_garde,
> );
>
> $Ecran_actuel = param(".Etat") || "Défaut";
> die "Pas d'écran pour $Ecran_actuel" unless $Etats{$Ecran_actuel};
>
> ## engendre le document courant
>
> en_tete_standard();
>
> while ( my ($nom_ecran,$fonction) = each %Etats){
> $fonction->($nom_ecran eq $Ecran_actuel);
>
> }
> open(COURRIER, "|/usr/lib/sendmail -oi -t")
> or die "fork de sendmail impossible : $!";
> print COURRIER <<EOF;
> From: $0(votre script cgi)
> To:john.swilting\@wanadoo.fr
> Subject: soumission de formulaire par courrier electronique
>
> $Etats{'Defaut'};
> $Etats{'Chemises'};
> $Etats{'Chaussures'};
> $Etats{'Passage à la caisse'};
> $Etats{'Carte'};
> $Etats{'Commande'};
> @liste_param;
> EOF
> close(COURRIER)or die "je ne peux fermer sendmail";
> pied_de_page_standard();
> exit;
>
> ########################################################################
> ## fonctions d'en-tete, de pied de page, de menu #######################
> ########################################################################
>
> sub en_tete_standard {
> print header(),
> start_html(-Title => "Chemises", -BGCOLOR=>"White");
> print start_form(); ##start_multipart_form()
> ##s'il faut exporter des fichiers sur le reseau
> }
>
> sub pied_de_page_standard { print end_form(), end_html() }
>
> sub menu_boutique {
> print p(defaults("Vider mon caddie"),
> vers_doc("Chemises"),
> vers_doc("Chaussures"),
> vers_doc("Passage à la caisse"));
> }
>
> #######################################################################
> ## sous-programmes pour chaque écran ##################################
> #######################################################################
>
>
> ## le document par defaut
>
> sub document_de_garde {
> my $actif = shift;
> return unless $actif;
>
> print "<H1>salut!</H1>\n";
> print "bienvenue dans notre magasin d'habillement!\n",
> print "faites votre choix dans le menu ci-dessous.\n";
>
> menu_boutique();
> }
>
> ## document à partir duquel commander une chemise
>
> sub chemise {
> my $actif = shift;
> my @tailles = qw(XL L M S);
> my @couleurs = qw(Noire Blanche);
>
> my ($taille, $couleur, $compte) =
> (param("taille_chemises"), param("couleur_chemises"),
> param("nombre_chemises"));
>
> ##verification des donnees reçus
> if ($compte) {
> $couleur = $couleurs[0]
> unless grep { $_ eq $couleur } @couleurs;
> $taille = $tailles[0]
> unless grep {$_ eq $taille } @tailles;
> param("couleur_chemises" , $couleur);
> param("taille_chemises" , $taille);
> }
>
> unless ( $actif ) {
> print hidden("taille_chemises") if $taille;
> print hidden("couleur_chemises") if $couleur;
> print hidden("nombre_chemises") if $compte;
> return;
> }
>
> print h1("chemises");
> print p("quelle chemise! cette petite merveille est\n","livree avec
> toutes les options.doublure de luxe,\n",
> "finitions avec toutes les options. doublure de
> luxe\n","finitions en
> coton, et un col à en avoir les\n",
> "Prix unitaire: 33.00 euros.");
>
> print h2("options");
> print p("nombre ?",textfield("nombre_chemises"));
> print p("taille ?",popup_menu("taille_chemises",\@tailles ),
> "couleur ?", popup_menu("couleur_chemises",\@couleurs ));
>
> menu_boutique();
> push(@liste_param,$taille);
> push(@liste_param,$couleur);
> push(@liste_param,$compte);
> }
>
>
> ## document à partir duquel commander des chaussures
>
> sub chaussures {
> my $actif = shift;
> my @tailles = qw(35 36 37 38 39 40 41 42 43 44 45 46 47 48);
> my @couleurs = qw(Ivoire Noisette Ebene);
>
> my ( $taille, $couleur, $compte) =
> (param("taille_chaussures"), param("couleur_chaussures"),
> param("nombre_chaussures"));
>
> ##verification des donnees reçus
> if ( $compte ) {
> $couleur = $couleurs[0]
> unless grep { $_ eq $couleur } @couleurs;
> $taille = $tailles[0]
> unless grep { $_ eq $taille } @tailles;
> param("couleur_chaussures",$couleur);
> param("taille_chaussures", $taille);
> }
>
>
> unless ( $actif ) {
> print hidden("taille_chaussures") if $taille;
> print hidden("couleur_chaussures") if $couleur;
> print hidden("nombre_chaussures") if $compte;
> return;
> }
>
> print h1("chaussures");
> print p("vous ne serez jamais aussi elegant que chausse de
> ces\n", "souliers magnifiques\n",
> "prix unitaires: 49.99 euros.");
>
> print h2("options");
> print p("nombre de paires?", textfield("nombre_chaussures"));
> print p("pointure?", popup_menu("taille_chaussures",\@tailles));
> print p("teinte?",popup_menu("couleur_chaussures",\@couleurs));
>
> menu_boutique();
> push(@liste_param,$taille);
> push(@liste_param,$couleur);
> push(@liste_param,$compte);
>
> }
>
> ## document qui affiche la commande actuelle en attente de comfirmation
>
> sub passage_a_la_caisse {
> my $actif = shift;
>
> return unless $actif;
>
> print h1("confirmation de la commande");
> print p("vous avez commande:");
> print texte_commande();
> print p("est-ce correct?\nn",
> "choissisez «Carte» pour regler ces\n",
> "objets, ou «chemises» ou\n",
> "«chaussures» pour continuer vos courses.");
> print p(vers_doc("Carte"),
> vers_doc("Chemises"),
> vers_doc("Chaussures"));
>
> }
>
> ## document pour ollecter les informations relatives à la carte de credit
>
> sub carte_de_credit {
> my $actif = shift;
> my @gadgets = qw(Nom Adresse1 Adresse2 Ville Code_postal Pays
> Telephone
> Carte Expire_en);
>
> unless ( $actif ) {
> print map { hidden($_) } @gadgets;
> return;
> }
>
> print pre ( p ("Nom\ : ",textfield("Nom")),
> p ("Adresse\ : ",textfield("Adresse1")),
> p (" ",textfield("Adresse2")),
> p ("Ville\ : ",textfield("Ville")),
> p ("Code Postal\ : ",textfield("Code_postal")),
> p ("Pays\ : ",textfield("Pays")),
> p ("Telephone\ : ",textfield("Teléphone")),
> p ("Carte numéro\ : ",textfield("Carte")),
> p ("Expire en\ : ",textfield("Expire_en")));
>
> print p ( "Selectionner «Commande» pour commander\n",
> "ces objets. selectionner «Annulation»\n");
>
> print p ( vers_doc("Commande"), vers_doc("Annulation"));
> push(@liste_param,$gadgets[0]);
> push(@liste_param,$gadgets[1]);
> push(@liste_param,$gadgets[2]);
> push(@liste_param,$gadgets[3]);
> push(@liste_param,$gadgets[4]);
> push(@liste_param,$gadgets[5]);
> push(@liste_param,$gadgets[6]);
> push(@liste_param,$gadgets[7]);
> push(@liste_param,$gadgets[8]);
> }
>
> ## document pour terminer une commande
>
> sub commande {
> my $actif = shift;
>
> unless ( $actif) {
> return;
> }
>
> ## ici on verifie les valeurs donnees pour la carte de credit
>
> print h1("Commandé\ !");
> print p("vous avez commandé ce qui suit:");
> print texte_commande();
>
> print p (defaults ("Retour au debut"));
> }
>
> ## renvoie de l ' HTML pour la commande actuelle("vous avez ommande")
>
> sub texte_commande {
> my $html = '';
>
> if ( param ("nombre_chemises")) {
> $html .= p("vous avez commandé" , param("nombre_chemises"),
> "chemises de taille", param("taille_chemises"),
> " et de couleur " , param("couleur_chemises"),",");
> }
> if ( param ("nombre_chaussures")) {
> $html .= p("vous avez comandé",param("nombre_chaussures"),
> "paires de chaussures de pointures" ,
> param("taille_chaussures"),
> " et de teinte ", param ("couleur_chaussures"),".");
> }
> $html = p("Rien!") unless $html;
> $html .= p("pour un prix total de ",calcule_prix());
> return $html;
> }
>
> sub calcule_prix {
> my $chemises = param("nombre_chemises") || 0 ;
> my $chaussures = param("nombre_chaussures") || 0;
> return sprintf("%.2f\ euros", $chemises * 33 + $chaussures *
> 49.99);
> }
>
> sub vers_doc { submit (-NAME => ".Etat", -VALUE => shift) }
Pine does not work
sendmail is not ok
It is maybe necessary to use Net::SMTP
------------------------------
Date: 20 Jan 2007 15:49:43 -0800
From: "Jorge" <awkster@yahoo.com>
Subject: Re: Search pattern not terminated at (Spreadsheet::Read example)
Message-Id: <1169336983.784283.14400@51g2000cwl.googlegroups.com>
Paul wrote:
> The syntax is wrong. I'm not sure what // is supposed to be doing, but
> whatever it is, it's wrong :)
You are correct. Since my posting, I have tracked down that the // is
the Perl 6 construct for defined-or, not a set of pattern delimiters as
I had presumed. Now, I have to re-write that portion of code so it
plays in Perl 5.8.8 or look for a patch to Perl 5.8.8.
Thank you
Jorge
------------------------------
Date: Sat, 20 Jan 2007 15:04:28 -0800
From: sl123@netherlands.area
Subject: Re: Win32 vs UNIX
Message-Id: <gn75r2thaupn7ao5en1j7ak22kodod0k6g@4ax.com>
On Sat, 20 Jan 2007 17:29:19 -0500, Sherm Pendley <spamtrap@dot-app.org> wrote:
>fatwallet961@yahoo.com writes:
>
>> is perl code tested OK in win32 platform will 100% or 99% under UNIX?
>>
>> how likely there is compatibility happens?
>
>That's entirely up to you. If you've used Windows-specific APIs like COM,
Can you explain this. Are you saying windows modules? Or do you mean referenced from
Perl code.. COM api's? Can I reference from Perl Unix api's, or are you joking?
<snip>
>sherm--
------------------------------
Date: Sat, 20 Jan 2007 15:21:37 -0800
From: Michael Vilain <vilain@spamcop.net>
Subject: Re: Win32 vs UNIX
Message-Id: <vilain-534C1A.15213720012007@comcast.dca.giganews.com>
In article <gn75r2thaupn7ao5en1j7ak22kodod0k6g@4ax.com>,
sl123@netherlands.area wrote:
> On Sat, 20 Jan 2007 17:29:19 -0500, Sherm Pendley <spamtrap@dot-app.org>
> wrote:
>
> >fatwallet961@yahoo.com writes:
> >
> >> is perl code tested OK in win32 platform will 100% or 99% under UNIX?
> >>
> >> how likely there is compatibility happens?
> >
> >That's entirely up to you. If you've used Windows-specific APIs like COM,
> Can you explain this. Are you saying windows modules? Or do you mean
> referenced from Perl code.. COM api's? Can I reference from Perl Unix api's, or are you
> joking?
> <snip>
> >sherm--
AFAIK, the APIs for things like network and file manipulation extensions
(e.g. some CPAN modules) depend on a specific OS. I don't think you'll
get Solaris' ACLs to work using that module. Nor will specific calls to
the COM object which doesn't exist on UNIX.
I don't know what base perl does with system() or passthru() on each OS.
That's something that's might be non-portable as well.
I don't know the humor quotient in this group, but I say the responder
was 100% serious.
--
DeeDee, don't press that button! DeeDee! NO! Dee...
------------------------------
Date: Sun, 21 Jan 2007 00:45:45 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Win32 vs UNIX
Message-Id: <m2bqktvsom.fsf@Sherm-Pendleys-Computer.local>
Michael Vilain <vilain@spamcop.net> writes:
> In article <gn75r2thaupn7ao5en1j7ak22kodod0k6g@4ax.com>,
> sl123@netherlands.area wrote:
>
>> On Sat, 20 Jan 2007 17:29:19 -0500, Sherm Pendley <spamtrap@dot-app.org>
>> wrote:
>>
>> >fatwallet961@yahoo.com writes:
>> >
>> >> is perl code tested OK in win32 platform will 100% or 99% under UNIX?
>> >>
>> >> how likely there is compatibility happens?
>> >
>> >That's entirely up to you. If you've used Windows-specific APIs like COM,
>> Can you explain this. Are you saying windows modules? Or do you mean
>> referenced from Perl code.. COM api's? Can I reference from Perl Unix api's, or are you
>> joking?
>> <snip>
>> >sherm--
>
> AFAIK, the APIs for things like network and file manipulation extensions
> (e.g. some CPAN modules) depend on a specific OS. I don't think you'll
> get Solaris' ACLs to work using that module. Nor will specific calls to
> the COM object which doesn't exist on UNIX.
>
> I don't know what base perl does with system() or passthru() on each OS.
> That's something that's might be non-portable as well.
>
> I don't know the humor quotient in this group, but I say the responder
> was 100% serious.
Completely serious. You can't reasonably expect code that uses a module such
as Win32::Registry, Win32::OLE, or Wx::ActiveX to run on a machine that has
neither a registry, OLE support, nor ActiveX controls.
More subtly, while the system() function itself is portable, consider the
tools you might run with it - system('dir c:\') is not a portable use of the
system() function.
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.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 V11 Issue 57
*************************************