[29024] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 268 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 27 16:14:31 2007

Date: Tue, 27 Mar 2007 13:14:25 -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           Tue, 27 Mar 2007     Volume: 11 Number: 268

Today's topics:
        Event Handling? <ryanarossi@gmail.com>
    Re: Event Handling? <ryanarossi@gmail.com>
    Re: Event Handling? <mritty@gmail.com>
    Re: Event Handling? <paduille.4060.mumia.w+nospam@earthlink.net>
    Re: Executing awk from perl script (Greg Bacon)
    Re: FAQ 8.43 How do I open a file without blocking? xhoster@gmail.com
    Re: FAQ 8.43 How do I open a file without blocking? <brian.d.foy@gmail.com>
    Re: FAQ 8.48 How do I add the directory my program live <bik.mido@tiscalinet.it>
    Re: FAQ 8.48 How do I add the directory my program live <brian.d.foy@gmail.com>
        for bowie: truly terrific nntp server -  sopte polpeg - <jccowe@sasipnet.ws>
        fork,exec, and parallel processing <drew@sundawg.org>
    Re: fork,exec, and parallel processing xhoster@gmail.com
    Re: fork,exec, and parallel processing <someone@example.com>
        how to list all loaded modules of a perl program <fei.liu@gmail.com>
        how to make to transmit the parameters of a cgi between <john.swilting@wanadoo.fr>
    Re: how to make to transmit the parameters of a cgi bet anno4000@radom.zrz.tu-berlin.de
    Re: HTML::Mason and User site folders <caesar@miskatonic.edu>
    Re: is mod_perl better for CGI application? krakle@visto.com
    Re: is mod_perl better for CGI application? (Jamie)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 26 Mar 2007 11:36:30 -0700
From: "zm5" <ryanarossi@gmail.com>
Subject: Event Handling?
Message-Id: <1174934190.097896.59850@p15g2000hsd.googlegroups.com>

Could someone give me a link to a tutorial on event handling in perl?
I have not been able to find anything, it seems what I always find
when searching for event handling in perl is signal handling. Are
these two things one in the same?

Thanks for your help



------------------------------

Date: 27 Mar 2007 05:11:23 -0700
From: "zm5" <ryanarossi@gmail.com>
Subject: Re: Event Handling?
Message-Id: <1174997483.269566.206340@b75g2000hsg.googlegroups.com>

On Mar 26, 2:36 pm, "zm5" <ryanaro...@gmail.com> wrote:
> Could someone give me a link to a tutorial on event handling in perl?
> I have not been able to find anything, it seems what I always find
> when searching for event handling in perl is signal handling. Are
> these two things one in the same?
>
> Thanks for your help

anyone?



------------------------------

Date: 27 Mar 2007 05:35:04 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Event Handling?
Message-Id: <1174998904.436632.128360@d57g2000hsg.googlegroups.com>

On Mar 26, 2:36 pm, "zm5" <ryanaro...@gmail.com> wrote:
> Could someone give me a link to a tutorial on event handling in perl?
> I have not been able to find anything, it seems what I always find
> when searching for event handling in perl is signal handling. Are
> these two things one in the same?
>
> Thanks for your help

Describe what you mean by "event handling".  Are you talking about
responding to keyboard or mouse events?  Please read:
perldoc -q mouse

If that's not what you mean, tell us what you mean.

Posting an "anyone?" followup is rude.  If your question didn't get
any responses, it's because you asked a poor question.  Ask a better
one.

Paul Lalli



------------------------------

Date: Tue, 27 Mar 2007 13:22:52 GMT
From: "Mumia W." <paduille.4060.mumia.w+nospam@earthlink.net>
Subject: Re: Event Handling?
Message-Id: <MU8Oh.131650$_73.34633@newsread2.news.pas.earthlink.net>

On 03/27/2007 07:11 AM, zm5 wrote:
> On Mar 26, 2:36 pm, "zm5" <ryanaro...@gmail.com> wrote:
>> Could someone give me a link to a tutorial on event handling in perl?
>> I have not been able to find anything, it seems what I always find
>> when searching for event handling in perl is signal handling. Are
>> these two things one in the same?
>>
>> Thanks for your help
> 
> anyone?
> 

