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]

Reply via email to