| 
	|||||||
| View Poll Results: how do you feel about perl jam? | |||
| mmmmmm it's delicious! | 
		 | 
	8 | 57.14% | 
| uhhh, i'm not gay. (sorry, ladies) | 
		 | 
	6 | 42.86% | 
| Voters: 14. You may not vote on this poll | |||
![]()  | 
            
        
| 
             | 
        Thread Tools | Search this Thread | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 fbdev 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 107 
				Karma: 70177 
				Join Date: Jul 2011 
				
				
				
				Device: kindle 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			oh, right... i was so distracted by nonsense i forgot to write the manual. 
		
	
		
		
		
		
		
		
		
		
		
		
		
			# tar xvzf /tmp/perl.tar.gz -C /mnt/us/system # mntroot rw # ln -s /mnt/us/system/perl /opt/perl # mntroot ro # export PATH=$PATH:/opt/perl/bin # echo 'hello, world!'|perl -ne 'print' Last edited by fbdev; 08-27-2011 at 03:34 AM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#3 | 
| 
			
			
			
			 fbdev 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 107 
				Karma: 70177 
				Join Date: Jul 2011 
				
				
				
				Device: kindle 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			posting and watching the weather channel 
		
	
		
		
		
		
		
		
		
		
		
		
	
	leads to writing with your head in the clouds.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#4 | 
| 
			
			
			
			 Junior Member 
			
			![]() Posts: 4 
				Karma: 10 
				Join Date: Oct 2011 
				
				
				
				Device: kindle dxg 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Anyone knew how to use it?
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#5 | 
| 
			
			
			
			 Connoisseur 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79 
				Karma: 2718 
				Join Date: Aug 2011 
				
				
				
				Device: Kindle 3G 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			If you don't know how to use it, trust me on this: You don't need it.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#6 | 
| 
			
			
			
			 Junior Member 
			
			![]() Posts: 4 
				Karma: 10 
				Join Date: Oct 2011 
				
				
				
				Device: kindle dxg 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			maybe you are right. I am just learning perl in windows by activeperl. And I know little about linux. Maybe you are all experts in this field. I do not feel ashamed as a beginner.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#7 | 
| 
			
			
			
			 Connoisseur 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79 
				Karma: 2718 
				Join Date: Aug 2011 
				
				
				
				Device: Kindle 3G 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Oh we're definitely not all experts. I'm certainly not. Hopefully my comment didn't come across as condescending. I know what perl is and how to use it, but I actually have no use for it on the Kindle. fbdev is still that man though.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#8 | |
| 
			
			
			
			 hub 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 715 
				Karma: 2151032 
				Join Date: Jan 2012 
				Location: Iranian in Canada 
				
				
				Device: K3G, DXG, Kobo mini 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	 | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#9 | 
| 
			
			
			
			 Connoisseur 
			
			![]() Posts: 58 
				Karma: 26 
				Join Date: Dec 2011 
				
				
				
				Device: K3G, KF2 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			OK, I've installed bozohttpd on my K3G with no errors, can load a page with localhost, using the command line bozohttpd -b -c /mnt/us/www/cgi-bin -X /mnt/us/www, but when I try to submit a form, it says that it can't download the file, which I'm assuming means that either CGI didn't initiate or I'm incorrectly using the Perl I installed, and it's trying to download the .cgi file rather than load it. 
		
	
		
		
			I don't really know much about bozohttpd, nor am I sure what to put in the shebang line of index.cgi, so the problem might lie there. I've attached the files I'm using for this Perl program, which works with no problems on my computer. I have tried both Code: 
	#!/mnt/us/system/perl/bin/perl and #!/opt/perl/bin/perl ![]() F.Y.I. I was successfully able to print out "hello world" in the tutorial by fbdev, so I am sure that Perl is correctly installed. UPDATE: I tried going to http://localhost/cgi-bin and it says the Kindle can't load the page, even though the cgi-bin shows up in the directory if I go to localhost with no index.html, so I don't know what's going on... Last edited by sjheiss; 02-16-2012 at 10:33 PM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#10 | 