Event handling where?

Perl-Tk programs, Curses::UI programs, and Perl-Gtk programs all use 
different event mechanisms.

Search for modules with "event" in their names; one of them may lead you 
to a tutorial:

cpan> m /event/




------------------------------

Date: Mon, 26 Mar 2007 13:49:30 -0000
From: gbacon@hiwaay.net (Greg Bacon)
Subject: Re: Executing awk from perl script
Message-Id: <130fjra4rm6pj22@corp.supernews.com>

In article <4607aaeb$0$28971$da0feed9@news.zen.co.uk>,
    Ian Wilson  <scobloke2@infotop.co.uk> wrote:

: Abigail Bush wrote:
:
: > But I give you one hint: `` is a double quoted context. So Perl will 
: > interpretate variables.
:
: I interpret interpretate as interpolate.

Conversate for a few
'Cuz in a few
We gon' do
 ...

Sorry, don't mind me.

Greg, hands in the air
-- 
A democracy is nothing more than mob rule, where fifty-one percent of
the people may take away the rights of the other forty-nine.
    -- Thomas Jefferson


------------------------------

Date: 26 Mar 2007 18:22:28 GMT
From: xhoster@gmail.com
Subject: Re: FAQ 8.43 How do I open a file without blocking?
Message-Id: <20070326142230.387$SR@newsreader.com>

Abigail <abigail@abigail.be> wrote:
> xhoster@gmail.com (xhoster@gmail.com) wrote on MMMMCMLIV September
> MCMXCIII in <URL:news:20070325181514.042$pC@newsreader.com>:
> {}  PerlFAQ Server <brian@stonehenge.com> wrote:
> {} > This is an excerpt from the latest version perlfaq8.pod, which
> {} > comes with the standard Perl distribution. These postings aim to
> {} > reduce the number of repeated questions as well as allow the
> community {} > to review and update the answers. The latest version of
> the complete {} > perlfaq is at http://faq.perl.org .
> {} >
> {} > --------------------------------------------------------------------
> {} >
> {} > 8.43: How do I open a file without blocking?
> {} >
> {} >     If you're lucky enough to be using a system that supports
> {} >     non-blocking reads (most Unixish systems do), you need only to
> use {} >     the O_NDELAY or O_NONBLOCK flag from the Fcntl module in
> conjunction {} >     with sysopen():
> {} >
> {} >             use Fcntl;
> {} >             sysopen(FH, "/foo/somefile", O_WRONLY|O_NDELAY|O_CREAT,
> 0644) {} >                     or die "can't open /foo/somefile: $!":
> {} >
> {} > --------------------------------------------------------------------
> {}
> {}
> {}  I think that this FAQ should be removed or altered.  It doesn't seem
> to be {}  frequently asked.  It is also kind of misleading, as it is not
> opening a {}  file without the open blocking--it is opening a file so
> that the subsequent {}  reads from it do not block (or at least that is
> the behavior I observe for {}  it). Finally, it only seems to work on
> special files, not on regular files.
>
> What makes you say all those things?

Experience.  When opening files over a NFS link, if the link was
acting up the sysopen would block whether O_NDELAY was used or not.

I think the FAQ should say something like "This is unlikely to be
useful on regular files, but only on named pipes and such"



> O_NDELAY causes both the open() and
> the subsequent reads to be non-blocking, and there's nothing special
> about "/foo/somefile".

Well, it doesn't exist at all on my system.  I don't know if that counts
as being something special or not.

On what OS will opening /foo/somefile with O_NDELAY lead to nonblocking
reads when /foo/somefile is *not* a special file?

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


------------------------------

Date: Tue, 27 Mar 2007 11:05:40 -0500
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 8.43 How do I open a file without blocking?
Message-Id: <270320071105409750%brian.d.foy@gmail.com>

In article <20070326142230.387$SR@newsreader.com>, <xhoster@gmail.com>
wrote:

> Abigail <abigail@abigail.be> wrote:
> > xhoster@gmail.com (xhoster@gmail.com) wrote on MMMMCMLIV September
> > MCMXCIII in <URL:news:20070325181514.042$pC@newsreader.com>:


