how to refresh between different pages of the same script

how to refresh between different pages of the same script

am 08.04.2008 16:51:47 von Pau Marc Munoz Torres

------=_Part_21518_24724300.1207666307423
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

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;

my $q =3D new CGI;

my $concatter =3D sub {

my $buffer =3D $ENV{'QUERY_STRING'};

my @pairs =3D split( /&/, $buffer );

foreach my $pair (@pairs) {

my ( $name, $value ) =3D split( /=3D/, $pair );

$name =3D~ tr/+/ /;

$name =3D~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg=
;

$value =3D~ tr/+/ /;

$value =3D~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg=
;

$Variables{$name} =3D $value;
}


print "";
foreach (%Variables) {print "$_\n"}

print "";


return ;
};


my $Show_Form =3D sub {

my $html =3D "";

$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)

tel=E8fon: 93 5812807
Email : paumarc.munoz@bioinf.uab.cat

------=_Part_21518_24724300.1207666307423--

Fwd: how to refresh between different pages of the same script

am 08.04.2008 16:53:04 von Pau Marc Munoz Torres

------=_Part_21522_11359244.1207666384552
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

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;

my $q =3D new CGI;

my $concatter =3D sub {

my $buffer =3D $ENV{'QUERY_STRING'};

my @pairs =3D split( /&/, $buffer );

foreach my $pair (@pairs) {

my ( $name, $value ) =3D split( /=3D/, $pair );

$name =3D~ tr/+/ /;

$name =3D~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg=
;

$value =3D~ tr/+/ /;

$value =3D~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg=
;

$Variables{$name} =3D $value;
}


print "";
foreach (%Variables) {print "$_\n"}

print "";


return ;
};


my $Show_Form =3D sub {

my $html =3D "";

$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)

tel=E8fon: 93 5812807
Email : paumarc.munoz@bioinf.uab.cat

--=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)

tel=E8fon: 93 5812807
Email : paumarc.munoz@bioinf.uab.cat

------=_Part_21522_11359244.1207666384552--

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/