RE: href arguments

2001-08-07 Thread Joel Hughes

Sidrath,
is there any need to adopt that surly attitude when responding?

joel

-Original Message-
From: Sidharth Malhotra [mailto:[EMAIL PROTECTED]]
Sent: 07 August 2001 13:23
To: 'Francesco Scaglioni'
Cc: '[EMAIL PROTECTED]'
Subject: RE: href arguments


Once again.  This is a problem that can be easily solved reading the CGI
module documentation at:
http://www.perldoc.com/perl5.6/lib/CGI.html

use the CGI module:


use CGI;
my $q = new CGI;
my $filename = $q->url_param('filename'); # or
my $filename = $q->param('filename');




-Original Message-
From: Francesco Scaglioni [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 07, 2001 7:05 AM
To: [EMAIL PROTECTED]
Subject: href arguments


Hi,

THis is probably a simple question.  Am new to perl and CGI so please
have mercy. I have a script which displays a list of files with links
to them.  The links when hovered over in a browser show as:

display_file.pl?filename=blahblah

How can I extract the blahblah bit (which is the name of the selected
file) so that the display_file.pl script can know which file it is to
open and process?  I think this makes sence.  I want the script
display_file.pl to perform an action on file blahblah.

TIA

Francesco

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




AW: AW: href arguments

2001-08-07 Thread Alessandro Lenzen

Oh, I see. I'm a bit confused. Maybe it's my fault...
Do you have a string like "display_file.pl?filename=blahblah" or are you
calling the CGI with http://www.domain.it/display_file.pl?filename=blahblah
?
The code I wrote is for the latter...
In the first case, you could use regexes:

#!/usr/bin/perl
$_ = "display_file.pl?filename=blahblah";
m/=(\w+)$/;
$file = $1;

This works quite fine, but it is no good, if the String looks like
http://www.domain.it/display_file.pl?filename=blahblah&sex=yesplease&drugs=j
ustsayno

But I think you got the idea...
No, wait. I got the idea...

m/filename=(\w+)&?/;

should work perfectly...

al
-Ursprüngliche Nachricht-
Von: Francesco Scaglioni [mailto:[EMAIL PROTECTED]]
Gesendet: Dienstag, 7. August 2001 13:33
An: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Betreff: Re: AW: href arguments


## "Alessandro Lenzen" <[EMAIL PROTECTED]> on: Tue, 7 Aug 2001
13:21:22 +0200 ##
::>  Hello Francesco,
alenzen::>
alenzen::> first of all you should read the CGI.pm manpage if you want to
write good
alenzen::> CGIs.
alenzen::> You don't need to use the CGI.pm module, but it is considered
good
alenzen::> programming practice and it saves a lot of time since you don't
have to
alenzen::> bother with a lot of things.
alenzen::>
alenzen::> The following code should help you get the idea:
alenzen::>
alenzen::> #!/usr/bin/perl -w
alenzen::> use strict;
alenzen::> use CGI qw(:standard);
alenzen::> my $file = param("filename");
alenzen::> #now the blahblah bit is extracted and saved in $file
alenzen::>
alenzen::>
alenzen::> -Ursprüngliche Nachricht-
alenzen::> Von: Francesco Scaglioni [mailto:[EMAIL PROTECTED]]
alenzen::> Gesendet: Dienstag, 7. August 2001 13:05
alenzen::> An: [EMAIL PROTECTED]
alenzen::> Betreff: href arguments
alenzen::>
alenzen::>
alenzen::> Hi,
alenzen::>
alenzen::> THis is probably a simple question.  Am new to perl and CGI so
please
alenzen::> have mercy. I have a script which displays a list of files with
links
alenzen::> to them.  The links when hovered over in a browser show as:
alenzen::>
alenzen::> display_file.pl?filename=blahblah
alenzen::>
alenzen::> How can I extract the blahblah bit (which is the name of the
selected
alenzen::> file) so that the display_file.pl script can know which file it
is to
alenzen::> open and process?  I think this makes sence.  I want the script
alenzen::> display_file.pl to perform an action on file blahblah.
alenzen::>
alenzen::> TIA
alenzen::>
alenzen::> Francesco
alenzen::>
alenzen::> --
alenzen::> To unsubscribe, e-mail: [EMAIL PROTECTED]
alenzen::> For additional commands, e-mail: [EMAIL PROTECTED]
alenzen::>
alenzen::>

I didn't generate a form - I am obviously mistaken as I was under the
impression that to use the param call then a form had to specify it.
Boy have I got much to learn.

Cheers

Francesco


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




AW: href arguments

2001-08-07 Thread Alessandro Lenzen

Hello Francesco,

first of all you should read the CGI.pm manpage if you want to write good
CGIs.
You don't need to use the CGI.pm module, but it is considered good
programming practice and it saves a lot of time since you don't have to
bother with a lot of things.

The following code should help you get the idea:

#!/usr/bin/perl -w
use strict;
use CGI qw(:standard);
my $file = param("filename");
#now the blahblah bit is extracted and saved in $file


-Ursprüngliche Nachricht-
Von: Francesco Scaglioni [mailto:[EMAIL PROTECTED]]
Gesendet: Dienstag, 7. August 2001 13:05
An: [EMAIL PROTECTED]
Betreff: href arguments


Hi,

THis is probably a simple question.  Am new to perl and CGI so please
have mercy. I have a script which displays a list of files with links
to them.  The links when hovered over in a browser show as:

display_file.pl?filename=blahblah

How can I extract the blahblah bit (which is the name of the selected
file) so that the display_file.pl script can know which file it is to
open and process?  I think this makes sence.  I want the script
display_file.pl to perform an action on file blahblah.

TIA

Francesco

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




FW: href arguments

2001-08-07 Thread Sidharth Malhotra

-Original Message-
From: Sidharth Malhotra 
Sent: Tuesday, August 07, 2001 8:49 AM
To: 'Joel Hughes'
Subject: RE: href arguments


I apologise to all who felt I came down in a somewhat condescending tone.

My feeling is simply that many people seem email the list as their first
solution.  A question such as this is answered in almost any [good] guide to
cgi programming.

I apologise to anyone I offended.

Sidharth Malhotra.

-Original Message-
From: Joel Hughes [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 07, 2001 8:38 AM
To: Sidharth Malhotra; 'Francesco Scaglioni'
Cc: [EMAIL PROTECTED]
Subject: RE: href arguments


Sidrath,
is there any need to adopt that surly attitude when responding?

joel

-Original Message-
From: Sidharth Malhotra [mailto:[EMAIL PROTECTED]]
Sent: 07 August 2001 13:23
To: 'Francesco Scaglioni'
Cc: '[EMAIL PROTECTED]'
Subject: RE: href arguments


Once again.  This is a problem that can be easily solved reading the CGI
module documentation at:
http://www.perldoc.com/perl5.6/lib/CGI.html

use the CGI module:


use CGI;
my $q = new CGI;
my $filename = $q->url_param('filename'); # or
my $filename = $q->param('filename');




-Original Message-
From: Francesco Scaglioni [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 07, 2001 7:05 AM
To: [EMAIL PROTECTED]
Subject: href arguments


Hi,

THis is probably a simple question.  Am new to perl and CGI so please
have mercy. I have a script which displays a list of files with links
to them.  The links when hovered over in a browser show as:

display_file.pl?filename=blahblah

How can I extract the blahblah bit (which is the name of the selected
file) so that the display_file.pl script can know which file it is to
open and process?  I think this makes sence.  I want the script
display_file.pl to perform an action on file blahblah.

TIA

Francesco

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: href arguments

2001-08-07 Thread Sidharth Malhotra

Once again.  This is a problem that can be easily solved reading the CGI
module documentation at:
http://www.perldoc.com/perl5.6/lib/CGI.html

use the CGI module:


use CGI;
my $q = new CGI;
my $filename = $q->url_param('filename'); # or
my $filename = $q->param('filename');




-Original Message-
From: Francesco Scaglioni [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 07, 2001 7:05 AM
To: [EMAIL PROTECTED]
Subject: href arguments


Hi,

THis is probably a simple question.  Am new to perl and CGI so please
have mercy. I have a script which displays a list of files with links
to them.  The links when hovered over in a browser show as:

display_file.pl?filename=blahblah

How can I extract the blahblah bit (which is the name of the selected
file) so that the display_file.pl script can know which file it is to
open and process?  I think this makes sence.  I want the script
display_file.pl to perform an action on file blahblah.

TIA

Francesco

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: AW: href arguments

2001-08-07 Thread Francesco Scaglioni

## "Alessandro Lenzen" <[EMAIL PROTECTED]> on: Tue, 7 Aug 2001 13:21:22 +0200 
## 
::>  Hello Francesco,
alenzen::> 
alenzen::> first of all you should read the CGI.pm manpage if you want to write good
alenzen::> CGIs.
alenzen::> You don't need to use the CGI.pm module, but it is considered good
alenzen::> programming practice and it saves a lot of time since you don't have to
alenzen::> bother with a lot of things.
alenzen::> 
alenzen::> The following code should help you get the idea:
alenzen::> 
alenzen::> #!/usr/bin/perl -w
alenzen::> use strict;
alenzen::> use CGI qw(:standard);
alenzen::> my $file = param("filename");
alenzen::> #now the blahblah bit is extracted and saved in $file
alenzen::> 
alenzen::> 
alenzen::> -Ursprüngliche Nachricht-
alenzen::> Von: Francesco Scaglioni [mailto:[EMAIL PROTECTED]]
alenzen::> Gesendet: Dienstag, 7. August 2001 13:05
alenzen::> An: [EMAIL PROTECTED]
alenzen::> Betreff: href arguments
alenzen::> 
alenzen::> 
alenzen::> Hi,
alenzen::> 
alenzen::> THis is probably a simple question.  Am new to perl and CGI so please
alenzen::> have mercy. I have a script which displays a list of files with links
alenzen::> to them.  The links when hovered over in a browser show as:
alenzen::> 
alenzen::> display_file.pl?filename=blahblah
alenzen::> 
alenzen::> How can I extract the blahblah bit (which is the name of the selected
alenzen::> file) so that the display_file.pl script can know which file it is to
alenzen::> open and process?  I think this makes sence.  I want the script
alenzen::> display_file.pl to perform an action on file blahblah.
alenzen::> 
alenzen::> TIA
alenzen::> 
alenzen::> Francesco
alenzen::> 
alenzen::> --
alenzen::> To unsubscribe, e-mail: [EMAIL PROTECTED]
alenzen::> For additional commands, e-mail: [EMAIL PROTECTED]
alenzen::> 
alenzen::> 

I didn't generate a form - I am obviously mistaken as I was under the
impression that to use the param call then a form had to specify it.
Boy have I got much to learn.

Cheers

Francesco


href arguments

2001-08-07 Thread Francesco Scaglioni

Hi,

THis is probably a simple question.  Am new to perl and CGI so please
have mercy. I have a script which displays a list of files with links
to them.  The links when hovered over in a browser show as:

display_file.pl?filename=blahblah

How can I extract the blahblah bit (which is the name of the selected
file) so that the display_file.pl script can know which file it is to
open and process?  I think this makes sence.  I want the script
display_file.pl to perform an action on file blahblah.

TIA

Francesco

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]