> > {} > 8.43: How do I open a file without blocking?


> I think the FAQ should say something like "This is unlikely to be
> useful on regular files, but only on named pipes and such"

I could probably add a line like that. 

I can also add ths to my list of questions that are candidates for
removal. I'll have to check with Rafael for his plans to sync the
perlfaq with the blead sources though, because I think he might have
just done that for the next release (in which case most people won't
get an update).

Thanks,

-- 
Posted via a free Usenet account from http://www.teranews.com



------------------------------

Date: Tue, 27 Mar 2007 12:13:06 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: FAQ 8.48 How do I add the directory my program lives in to the module/library search path?
Message-Id: <rooh035413ejcsl0eiiv4jke1rnrrnnkpb@4ax.com>

On Mon, 26 Mar 2007 12:03:02 -0700, PerlFAQ Server
<brian@stonehenge.com> wrote:

>8.48: How do I add the directory my program lives in to the module/library search path?
>
>            use FindBin;
>            use lib "$FindBin::Bin";
>            use your_own_modules;

Although I've used FindBin with success and satisfaction, some
respectable Perl hackers consider it to be broken. See e.g.:

http://perlmonks.org/?node_id=41213


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: Tue, 27 Mar 2007 11:09:26 -0500
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 8.48 How do I add the directory my program lives in to the module/library search path?
Message-Id: <270320071109263325%brian.d.foy@gmail.com>

In article <rooh035413ejcsl0eiiv4jke1rnrrnnkpb@4ax.com>, Michele Dondi
<bik.mido@tiscalinet.it> wrote:

> On Mon, 26 Mar 2007 12:03:02 -0700, PerlFAQ Server
> <brian@stonehenge.com> wrote:
> 
> >8.48: How do I add the directory my program lives in to the module/library
> >search path?
> >
> >            use FindBin;
> >            use lib "$FindBin::Bin";
> >            use your_own_modules;
> 
> Although I've used FindBin with success and satisfaction, some
> respectable Perl hackers consider it to be broken. See e.g.:
> 
> http://perlmonks.org/?node_id=41213


I'll fix up the answer and note the different situations.

Thanks,

-- 
Posted via a free Usenet account from http://www.teranews.com



------------------------------

Date: 26 Mar 2007 19:35:23 GMT
From: franciskus <jccowe@sasipnet.ws>
Subject: for bowie: truly terrific nntp server -  sopte polpeg - (1/1)
Message-Id: <3345j75882U631o8399L85228Q24817C471T5919J374826Q@news.sasipnet.ws>

Hello group

One thing I love about them, they don't keep log files of the news I read or files I download.
You can find almost anything you are looking for.
Take a look, I know you'll love it as much as I do.

Blazing fast downloads
800 GIGS of new multimedia content each day
2,000,000 new posts each day
Very long retention
Posting allowed!
Keyword searchable
Streaming audio and video

I love newsdude.net, you'll love newsdude.net, everyone loves newsdude


Di foypu kuklacorjuh biwci
ti bal as! ...


------------------------------

Date: 26 Mar 2007 08:29:28 -0700
From: "drew@sundawg.org" <drew@sundawg.org>
Subject: fork,exec, and parallel processing
Message-Id: <1174922968.771158.102200@n76g2000hsh.googlegroups.com>

Hi,

I've a need for a script that can query multiple NetBackup servers for
a clientlist, in parallel (rather than sequentially) if possible.

I've developed the following code, which seems to work, but also seems
to only run sequentially. What can I do to correct the script so it
will run the children in parallel?

Thanks,

Drew

__BEGIN_SCRIPT__
use strict;

my $passes = 0;
my @kids = ();
my @clients;
my %backup_results = ();
my @serverlist = qw/server1 server2/;
my %client_to_master = ();

