RE: Passing a hash through a URL
On Thu, 7 Feb 2002, Josiah Altschuler wrote: > Hi. Thanks for the response. I'm passing the hash with an href in this > manner. So does this mean that I'm not using get or post? > > $query = CGI->new({red => [%{$clusArrayHash[$i]}]})->query_string; > print pre h6 (" ", a ({ -href => > "http://140.247.111.176/cgi-bin/redundancies.pl?red=$query"; }, "Redundant > sequences")); It's a 'get' method. You're limited, I think, to 256 characters. -Brett http://www.chapelperilous.net/ Hollywood is where if you don't have happiness you send out for it. -- Rex Reed -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: module errors
Ok, you have reason, it must be "parser" but after it continues to give some module errors... Can u say me if my method is true, to fetch some information from a web site? thanks funky Istanbul - Original Message - From: "Brett W. McCoy" <[EMAIL PROTECTED]> To: "Uwe Voelker" <[EMAIL PROTECTED]> Cc: "GsuLinuX" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, February 07, 2002 11:59 PM Subject: Re: module errors > On Thu, 7 Feb 2002, Uwe Voelker wrote: > > > > use HTML::Parse; > > > > > > The module is called HTML::Parser. > > A further investigation via CPAN showed me that HTML::Parse is part of the > HTML::Tree bundle and is now actually a deprecated module, according to > the readme. > > -- Brett > http://www.chapelperilous.net/ > > All generalizations are false, including this one. > -- Mark Twain > > > -- > 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: Passing a hash through a URL
Hi. Thanks for the response. I'm passing the hash with an href in this manner. So does this mean that I'm not using get or post? $query = CGI->new({red => [%{$clusArrayHash[$i]}]})->query_string; print pre h6 (" ", a ({ -href => "http://140.247.111.176/cgi-bin/redundancies.pl?red=$query"; }, "Redundant sequences")); -Original Message- From: Al Hospers [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 8:42 PM To: 'Josiah Altschuler'; [EMAIL PROTECTED] Subject: RE: Passing a hash through a URL > I have a question about passing data through URL's. I'm > passing hashes in a > CGI script, but sometimes when I click on a link that passes > a larger hash, > nothing happens. I don't get any message. I'm guessing > there is a limit to > the amount of data I can pass through a URL? If this is the > case, are there > any ways to fix this problem? I assume by "passing data through URL's" you mean using GET. there is a limit, I don't remember exactly what it is. if you use POST there is effectively no limit. hth Al Hospers CamberSoft, Inc. alcambersoftcom http://www.cambersoft.com Shockwave and Director development, CD-ROM, HTML, CGI scripting, and Graphic Design. A famous linguist once said: "There is no language wherein a double positive can form a negative." YEAH, RIGHT -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Passing a hash through a URL
> I have a question about passing data through URL's. I'm > passing hashes in a > CGI script, but sometimes when I click on a link that passes > a larger hash, > nothing happens. I don't get any message. I'm guessing > there is a limit to > the amount of data I can pass through a URL? If this is the > case, are there > any ways to fix this problem? I assume by "passing data through URL's" you mean using GET. there is a limit, I don't remember exactly what it is. if you use POST there is effectively no limit. hth Al Hospers CamberSoft, Inc. alcambersoftcom http://www.cambersoft.com Shockwave and Director development, CD-ROM, HTML, CGI scripting, and Graphic Design. A famous linguist once said: "There is no language wherein a double positive can form a negative." YEAH, RIGHT -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Passing a hash through a URL
I have a question about passing data through URL's. I'm passing hashes in a CGI script, but sometimes when I click on a link that passes a larger hash, nothing happens. I don't get any message. I'm guessing there is a limit to the amount of data I can pass through a URL? If this is the case, are there any ways to fix this problem? Thanks for the help, Josiah -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: module errors
On Thu, 7 Feb 2002, Uwe Voelker wrote: > > use HTML::Parse; > > > The module is called HTML::Parser. A further investigation via CPAN showed me that HTML::Parse is part of the HTML::Tree bundle and is now actually a deprecated module, according to the readme. -- Brett http://www.chapelperilous.net/ All generalizations are false, including this one. -- Mark Twain -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: module errors
> use HTML::Parse; The module is called HTML::Parser. uwe -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: module errors
On Thu, 7 Feb 2002, GsuLinuX wrote: > we wroted a perl code to fetch some information we want from a web site. The code is >as below: > > #!/usr/bin/perl > use LWP::Simple; > use HTML::Parse; > We have the debug error: > > Can't locate HTML/Parse.pm in @INC(@INC contains: > /usr/lib/perl5/5.6.0/i386-linux > /usr/lib/... > ) at > /usr/local/plesk/apache/vhosts/loop10.com/httpdocs/DDdeneme/parite2.cgi line > 3 > > Begin Failed-compilation aborted at > /usr/local/plesk/apache/vhosts/loop10.com/httpdocs/DDdeneme/parite2.cgi line > 3 > " Are you sure you don't mean HTML::Parser (they are two differenty modules)? -- Brett http://www.chapelperilous.net/ Where do I find the time for not reading so many books? -- Karl Kraus -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
module errors
we wroted a perl code to fetch some information we want from a web site. The code is as below: #!/usr/bin/perl use LWP::Simple; use HTML::Parse; use HTML::FormatText; use CGI; $query = new CGI; my ($html, $ascii); $html = get("http://www.tcmb.gov.tr/kurlar/today.html";); defined $html or die "Sayfa gelmiyor bi turlu!!"; $ascii = HTML::FormatText->new->format(parse_html($html)); @satircik=split /\n/,$ascii; $dolaralis=substr($satircik[11], 30,11); $dolarsatis=substr($satircik[11], 40,11); $markalis=substr($satircik[17], 30,11); $marksatis=substr($satircik[17], 40,11); $frankalis=substr($satircik[18], 30,11); $franksatis=substr($satircik[18], 40,11); $euroalis=substr($satircik[30], 30,11); $eurosatis=substr($satircik[30], 40,11); $sterlinalis=substr($satircik[31], 30,11); $sterlinsatis=substr($satircik[31], 40,11); $output = ''; $output .= "\n\n"; $output .= "\n"; $output .= "$dolaralis\n"; $output .= "$dolarsatis\n"; $output .= "\n"; $output .= "\n"; $output .= "$markalis\n"; $output .=" $marksatis\n"; $output .=" \n"; $output .=" \n"; $output .=" $frankalis\n"; $output .=" $franksatis\n"; $output .=" \n"; $output .=" \n"; $output .=" $sterlinalis\n"; $output .=" $sterlinsatis\n"; $output .=" \n"; $output .=" \n"; $output .=" $euroalis\n"; $output .=" $euroalis\n"; $output .=" \n"; $output .="\n"; $outputfile="doviz.xml"; open (dovizhtml, ">$outputfile"); print dovizhtml $output; print $query->redirect('doviz.xml'); We have the debug error: Can't locate HTML/Parse.pm in @INC(@INC contains: /usr/lib/perl5/5.6.0/i386-linux /usr/lib/ .) at /usr/local/plesk/apache/vhosts/loop10.com/httpdocs/DDdeneme/parite2.cgi line 3 Begin Failed-compilation aborted at /usr/local/plesk/apache/vhosts/loop10.com/httpdocs/DDdeneme/parite2.cgi line 3 " Although we have the modules, why perl gives that error?!!? thanks funky Istanbul
Re: Passing Arrays In CGI
- Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 07, 2002 1:25 PM Subject: Passing Arrays In CGI > Hi there: > > I'm currently in a programming situation where my Perl CGI program a) > displays an online merchandise database ... b) allows the end-user to > select items from that database listing on an HTML page ... c) displays a > summary screen ... and then d) sends the info to a secured server socket. > > One problem I'm having now, is passing an array (a.k.a. a list) containing > merchandise items selected to another CGI program which will then create a > dynamic HTML summary screen. > > Let's say the end-user selects "milk" , "butter" , "eggs" > > and I store those items in the array @FOOD > > can I pass and entire array from one CGI Perl program to another CGI > Perl program? > > How would the second program "parse out" the array variables from the > non-array scalar variables? Are you planning on having them go from one cgi script to another via the HTML form, or are you going to call the second script directly from the first script? Shawn > > Thanks. > > -- Al Willen > > > -- > 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: regular expressions
- Original Message - From: "Octavian Rasnita" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 07, 2002 4:37 PM Subject: regular expressions > Hi all, > Do you know where I can find a good free tutorial or manual for the regular > expressions in Perl? > Thank you. I don't know of a free one that is anywhere near the caliber of Mastering Regular Expression by Jeffrey Friedl. There are lots out there, but this book, after you have read it, will allow you to make regex's effortlessly... The book is by O'Reilly ISBN:1565922573 and can be had at bookpool.com for a very reasonable price... Shawn > > Teddy, > My dear email address is [EMAIL PROTECTED] > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Passing Arrays In CGI
Hi there: I'm currently in a programming situation where my Perl CGI program a) displays an online merchandise database ... b) allows the end-user to select items from that database listing on an HTML page ... c) displays a summary screen ... and then d) sends the info to a secured server socket. One problem I'm having now, is passing an array (a.k.a. a list) containing merchandise items selected to another CGI program which will then create a dynamic HTML summary screen. Let's say the end-user selects "milk" , "butter" , "eggs" and I store those items in the array @FOOD can I pass and entire array from one CGI Perl program to another CGI Perl program? How would the second program "parse out" the array variables from the non-array scalar variables? Thanks. -- Al Willen -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: To write a script that reads numbers from STDIN and print on STDOUT.
.snip... > > The input format is a number on a line.(press enter after every number) > > I also want to ompare the resulting two numbers with > or < and print > > the largest on STDOUT. > > Is this a homework problem perchance? heh heh heh...I thought exactly the same thing when I read it. glad you didnt just do it for him J -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
multipart/x-mixed-replace and image/gif
Hi gurus, Am working on a script to generate a sequence of GIFs in an tag, when i run this script from dos, it works OK and generate the appropriate headers, but when running under a web page - hosted by Apache v 1.3 on XP - it doesn't do anything, and i use CGI::Carp(fatalsToBrowser); but it give me no sign for error, can any one give me a hand on this, thanks in advance The HTML page: The CGI script: #!f:/perl/bin/MSwin32-x86/perl5.00502.exe @files=qw/logo1.gif logo2.gif logo3.gif logo4.gif/; print "Content-type: multipart/x-mixed-replace\n\n"; foreach $file(@files){ print "$file\n\n"; print "Content-type: image/gif\n\n"; open(LOGO,"$file"); print ; close(LOGO); sleep(1); }
Re: To write a script that reads numbers from STDIN and print onSTDOUT.
On Thu, 7 Feb 2002, Bruce Ambraal wrote: > Could any one write some coding for the problem. > > In perl against Linx could someone help. > > I want to write a script that reads in four numbers from STDIN and add > the first two together, and than adds the second 2 together. > > The input format is a number on a line.(press enter after every number) > I also want to ompare the resulting two numbers with > or < and print > the largest on STDOUT. Is this a homework problem perchance? I won't take all of your fun away from writing the code yourself, but will give you a hint: You can retrieve values from STDIN like this: my $value = ; chomp value; #remove trailing newline -- Brett http://www.chapelperilous.net/ "There are things that are so serious that you can only joke about them" - Heisenberg -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
regular expressions
Hi all, Do you know where I can find a good free tutorial or manual for the regular expressions in Perl? Thank you. Teddy, My dear email address is [EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
To write a script that reads numbers from STDIN and print onSTDOUT.
Hi Could any one write some coding for the problem. In perl against Linx could someone help. I want to write a script that reads in four numbers from STDIN and add the first two together, and than adds the second 2 together. The input format is a number on a line.(press enter after every number) I also want to ompare the resulting two numbers with > or < and print the largest on STDOUT. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Multiple Print "Location:$link";
We have an epage server for our customers to use; one of them is a fire department and they would like to have a page setup with check boxes and send the same message to all who have a check beside there name. I've been trying something like the following... if($shawn ne "") { $link = "http://server.net/cgi-bin/epage.cgi?pin=$shawn\&mess=$mess print "Location:$link"; } if($rob ne "") { $link = "http://server.net/cgi-bin/epage.cgi?pin=$rob\&mess=$mess print "Location:$link"; } This works if only one checkbox is checked, but if both are checked the first message gets the message along with Location:http://server.etc appended to it. Is there someway to reset the header for the second message? Or perhaps a better way to proceed all together? Thanks in advance. Rob Good judgement comes from experience, and experience - well, that comes from poor judgement. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
File Upload Problem on IE and Opera
Hi Everyone, I'm writing a program that allows people to send emails with attachments via a web page. It stores these attachments encoded on the hard disk like they would look in the final text file that gets send. For some reason, IE and Opera isn't reading a value from the $cgi->upload but Netscape (on PC and Red Hat) and Mozilla seem to be able to. The server is the same Red Hat machine and I'm running Apache (duh!) :-) Could anyone suggest to me what is going wrong and how to fix it? Thanks, Elwyn #!/usr/local/bin/perl use strict; use DBI; use CGI; use Time::ParseDate; use Apache::Table; use LWP::MediaTypes qw(guess_media_type); use MIME::QuotedPrint; use MIME::Base64; use Mail::Sendmail 0.75; # doesn't work with v. 0.74! use LWP::MediaTypes qw(guess_media_type); use Text::Template; use lib '.'; #--- sub store_attachments { my $cgi = shift; my $session = shift; my $temp = shift; my %param = %{$temp}; my @attach_list = @{$param{attach_list}}; unless(($cgi->param("attachment_file")) && ($cgi->param("attachment_file") ne "") ) { $param{attach_result} = "OK: No Change"; return %param; } my $attachment_file = $cgi->upload("attachment_file"); # my $attachment_file = $cgi->param("attachment_file"); if (grep (/$attachment_file/, @attach_list)) { $param{attach_result} = "Error: You tried to upload the file '$attachment_file' as the attachment file. There is already a file with that name. Remove the other file before trying to upload this one again.\n"; return %param; } # THIS IS WHERE THE CODE REALISES THAT NOTHING IS BEING SET if (!(defined($attachment_file)) || ($attachment_file =~ /^\s*$/) ) { $param{attach_result} = "OK: No Change"; return %param; } # This code reads and encodes the filehandle print "VALUE IS: " . $attachment_file . ""; binmode $attachment_file; undef $/; my $encoded = encode_base64(<$attachment_file>); if ($encoded eq "") { $param{attach_result} = "Error: You selected the file '$attachment_file'. It has a zero file size or wasn't uploaded successfully."; return %param; } my @bits = split( /\//,$attachment_file); my $fileshort = $bits[ ($#bits) ];# File name without path my $type = guess_media_type($fileshort); my $filepath = TEMP_MAIL_DIR . $session->SID . "_attachment_" . $fileshort; unless (open (MFILE, ">$filepath")) { $param{attach_result} = "Error: Couldn't open the file '$filepath' for writing: $!\n"; return %param; } print MFILE < -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Renaming files on the server
Hello all, My friend (who doesn't English too well yet) has been emailing me asking about a guestbook he made. It sounds like he wants to archive his message files with a certain format and back them up automatically everyday. Here's his last email to me: "i want to store all those message everyday from that dat file to another file. or simply rename the dat file to a html or shtml file with current date everyday. so that i can make archives or history of messages. but i want to save all these messages with current date everyday automatically. please tell me coding of renaming a dat file into a different file formate(i.e. html/shtml)in perl. i want the file to be saved as this following format [mess(currentdate).html] . and i don't know the coding of that." So it sounds like he wants to take a .txt file or something and rename it to "mess(date).html" everyday automatically by using Perl. What's the easiest way of doing this? Any ideas? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]