| 
			
			
			
			 (offline) 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,907 
				Karma: 6736094 
				Join Date: Dec 2011 
				
				
				
				Device: K3, K4, K5, KPW, KPW2 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Are you sure that the CGI module is installed on the device? 
		
	
		
		
		
		
		
		
		
		
		
		
	
	Try running that script from the command line *on the Kinde*.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#11 | |
| 
			
			
			
			 Connoisseur 
			
			![]() Posts: 58 
				Karma: 26 
				Join Date: Dec 2011 
				
				
				
				Device: K3G, KF2 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 In response to my other thread that you posted on, I ran ps aux and found that for some reason bozo started with "-c /mnt/us/www" and not "-c /mnt/us/www/cgi-bin" like I thought I did, so after I get my browser to crash and try killing it I'll see if I can fix that.  
		Last edited by sjheiss; 02-16-2012 at 10:51 PM.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#12 | 
| 
			
			
			
			 (offline) 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,907 
				Karma: 6736094 
				Join Date: Dec 2011 
				
				
				
				Device: K3, K4, K5, KPW, KPW2 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			To run the perl file, just execute "/path/to/index.cgi" on the device. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	This will actually allow to check multiple things: - whether permissions are set correctly (i.e., file is executable). For all cgi-bin implementations I know, files must be executable (i.e. "chmod 755 /path/to/index.cgi" - whether the shebang is correct - whether the perl contents of the file can actually be correctly evaluated. I'm pretty sure that you'll get something like "CGI.pm not found" (or similar).  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#13 | 
| 
			
			
			
			 Connoisseur 
			
			![]() Posts: 58 
				Karma: 26 
				Join Date: Dec 2011 
				
				
				
				Device: K3G, KF2 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			OK, if I run the command you gave, gives me the error in the attached picture.  
		
	
		
		
			I checked ps aux and it shows bozohttpd as "/mnt/us/myts/bozohttpd -b -c /mnt/us/www/cgi-bin -X /mnt/us/www" so it looks like it's starting correctly, but perhaps not. Permissions are indeed 755. Anyways, thanks a lot for the continued help! (Also, tried running your command on my Kindle directly, with myts, and got the same exact error as the picture.) Last edited by sjheiss; 02-16-2012 at 11:22 PM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#14 | 
| 
			
			
			
			 (offline) 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,907 
				Karma: 6736094 
				Join Date: Dec 2011 
				
				
				
				Device: K3, K4, K5, KPW, KPW2 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Well, before you even try to run things through httpd/cgi-bin, you should be sure that your file is actually working correctly. The web server does nothing but execute the script, just like you can from the command line. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	Try running this simple script instead, first (adjust shebang accordingly): Code: 
	#!/usr/bin/perl
use strict;
$|=1;
print "Content-Type: text/plain\n\n";
print "Environment variables:\n";
foreach (keys(%ENV)){
	print "\$ENV{'".$_."'} == ".$ENV{$_}."\n";
}
 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#15 | 
| 
			
			
			
			 Connoisseur 
			
			![]() Posts: 58 
				Karma: 26 
				Join Date: Dec 2011 
				
				
				
				Device: K3G, KF2 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			MASS EDIT: Woohoo! I got your script working. It was extremely simple to fix. The lib files were in /opt/perl/lib/perl5/5.14.1/ where they should've been no "perl5" folder, so just /opt/perl/lib/5.14.1/ 
		
	
		
		
		
		
		
		
		
		
		
		
		
			Is it possible to make a .bash_profile or .basrc file on the Kindle, so i don't have to export PATH every time? Many thanks for the help, probably would've never realized it without you! Last edited by sjheiss; 02-17-2012 at 12:23 AM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
            
| Tags | 
| fbdev, kindle tools | 
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Perl and Regex | Alexander Turcic | Lounge | 3 | 01-25-2011 08:48 PM | 
| Any good Perl scripters out there? | Goshzilla | Workshop | 28 | 04-09-2010 03:55 PM | 
| perl for the DR800/DR1000? | Mr. X | iRex | 1 | 03-16-2010 08:47 AM | 
| Perl processing | alexxxm | Sony Reader | 3 | 11-26-2007 07:13 AM | 
| Any perl or python gurus? | jbenny | Workshop | 0 | 11-23-2007 04:27 PM |