for my $server (@serverlist) {
        my $pid = open(KID_TO_READ,"-|");
        print "PID: $pid\n";
        if ($pid) {
                # parent
                @clients = ();
                while(<KID_TO_READ>) {
                        next if (/Windows/);
                        next if (/^Hardware /);
                        next if (/^-----/);
                        my ($hardware,$os,$client_name) = split;
                        push(@clients,$client_name);
                        $client_to_master{$client_name} = $server;
                }
                close(KID_TO_READ) or warn "Child exited: $?\n";
                $backup_results{$server}{'clientlist'} = [@clients];
                push(@kids, $pid);
        } elsif ($pid == 0) {
                # child
                my @options = qw/ssh/;
                my $path = '/usr/openv/netbackup/bin/admincmd';
                my $cmd = 'bpplclients';
                my $bpplclients = $path . '/' . $cmd;
                push(@options,$server,$bpplclients);
                exec('/usr/bin/sudo',@options) or die "Can't exec: $!
\n";
                exit(0);
        } else {
                die "Can't fork: $!\n";
        }
}


foreach(@kids) {
        waitpid($_,0);
}

exit(0);

__END_SCRIPT__



------------------------------

Date: 26 Mar 2007 16:21:03 GMT
From: xhoster@gmail.com
Subject: Re: fork,exec, and parallel processing
Message-Id: <20070326122105.257$cG@newsreader.com>

"drew@sundawg.org" <drew@sundawg.org> wrote:
> Hi,
>
> I've a need for a script that can query multiple NetBackup servers for
> a clientlist, in parallel (rather than sequentially) if possible.

Did you look for existing modules that will do that?

> I've developed the following code, which seems to work, but also seems
> to only run sequentially. What can I do to correct the script so it
> will run the children in parallel?
>
> Thanks,
>
> Drew
>
> __BEGIN_SCRIPT__
> use strict;
>
> my $passes = 0;
> my @kids = ();
> my @clients;
> my %backup_results = ();
> my @serverlist = qw/server1 server2/;
> my %client_to_master = ();
>
> for my $server (@serverlist) {
>         my $pid = open(KID_TO_READ,"-|");

You should use lexical file handles.

          my $pid = open(my $fh, "-|") or die;
          push @handles,$fh;
          ### or maybe, depending on your needs:
          ### $ioselect->add($fh);
          print "PID: $pid\n";

>         if ($pid) {
>                 # parent
>                 @clients = ();
>                 while(<KID_TO_READ>) {
>                         next if (/Windows/);
>                         next if (/^Hardware /);
>                         next if (/^-----/);
>                         my ($hardware,$os,$client_name) = split;
>                         push(@clients,$client_name);
>                         $client_to_master{$client_name} = $server;
>                 }
>                 close(KID_TO_READ) or warn "Child exited: $?\n";
>                 $backup_results{$server}{'clientlist'} = [@clients];
>                 push(@kids, $pid);

This should all be moved to after the the parallel open loop.  I don't
think you need to save the $pid, only the file-handle.


>         } elsif ($pid == 0) {
>                 # child
>                 my @options = qw/ssh/;
>                 my $path = '/usr/openv/netbackup/bin/admincmd';
>                 my $cmd = 'bpplclients';
>                 my $bpplclients = $path . '/' . $cmd;
>                 push(@options,$server,$bpplclients);
>                 exec('/usr/bin/sudo',@options) or die "Can't exec: $!
> \n";
>                 exit(0);
>         } else {
>                 die "Can't fork: $!\n";
>         }
> }

This part would be pretty much the same.

>
> foreach(@kids) {
>         waitpid($_,0);
> }

I don't think this currently does anything, as the close of a pipe open
automatically does a waitpid.

Anyway, you need to put the above parent code here.  The exact nature
depends on what it is you need to do, as "parallel" covers a vast range
of options.  If the children can be harvested in an arbitrary order, then
just use a:

foreach my $handle (@handles) {
  ## harvesting code from above here, with suitable changes.
}

If a fast child gets stuck behind a slow one in the @handles list, then
it will just around idle until the slow one is done, before it can get
harvested.  Often, that is not a problem.

On the other hand, if the children must be harvested ASAP after each one is
done, then you would need to use IO::Select or something like it.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


------------------------------

Date: Mon, 26 Mar 2007 18:54:24 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: fork,exec, and parallel processing
Message-Id: <AFUNh.15502$__3.1060@edtnps90>

