I have to modify a script to upload different data to a server,
until now i did and script that ask you a question and capture the variable
into a hash (see below), now, i would like to modify it and make something
that allows me to ask different questions using the same script
how can i do this?
Thanks
#! /usr/bin/perl
#use strict;
use CGI::Ajax;
use CGI;
$html =3D < CGI::Ajax Multiple Return Value Example
EOT
;
return $html;
};
my $Show_Form2 =3D sub {
my $html =3D "";
$html =3D < CGI::Ajax Multiple Return Value Example
form2
EOT
;
return $html;
};
my $pjx =3D CGI::Ajax->new( 'jsFunc' =3D> $concatter);
$pjx->JSDEBUG(1);
$pjx->DEBUG(1);
print $pjx->build_html($q,$Show_Form); # this outputs the html for the page
--=20
Pau Marc Mu=F1oz Torres
Laboratori de Biologia Computacional
Institut de Biotecnologia i Biomedicina Vicent
Villar
Universitat Autonoma de Barcelona
E-08193 Bellaterra (Barcelona)
I have to modify a script to upload different data to a server,
until now i did and script that ask you a question and capture the variable
into a hash (see below), now, i would like to modify it and make something
that allows me to ask different questions using the same script
how can i do this?
Thanks
#! /usr/bin/perl
#use strict;
use CGI::Ajax;
use CGI;
$html =3D < CGI::Ajax Multiple Return Value Example
EOT
;
return $html;
};
my $Show_Form2 =3D sub {
my $html =3D "";
$html =3D < CGI::Ajax Multiple Return Value Example
form2
EOT
;
return $html;
};
my $pjx =3D CGI::Ajax->new( 'jsFunc' =3D> $concatter);
$pjx->JSDEBUG(1);
$pjx->DEBUG(1);
print $pjx->build_html($q,$Show_Form); # this outputs the html for the page
--=20
Pau Marc Mu=F1oz Torres
Laboratori de Biologia Computacional
Institut de Biotecnologia i Biomedicina Vicent
Villar
Universitat Autonoma de Barcelona
E-08193 Bellaterra (Barcelona)
Laboratori de Biologia Computacional
Institut de Biotecnologia i Biomedicina Vicent
Villar
Universitat Autonoma de Barcelona
E-08193 Bellaterra (Barcelona)
Re: Fwd: how to refresh between different pages of the same script
am 09.04.2008 00:21:16 von Jenda Krynicky
From: "Pau Marc Munoz Torres"
> #! /usr/bin/perl
> #use strict;
> use CGI::Ajax;
> use CGI;
>
> my $q = new CGI;
>
> my $concatter = sub {
>
> my $buffer = $ENV{'QUERY_STRING'};
>
> my @pairs = split( /&/, $buffer );
>
> foreach my $pair (@pairs) {
>
> my ( $name, $value ) = split( /=/, $pair );
>
> $name =~ tr/+/ /;
>
> $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
>
> $value =~ tr/+/ /;
>
> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
>
> $Variables{$name} = $value;
> }
Do not, repeat, do NOT parse the querystring yourself. Let CGI.pm,
CGI::Lite or CGI::Deurl do that for you. Safely.
Jenda
===== Jenda@Krynicky.cz === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery
--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/
Testing an array for a match
am 09.04.2008 19:07:17 von Lou Hernsen
Hallo
I have an array
@Treasures
and I want to match anywhere in it for
/:1:2:3:/
can I
if (@Treasures =~ /:1:2:3:/){}
or do i have to change (@Treasures to $Treasures and then
$Treasures = @Treasures ;
if ($Treasures =~ /:1:2:3:/){}
Just thought I'd ask first, I have to take mother in law to Dr. so I don't
have time to test right now...
I'll check email in a few hours...
thanks
Lou
--
To unsubscribe, e-mail: beginners-cgi-unsubscribe@perl.org
For additional commands, e-mail: beginners-cgi-help@perl.org
http://learn.perl.org/
Re: Testing an array for a match
am 10.04.2008 13:30:56 von Jeff Pang
On Thu, Apr 10, 2008 at 1:07 AM, Lou Hernsen wrote:
> Hallo
>
> I have an array
> @Treasures
> and I want to match anywhere in it for
> /:1:2:3:/
> can I
> if (@Treasures =~ /:1:2:3:/){}
> or do i have to change (@Treasures to $Treasures and then
> $Treasures = @Treasures ;
> if ($Treasures =~ /:1:2:3:/){}
>
You can use a 'grep', like:
use strict;
my @x = (11,22, ':1:2:3:xxx', 'ab','cd', 'test:1:2:3:dd:ee');
my @seen = grep {/:1:2:3:/} @x;
print "@seen";
Good luck with your family.
--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/
Re: Testing an array for a match
am 10.04.2008 15:18:42 von sunnyIsland
Hi,
How about this :-
foreach (@Treasures){
if ($_=~ /:1:2:3:/){
print "do your stuffs here\n":
}
}
----- Original Message -----
From: "Lou Hernsen"
To: ;
Sent: Thursday, April 10, 2008 1:07 AM
Subject: Testing an array for a match
> Hallo
>
> I have an array
> @Treasures
> and I want to match anywhere in it for
> /:1:2:3:/
> can I
> if (@Treasures =~ /:1:2:3:/){}
> or do i have to change (@Treasures to $Treasures and then
> $Treasures = @Treasures ;
> if ($Treasures =~ /:1:2:3:/){}
>
> Just thought I'd ask first, I have to take mother in law to Dr. so I don't
> have time to test right now...
> I'll check email in a few hours...
> thanks
> Lou
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> http://learn.perl.org/
>
>
>
--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/