drew@sundawg.org wrote:
> 
> I've a need for a script that can query multiple NetBackup servers for
> a clientlist, in parallel (rather than sequentially) if possible.
> 
> I've developed the following code, which seems to work, but also seems
> to only run sequentially. What can I do to correct the script so it
> will run the children in parallel?

In addition to xhoster's comments:


> __BEGIN_SCRIPT__
> use strict;

You should also include the 'warnings' pragma.

use warnings;


> my $passes = 0;
> my @kids = ();
> my @clients;
> my %backup_results = ();
> my @serverlist = qw/server1 server2/;
> my %client_to_master = ();
> 
> for my $server (@serverlist) {
>         my $pid = open(KID_TO_READ,"-|");
>         print "PID: $pid\n";
>         if ($pid) {
>                 # parent
>                 @clients = ();
>                 while(<KID_TO_READ>) {
>                         next if (/Windows/);
>                         next if (/^Hardware /);
>                         next if (/^-----/);
>                         my ($hardware,$os,$client_name) = split;
>                         push(@clients,$client_name);
>                         $client_to_master{$client_name} = $server;
>                 }
>                 close(KID_TO_READ) or warn "Child exited: $?\n";
>                 $backup_results{$server}{'clientlist'} = [@clients];
>                 push(@kids, $pid);
>         } elsif ($pid == 0) {

The else clause will never execute because 'undef' in numerical context is the
same as 0:

$ perl -Mstrict -le'my $x; print $x == 0 ? "\$x == 0" : "oops"'
$x == 0
$ perl -Mwarnings -Mstrict -le'my $x; print $x == 0 ? "\$x == 0" : "oops"'
Use of uninitialized value in numeric eq (==) at -e line 1.
$x == 0

At least with warnings enabled you will get some indication.  You should use
the defined() function to test for failure, something like:

        defined( my $pid = open KID_TO_READ, '-|' )
            or die "Can't fork: $!\n";


>                 # child
>                 my @options = qw/ssh/;
>                 my $path = '/usr/openv/netbackup/bin/admincmd';
>                 my $cmd = 'bpplclients';
>                 my $bpplclients = $path . '/' . $cmd;
>                 push(@options,$server,$bpplclients);
>                 exec('/usr/bin/sudo',@options) or die "Can't exec: $!
> \n";
>                 exit(0);
>         } else {
>                 die "Can't fork: $!\n";
>         }
> }



John
-- 
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order.       -- Larry Wall


------------------------------

Date: 27 Mar 2007 12:59:57 -0700
From: "Fei Liu" <fei.liu@gmail.com>
Subject: how to list all loaded modules of a perl program
Message-Id: <1175025597.374746.284000@e65g2000hsc.googlegroups.com>

Hi group, is it possible to list all loaded modules of a perl program?
For example, the perl application could have a very complicated
hierarchy of module structure where each module load different modules
on their own:

i.e
package main
use A;
use C;

package A
use B;

package C
use D;

package B
use BA;
use BB;

package D;
use DA;
use DB;
use DC;

package DA
use DAA;
use DAB;

etc, etc.

Now is it possible within the main program to list all the preloaded
modules via use statement? It's possible to do this by using a parser
to recursively parse through modules with a predefined level, but
idealy a in program complete list could be better.

Please let me know if there is an existing solution for this problem,
thanks!

Fei



------------------------------

Date: Tue, 27 Mar 2007 11:07:34 +0200
From: "john.swilting" <john.swilting@wanadoo.fr>
Subject: how to make to transmit the parameters of a cgi between these various pages I would like to use param but I do not see how to make
Message-Id: <4608ded6$0$25950$ba4acef3@news.orange.fr>

        
my cgi functions on several windows.I' would like to be able to recover the
parameter $image which comes from the form of the gallery photographs of
the first window towards the second window and the third window.I know
there is the instruction param, but I do not manage to use it in my cgi 
my code functions well and it compiles without warnings
#!/usr/bin/perl -w
use diagnostics;
use strict;
use CGI qw(:standard escapeHTML);
use CGI::Carp qw(fatalsToBrowser);

my $cgi;
my $key;
my %etats;
my $ecran_actuel;

$cgi = new CGI;

%etats = (
    'defaut' =>\&commander,
    'saisie_commande' =>\&saisie_commande,
    'validation_commande' =>\&validation_commande,
    );
$ecran_actuel = param(".Etat") || "defaut";
die "Pas d'ecran 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);
    }

pied_de_page_standard();

########################################################################
##       fonctions d en tete , de pied de page ,de menu ################
########################################################################

sub en_tete_standard {
    print header(),
      start_html(-Title => "commande" , -BGCOLOR=>"White");
    print start_form();
    }


sub pied_de_page_standard{ print end_form(),end_html() }


sub menu_boutique{
    print p(defaults("vider mon cadie"),
        vers_doc("saisie_commande"));
    }

sub commander {
    my($actif) = @_;
    return unless $actif;
    my $image = param ('image');
    if ( $image == '') {
        die "error";
    }
    print "<H1>salut !</H1>\n";
    print p("bienvenue dnas notre magasin de peintures !");
    print p("vous avez selectionner la
peintures ",tt(escapeHTML($image)),"\n");
    
    menu_boutique();
    return $image;
    }
sub saisie_commande {
    my $actif = shift;
##    my($image) = main::commander;
    my @gadgets = qw(Nom Adresse Ville Code_postal Pays Telephone Mail);
    unless ( $actif ) {
        print map { hidden($_) } @gadgets;
        return;
        }
    print p("Tous les champs sont obligatoires sinons votre commande ne sera
pas valable");
    print p("vous pouvez remplir au choix votre numero de telephone ou votre
mail pour le suivie de la commande");
##    print p("image ",tt(escapeHTML($image)));
    print pre ( p ("Nom\&nbsp;:              ",textfield("Nom")),
                p ("Adresse\&nbsp;:          ",textfield("Adresse")),
                p ("Ville\&nbsp;:            ",textfield("Ville")),
                p ("Code Postal\&nbsp;:      ",textfield("Code_postal")),
                p ("Pays\&nbsp;:             ",textfield("Pays")),
                p ("Telephone\&nbsp;:        ",textfield("Teléphone")),
                p ("e-mail\&nbsp;:           ",textfield("Mail")));
    
    print p ( "Selectionner validation_commande pour commander\n",
              "la peintures. autrement selectionner Annulation\n");
    
    print p ( vers_doc("validation_commande"), vers_doc("Annulation"));
    }

sub validation_commande {
    my $actif = shift;
    unless ( $actif) {
        return;
        }
    my $numero_commande = time;
    my $nom = param ('Nom');
    my $adresse = param ('Adresse');
    my $ville = param ('Ville');
    my $code_postal = param ('Code_postal');
    my $pays = param ('Pays');
    my $telephone = param ('Teléphone');
    my $mail = param ('Mail');
    print h1("Commander !");
    print p("vous aller recevoir un e-mail avec un numero de commande");
    print p("vous serez prevenue quand le paquet sera posté");
    print p("dans toutes correspondance indiquer votre numero de
commande",tt(escapeHTML($numero_commande)));
    print p("debug ",tt(escapeHTML($nom)));
    print p("debug ",tt(escapeHTML($adresse)));
    print p("debug ",tt(escapeHTML($ville)));
    print p("debug ",tt(escapeHTML($pays)));
    print p("debug ",tt(escapeHTML($telephone)));
    print p("debug ",tt(escapeHTML($mail)));
    print p(defaults("Retour au debut"));
    }
sub vers_doc { submit (-NAME => ".Etat", -VALUE => shift) }



------------------------------

Date: 27 Mar 2007 09:46:45 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: how to make to transmit the parameters of a cgi between these various pages I would like to use param but I do not see how to make
Message-Id: <56s7g5F2agqebU1@mid.dfncis.de>

john.swilting <john.swilting@wanadoo.fr> wrote in comp.lang.perl.misc:
>         
> my cgi functions on several windows.I' would like to be able to recover the
> parameter $image which comes from the form of the gallery photographs of
> the first window towards the second window and the third window.

You can use hidden fields to pass parameters from one invocation to
the next.  (In fact, you already seem to do that in another place.)
So add a hidden field "image" to those forms that don't already have
it.

    print hidden('image', $image);

Then "my $image = param( 'image')" will restore the value.

Anno


------------------------------

Date: Tue, 27 Mar 2007 02:33:58 +0200
From: Don Salad <caesar@miskatonic.edu>
Subject: Re: HTML::Mason and User site folders
Message-Id: <3c01b384e151374b83ac3a6a963cee84@msgid.frell.theremailer.net>

Mirco Wahab <wahab-mail@gmx.de> wrote:
> 
> This scenario is given *exactly* as you described it
> in the "Mason Book":
> 
> http://www.masonbook.com/book/chapter-11.mhtml#TOC-ANCHOR-15
> 
> There is a handler provided, which calls
> the Mason handler and sets the proper
> secret handshake.

IFYPFY.

Thanks,
Don





------------------------------

Date: 26 Mar 2007 23:04:02 -0700
From: krakle@visto.com
Subject: Re: is mod_perl better for CGI application?
Message-Id: <1174975442.043195.200730@o5g2000hsb.googlegroups.com>

On Mar 22, 11:14 am, nos...@geniegate.com (Jamie) wrote:
> mod_perl ...
> It's also pretty easy to screw
> up, a bit harder to develop for

In other words, mod_perl forces you to write valid Perl code and take
extra precautions. The only problem I ever had with mod_perl was some
variables sharing into another users sessions. And that was an easy
fix.

> (for example, unless you tweak the settings,
> you'll have to restart apache each time you change a file, since they are
> loaded in memory.)

Actually, the server will check the modification time of the script
and if it has changed after that script has been loaded it will
recompile and store in memory. The only time you have to restart
apache is when you make modifications to a module. But it is good
practice to restart apache after modifying scripts to avoid pesky sub-
routine redefined warnings.



------------------------------

Date: Tue, 27 Mar 2007 07:22:20 GMT
From: nospam@geniegate.com (Jamie)
Subject: Re: is mod_perl better for CGI application?
Message-Id: <Lc1174958868195810x8b46514@pong.podro.com>

In <1174975442.043195.200730@o5g2000hsb.googlegroups.com>,
krakle@visto.com mentions:
>On Mar 22, 11:14 am, nos...@geniegate.com (Jamie) wrote:
>> mod_perl ...
>> It's also pretty easy to screw
>> up, a bit harder to develop for
>
>In other words, mod_perl forces you to write valid Perl code and take
>extra precautions. The only problem I ever had with mod_perl was some
>variables sharing into another users sessions. And that was an easy
>fix.

FastCGI has the same constraints. (the other problem is memory leaks)

>> (for example, unless you tweak the settings,
>> you'll have to restart apache each time you change a file, since they are
>> loaded in memory.)
>
>Actually, the server will check the modification time of the script
>and if it has changed after that script has been loaded it will
>recompile and store in memory. The only time you have to restart
>apache is when you make modifications to a module. But it is good
>practice to restart apache after modifying scripts to avoid pesky sub-
>routine redefined warnings.

FastCGI has those problems as well, except you can kill off the FastCGI
process instead of apache if you want.

It's just that with FastCGI, it's easier to develop the bulk of your code as a
plain cgi script and then port it. I find this easier.

It's also easy to move it back to regular CGI if it turns out you don't need
persistence. With mod_perl, you need to use Apache::Registry. (which kind of
kills the whole point) and you'll end up carrying perl code into each apache
instance. (may or may not be a problem)

As soon as you rely on anything "mod_perl specific", you can't easily go
back to regular CGI. You could wind up carrying around a web server
bloated down with code that goes unused most of the time.

Make no mistake, mod_perl is awesome. Particularly good when you
need access to the intricate details of apache. CGI can't compare
to that.

Jamie
-- 
http://www.geniegate.com                    Custom web programming
Perl * Java * UNIX                        User Management Solutions


------------------------------

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 268
**************************************


home help back first fref pref prev next nref lref last post