Lighttpd + FCGI = Socket not closing?
Hi there, I'm using the FCGI module (version 0.67) and a lighttpd to create an imageserver. But currently I have the problem that if I shutdown the lighttpd server, the perl processes are still there with an open file descriptor to the socket. There are not a child process anymore and are only killable. Here some code: #!/usr/bin/perl use strict; use warnings; use FCGI; my $handling_request = 0; my $exit_requested = 0; my $request = FCGI::Request(); sub sig_handler { $exit_requested = 1; if ( !$handling_request ) { $request->Flush(); $request->Finish(); exit( 0 ); } } $SIG{USR1} = &sig_handler; $SIG{TERM} = &sig_handler; $SIG{PIPE} = 'IGNORE'; # Main function sub do_request { $request->Flush(); $request->Finish(); } while ( $handling_request = ( $request->Accept() >= 0 ) ) { &do_request; $handling_request = 0; last if $exit_requested; } $request->Flush(); $request->Finish(); exit( 0 ); Here is the lighttpd config (only fastcgi section): fastcgi.server = ( "" => (( "max-procs" => 1, "socket" => "/tmp/img.promobil.de.fcgi.socket", "bin-path" => "/home/friedrich/public_html/promobil/trunk/imageserver/imageserver.pl", "check-local" => "disable", "allow-x-send-file" => "enable", )) ) I don't know why the perl processes hung there and do not exit... Here also some output of lsof (from such a process): imageserv 21482 www-data cwd DIR 3,5 4096 17076805 /home/friedrich/public_html/promobil/trunk/imageserver imageserv 21482 www-data rtd DIR 3,1 4096 2 / imageserv 21482 www-data txt REG 3,1 1061700 4637988 /usr/bin/perl imageserv 21482 www-data mem REG 0,0 0 [heap] (stat: No such file or directory) imageserv 21482 www-data mem REG 3,1 51936 4670723 /usr/lib/perl5/auto/FCGI/FCGI.so imageserv 21482 www-data mem REG 3,1 111304 4655487 /usr/lib/perl/5.8.8/auto/POSIX/POSIX.so imageserv 21482 www-data mem REG 3,1 123180 4838084 /usr/share/locale/de/LC_MESSAGES/libc.mo imageserv 21482 www-data mem REG 3,1 16672 3424409 /usr/lib/libXdmcp.so.6.0.0 imageserv 21482 www-data mem REG 3,1 7220 3424404 /usr/lib/libXau.so.6.0.0 imageserv 21482 www-data mem REG 3,1 320344 3424432 /usr/lib/libXt.so.6.0.0 imageserv 21482 www-data mem REG 3,1 288776 3424669 /usr/lib/libjasper-1.701.so.1.0.0 imageserv 21482 www-data mem REG 3,1 78500 3425061 /usr/lib/libz.so.1.2.3 imageserv 21482 www-data mem REG 3,1 1148124 3425051 /usr/lib/libxml2.so.2.6.27 imageserv 21482 www-data mem REG 3,1 66200 4345035 /lib/libbz2.so.1.0.3 imageserv 21482 www-data mem REG 3,1 965952 3424401 /usr/lib/libX11.so.6.2.0 imageserv 21482 www-data mem REG 3,1 85060 3424349 /usr/lib/libICE.so.6.3.0 imageserv 21482 www-data mem REG 3,1 32144 3424396 /usr/lib/libSM.so.6.0.0 imageserv 21482 www-data mem REG 3,1 52848 3424411 /usr/lib/libXext.so.6.4.0 imageserv 21482 www-data mem REG 3,1 137760 3424926 /usr/lib/libpng12.so.0.15.0 imageserv 21482 www-data mem REG 3,1 127488 3424674 /usr/lib/libjpeg.so.62.0.0 imageserv 21482 www-data mem REG 3,1 434840 3424584 /usr/lib/libfreetype.so.6.3.10 imageserv 21482 www-data mem REG 3,1 343712 3425020 /usr/lib/libtiff.so.4.2.1 imageserv 21482 www-data mem REG 3,1 197880 3424800 /usr/lib/liblcms.so.1.0.15 imageserv 21482 www-data mem REG 3,1 3637020 3424364 /usr/lib/libMagick.so.9.0.0 imageserv 21482 www-data mem REG 3,1 18824 4655442 /usr/lib/perl/5.8.8/auto/Time/HiRes/HiRes.so imageserv 21482 www-data mem REG 3,1 11075 4703010 /usr/local/lib/perl/5.8.8/auto/String/CRC32/CRC32.so imageserv 21482 www-data mem REG 3,1 270772 4670737 /usr/lib/perl5/auto/Image/Magick/Magick.so imageserv 21482 www-data mem REG 3,1 11784 4655489 /usr/lib/perl/5.8.8/auto/Fcntl/Fcntl.so imageserv 21482 www-data mem REG 3,1 20592 6422549 /usr/local/lib/perl/5.8.8/auto/IO/IO.so imageserv 21482 www-data mem REG 3,1 14133 5341196 /usr/local/lib/perl/5.8.8/auto/Cwd/Cwd.so imageserv 21482 www-data mem REG 3,1 30392 4655249 /usr/lib/perl/5.8.8/auto/Data/Dumper/Dumper.so imageserv 21482 www-data mem REG 3,1 21568 4653125 /usr/lib/gconv/gconv-modules.cache imageserv 21482 www-data mem REG 3,1 126854 4702923 /usr/local/lib/perl/5.8.8/auto/List/MoreUtils/MoreUtils.so imageserv 21482 www-data mem REG 3,1 9553 5832710 /usr/local/lib/perl/5.8.8/auto/Devel/GlobalDestruction/GlobalDestruction.so imageserv 21482 www-data mem REG 3,1 11162 4703017 /usr/local/lib/perl/5.8.8/auto/Sub/Name/Name.so imageserv 21482 www-data mem REG 3,1 23758 4702897 /usr/local/lib/perl/5.8.8/auto/Class/C3/XS/XS.so imageserv 21482 www-data mem REG 3,1 1902160 3145750 /usr/lib/locale/locale-archive imageserv 21482 www-data mem REG 3,1 21868 4358808 /lib/tls/i686/cmov/libcrypt-2.3.6.so imageserv 21482 www-data mem REG 3,1 1253680 4358806 /lib/tls/i686/cmov/libc-2.3.6.so imageserv 21482 www-data mem REG 3,1 89370 4358823 /lib/tls/i686/cmov/libpthread-2.3.6.so imageserv 21482 www-data mem REG 3,1 145136 4358805 /lib/tls/i686/cmov/libm-2.3.6.so imageserv 21482 www-data mem REG 3,1 9592 4358801 /lib/tls/i686/cmov/libdl-2.3.6.so imageserv 21482 www-data mem R
Error in the compilation of vpopmail module
Hi, I'm trying to install a module from CPAN, the vpopmail.pm module. I'm running redhat 8.0 + vpopmail 5.2.1. When I run 'make' to compile the makefile created by the makefile.PL script, i receive the following error messages: vpopmail lives in: /var/vpopmail includes: -I/var/vpopmail/include libs: -L/var/vpopmail/lib -lvpopmail defs: Checking if your kit is complete... Looks good Writing Makefile for vpopmail cp vpopmail.pm blib/lib/vpopmail.pm /usr/bin/perl /usr/lib/perl5/5.8.0/ExtUtils/xsubpp -typemap /usr/lib/perl5/5.8.0/ExtUtils/typemap -typemap typemap vpopmail.xs > vpopmail.xsc && mv vpopmail.xsc vpopmail.c Please specify prototyping behavior for vpopmail.xs (see perlxs manual) gcc -c -I/var/vpopmail/include -D_REENTRANT -D_GNU_SOURCE -fno-strict-alias ing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -marc h=i386 -mcpu=i686 -DVERSION=\"0.08\" -DXS_VERSION=\"0.08\" -fpic "-I/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE" vpopmail.c In file included from vpopmail.xs:12: /var/vpopmail/include/vpopmail.h:129:13: macro "crypt" requires 2 arguments, but only 1 given In file included from vpopmail.xs:12: /var/vpopmail/include/vpopmail.h:129: `crypt' redeclared as different kind of symbol /usr/include/crypt.h:33: previous declaration of `crypt' In file included from vpopmail.xs:13: /var/vpopmail/include/vpopmail_config.h:173:1: warning: "VERSION" redefined vpopmail.c:1:1: warning: this is the location of the previous definition vpopmail.c: In function `XS_vpopmail_vauth_user': vpopmail.c:210: warning: assignment makes integer from pointer without a cast vpopmail.xs: In function `XS_vpopmail_vauth_setpw': vpopmail.xs:452: warning: assignment makes integer from pointer without a cast make: *** [vpopmail.o] Error 1 /usr/bin/make -- NOT OK Running make test Can't test without successful make Running make install make had returned bad status, install seems impossible How can I fix it? thank you all, - -- Bruno Negrão -- Suporte -- Plugway Acesso Internet Ltda. -- (31)34812311 -- [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
dbmopen can't open /etc/aliases.db file
Hi, I'm triyng to open the /etc/aliases.db file for reading with the dbmopen function - the result is that I can't open the file for reading, or something like this. yes, I have permission because I'm root. My script is: #!/usr/bin/perl -w use diagnostics; dbmopen(%ALIAS,'/etc/aliases',undef) || die "No aliases!: $!"; while (($key,$value) = each(%ALIAS)) { chop($key,$value); print "$key $value\n"; } the output error is: ### Use of uninitialized value in dbmopen at ./zz line 3 (#1) (W uninitialized) An undefined value was used as if it were already defined. It was interpreted as a "" or a 0, but maybe it was a mistake. To suppress this warning assign a defined value to your variables. Use of uninitialized value in null operation at ./zz line 3 (#1) Uncaught exception from user code: No aliases!: Invalid argument at ./zz line 3. Does someone could explain me why is it happening? (i'm using perl 5.6.0 and Red Hal linux 7.2) Thank you, - -- Bruno Negrão -- Suporte -- Plugway Acesso Internet Ltda. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dbmopen can't open /etc/aliases.db file
Hi Michael, the problem is not with the "undef" value - undef is fine - if you read the dbmopen's documentation you could see it. If I choose a value like "0644" the script still doesn't work. Bellow, is the output of the execution of the same program, but with 0644 in place of undef: Uncaught exception from user code: No aliases!: Invalid argument at ./zz line 3. I must admit that the errors are shorter but the program still doesn't work!! Oh, hell!!! Thank you for any help, bnegrao. - Original Message - From: "Michael Kelly" <[EMAIL PROTECTED]> To: "Perl Beginners List" <[EMAIL PROTECTED]> Sent: Friday, September 27, 2002 1:04 AM Subject: Re: dbmopen can't open /etc/aliases.db file > On Thu, Sep 26, 2002 at 09:38:18PM -0300, Bruno Negrao - Perl List wrote: > > Hi, > > Hi Bruno, > > > I'm triyng to open the /etc/aliases.db file for reading with the dbmopen > > function - the result is that I can't open the file for reading, or > > something like this. yes, I have permission because I'm root. > > > > My script is: > > #!/usr/bin/perl -w > > use diagnostics; > > dbmopen(%ALIAS,'/etc/aliases',undef) || > > die "No aliases!: $!"; > > while (($key,$value) = each(%ALIAS)) { > > chop($key,$value); > > print "$key $value\n"; > > } > > Disclaimer: I've never messed around with dbmopen() before, so I can't test this > example, but seeing as nobody with more authority has answered this yet, I'll > give it a shot: > > dbmopen() expects a file permission mask (an octal number) as its third argument, > which 'undef' is not. You might try something like this as your lines 3 and 4: > > dbmopen(%ALIAS,'/etc/aliases', 0644) || > die "No aliases!: $!"; > > Even if you're sure /etc/aliases is there, that should make dbmopen() happy. > > Again, not sure if that's the answer, but it seems logical to me, > -- > Michael > > -- > 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: dbmopen can't open /etc/aliases.db file
Thank you nkuipers for answering. I already tried declaring variables with "my", i already checked the path, i tested the hash with another name - all this doesn't make difference. To me, it seems that my /etc/aliases.db in written in a format uncompatible with the dbmopen(). I'm on the 17 chapter of the book "Learning Perl second edition" and I'm stuck in this problem. (to open the /etc/aliases.db file for reading is an exercise of the chapter 17). If somebody there has a server runing Sendmail, you have the aliases.db file too. Moreover to simply solve this exercise, i'd like to know it the dbmopen() really works with my system files. Thanks for any help, Bruno. - Original Message - From: "nkuipers" <[EMAIL PROTECTED]> To: "Bruno Negrao - Perl List" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, September 27, 2002 12:30 PM Subject: RE: dbmopen can't open /etc/aliases.db file > >Uncaught exception from user code: > >No aliases!: Invalid argument at ./zz line 3. > > Well you have three arguments. If you are *sure* that the undef is not the > problem, that leaves only two to possibly be invalid. To start, try battening > down the hatches with use strict, predeclaring your vars with my. Does using > a hash NOT called ALIAS make a difference (the implication being maybe that is > somehow a reserved identifier for hashes on your system or distro)? Are you > *sure* that the path specified in the dbmopen call is 100% correct? Dumb, > dumb questions but most problems in programming turn out to be really stupid, > and it doesn't hurt to brainstorm and try anything. > > > > > >I must admit that the errors are shorter but the program still doesn't > >work!! > >Oh, hell!!! > > > >Thank you for any help, > >bnegrao. > > > > > >- Original Message - > >From: "Michael Kelly" <[EMAIL PROTECTED]> > >To: "Perl Beginners List" <[EMAIL PROTECTED]> > >Sent: Friday, September 27, 2002 1:04 AM > >Subject: Re: dbmopen can't open /etc/aliases.db file > > > > > >> On Thu, Sep 26, 2002 at 09:38:18PM -0300, Bruno Negrao - Perl List wrote: > >> > Hi, > >> > >> Hi Bruno, > >> > >> > I'm triyng to open the /etc/aliases.db file for reading with the dbmopen > >> > function - the result is that I can't open the file for reading, or > >> > something like this. yes, I have permission because I'm root. > >> > > >> > My script is: > >> > #!/usr/bin/perl -w > >> > use diagnostics; > >> > dbmopen(%ALIAS,'/etc/aliases',undef) || > >> > die "No aliases!: $!"; > >> > while (($key,$value) = each(%ALIAS)) { > >> > chop($key,$value); > >> > print "$key $value\n"; > >> > } > >> > >> Disclaimer: I've never messed around with dbmopen() before, so I can't > >test this > >> example, but seeing as nobody with more authority has answered this yet, > >I'll > >> give it a shot: > >> > >> dbmopen() expects a file permission mask (an octal number) as its third > >argument, > >> which 'undef' is not. You might try something like this as your lines 3 > >and 4: > >> > >> dbmopen(%ALIAS,'/etc/aliases', 0644) || > >> die "No aliases!: $!"; > >> > >> Even if you're sure /etc/aliases is there, that should make dbmopen() > >happy. > >> > >> Again, not sure if that's the answer, but it seems logical to me, > >> -- > >> Michael > >> > >> -- > >> 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: dbmopen can't open /etc/aliases.db file
Thank you nkuipers for answering. I already tried declaring variables with "my", i already checked the path, i tested the hash with another name - all this doesn't make difference. To me, it seems that my /etc/aliases.db in written in a format uncompatible with the dbmopen(). I'm on the 17 chapter of the book "Learning Perl second edition" and I'm stuck in this problem. (to open the /etc/aliases.db file for reading is an exercise of the chapter 17). If somebody there has a server runing Sendmail, you have the aliases.db file too. Moreover to simply solve this exercise, i'd like to know it the dbmopen() really works with my system files. Thanks for any help, Bruno. - Original Message - From: "nkuipers" <[EMAIL PROTECTED]> To: "Bruno Negrao - Perl List" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, September 27, 2002 12:30 PM Subject: RE: dbmopen can't open /etc/aliases.db file > >Uncaught exception from user code: > >No aliases!: Invalid argument at ./zz line 3. > > Well you have three arguments. If you are *sure* that the undef is not the > problem, that leaves only two to possibly be invalid. To start, try battening > down the hatches with use strict, predeclaring your vars with my. Does using > a hash NOT called ALIAS make a difference (the implication being maybe that is > somehow a reserved identifier for hashes on your system or distro)? Are you > *sure* that the path specified in the dbmopen call is 100% correct? Dumb, > dumb questions but most problems in programming turn out to be really stupid, > and it doesn't hurt to brainstorm and try anything. > > > > > >I must admit that the errors are shorter but the program still doesn't > >work!! > >Oh, hell!!! > > > >Thank you for any help, > >bnegrao. > > > > > >- Original Message - > >From: "Michael Kelly" <[EMAIL PROTECTED]> > >To: "Perl Beginners List" <[EMAIL PROTECTED]> > >Sent: Friday, September 27, 2002 1:04 AM > >Subject: Re: dbmopen can't open /etc/aliases.db file > > > > > >> On Thu, Sep 26, 2002 at 09:38:18PM -0300, Bruno Negrao - Perl List wrote: > >> > Hi, > >> > >> Hi Bruno, > >> > >> > I'm triyng to open the /etc/aliases.db file for reading with the dbmopen > >> > function - the result is that I can't open the file for reading, or > >> > something like this. yes, I have permission because I'm root. > >> > > >> > My script is: > >> > #!/usr/bin/perl -w > >> > use diagnostics; > >> > dbmopen(%ALIAS,'/etc/aliases',undef) || > >> > die "No aliases!: $!"; > >> > while (($key,$value) = each(%ALIAS)) { > >> > chop($key,$value); > >> > print "$key $value\n"; > >> > } > >> > >> Disclaimer: I've never messed around with dbmopen() before, so I can't > >test this > >> example, but seeing as nobody with more authority has answered this yet, > >I'll > >> give it a shot: > >> > >> dbmopen() expects a file permission mask (an octal number) as its third > >argument, > >> which 'undef' is not. You might try something like this as your lines 3 > >and 4: > >> > >> dbmopen(%ALIAS,'/etc/aliases', 0644) || > >> die "No aliases!: $!"; > >> > >> Even if you're sure /etc/aliases is there, that should make dbmopen() > >happy. > >> > >> Again, not sure if that's the answer, but it seems logical to me, > >> -- > >> Michael > >> > >> -- > >> 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: dbmopen can't open /etc/aliases.db file
Ok david. Could you send me a code example of a database file being opened for reading with tie? thanks, bnegrao. - Original Message - From: "david" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, September 27, 2002 2:41 PM Subject: Re: dbmopen can't open /etc/aliases.db file > Bruno Negrao - Perl List wrote: > > > Hi Michael, the problem is not with the "undef" value - undef is fine - > > if you read the dbmopen's documentation you could see it. > > > > If I choose a value like "0644" the script still doesn't work. > > Bellow, is the output of the execution of the same program, but with 0644 > > in place of undef: > > > > Uncaught exception from user code: > > No aliases!: Invalid argument at ./zz line 3. > > > > I must admit that the errors are shorter but the program still doesn't > > work!! > > Oh, hell!!! > > > > the dbmopen function has been largely superseded by the "tie" function. > you shouldn't use it in the first place. > > in older version of Perl or that your system do not support DBM or ndbm, > calling dbmopen generates a fatal error and it tries the sdbm calls. > > try eval{ dbmopen(..) } and check the $@ error > > if you can, try not to use dbmopen at all, tie is better, safer and faster. > > david > > -- > 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: dbmopen can't open /etc/aliases.db file
Yeah it worked! I simply changed the '/usr/lib/news/history' for '/etc/aliases' and the script showed the file contents. But, why? Why dbmopen didn't work? thanks, Bruno. - Original Message - From: "david" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, September 27, 2002 3:49 PM Subject: Re: dbmopen can't open /etc/aliases.db file > Bruno Negrao - Perl List wrote: > > > Ok david. > > > > Could you send me a code example of a database file being opened for > > reading with tie? > > > > thanks, > > bnegrao. > > use NDBM_File; > tie(%HIST, 'NDBM_File', '/usr/lib/news/history', 1, 0); > while (($key,$val) = each %HIST) { > print $key, ' = ', unpack('L',$val), "\n"; > } > untie(%HIST); > > this example is directly from perldoc -f tie > > david > > -- > 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: autoftp
Yes. Exist the Net::FTP module. The following text comes from the Oreilly's book "Perl in a Nutshell" 16.2 Net::FTP Net::FTP is used to transfer files from remote hosts. Using Net::FTP, you can write simple FTP clients that transfer files from remote servers based on information passed on the command line or from hard-coded variables. Here is an example of a client that connects to a remote FTP server and gets a file from the server: #!/usr/local/bin/perl -w use Net::FTP; $hostname = 'remotehost.com'; $username = 'anonymous'; $password = '[EMAIL PROTECTED]'; # Hardcode the directory and filename to get $home = '/pub'; $filename = 'TESTFILE'; # Open the connection to the host $ftp = Net::FTP->new($hostname); # construct object $ftp->login($username, $password); # log in $ftp->cwd($home),"\n"; # change directory print $ftp->ls($home),"\n"; # Now get the file and leave $ftp->get($filename); $ftp->quit; FTP clients have also been integrated with most World Wide Web browsers, using ftp:// in place of http://. When the URL points to a directory, the browser displays a listing of the directory, where each filename is a link to that file. When the URL points directly to a file, the remote file is downloaded. Here's an example that uses Net::FTP to list files from a remote FTP server on a web page, with a link from each file to the URL of the file on the remote site: #!/usr/local/bin/perl -w use Net::FTP; $hostname = 'remotehost.com'; # ftp host $username = 'anonymous';# username $password = '[EMAIL PROTECTED]'; # password $home = '/pub'; $ftp = Net::FTP->new($hostname);# Net::FTP constructor $ftp->login($username, $password); # log in w/username and password $pwd = $ftp->pwd; # get current directory # Now, output HTML page. print < Download Files Current working directory: $pwd Files to download: HTML @entries = $ftp->ls($home); # slurp all entries into an array foreach (@entries) { # now, output links for all files in the ftp area # as links print "\n"; print "ftp://$hostname$_\";>", "http://www/icons/f.gif\"; border=0>\n"; print " $_\n"; } print < HTML $ftp->quit; # end FTP session The Net::FTP module implements a subset (as shown earlier in this chapter) of the FTP protocol as defined in RFC 959. In addition to providing the methods shown below, the module inherits from Net::Cmd. Some of the Net::FTP methods return an object derived from the dataconn class (which is in turn derived from the IO::Socket::INET class), as noted in the entries for those methods. The following methods are defined by Net::FTP: new abort appe append authorize ascii binary byte cdup cwd delete dir ebcdic get list login ls mdtm mkdir nlst pasv pasv_wait pasv_xfer pasv_xfer_unique port put put_unique pwd quit quot rename retr rmdir size stor stou supported type unique_name - Original Message - From: "William Black" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, September 27, 2002 3:23 PM Subject: re: autoftp > Hello All, > > Does anyone know if perl offers an autoftp module? If they do what is it > and how does it work. > > Cheers, > > William Black > > > > _ > Chat with friends online, try MSN Messenger: http://messenger.msn.com > > > -- > 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]
CGI simple but not working
Hi all, I'm studying the "Learning Perl Second Edition" and I'm learning cgi now. The book presents a sample cgi that doesn't produces the expected result as the book says it would. Could someone test it and say to me if there is something wrong? The following script was retired from the section 19.6 "Form Generation". #!/usr/bin/perl -w # cgi-bin/ice_cream: program to answer *and generate* ice cream # favorite flavor form (version 3) use CGI qw(:standard); my $favorite = param("flavor"); print header, start_html("Hello Ice Cream"), h1("Hello Ice Cream"); if ($favorite) { print q("Your favorite flavor is $favorite."); } else { print hr, start_form; # hr() emits html horizontal rule: print q("Please select a flavor: ", textfield("flavor","mint")); print end_form, hr; } Thanks for any help, - -- Bruno Negrão -- Suporte -- Plugway Acesso Internet Ltda. -- (31)34812311 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CGI simple but not working
Hello Nathanael and other guys, > First of all, if possible, use the Llama 3rd, not 2nd. It's not... :-( > Second, can you give the expected output and the actual output. I tried to send the pictures to this list but my e-mail was rejected as it grew upon 5 bytes In sumary, this script should generate an one field form. But what appears in the screen are the strings inside the "q()" function. > What platform are you on, what version of perl are you using, etc? Redhat 6.2 perl version 5.005_03 built for i386-linux But i tested this script with RH7.2 v5.6.0 built for i386-linux and it doesn't work too Thanks Bruno. > Nathanael > > "Ain't no blood in my body, it's liquid soul in my veins" > ~Roots Manuva > > > -- > 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: CGI simple but not working - I discovered
Hi all, the problem is that the script is really erroneous. Where you read "q(..." should be "p( ..." The p() function is a part of the CGI.pm modules and stands for a new paragraph. the right script is: #!/usr/bin/perl -w # cgi-bin/ice_cream: program to answer *and generate* ice cream # favorite flavor form (version 3) use CGI qw(:standard); my $favorite = param("flavor"); print header, start_html("Hello Ice Cream"), h1("Hello Ice Cream"); if ($favorite) { print p("Your favorite flavor is $favorite."); } else { print hr, start_form; # hr() emits html horizontal rule: print p("Please select a flavor: ", textfield("flavor","mint")); print end_form, hr; } Thanks, bnegrao. - Original Message - From: "Bruno Negrao - Perl List" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, October 03, 2002 9:44 PM Subject: Re: CGI simple but not working > Hello Nathanael and other guys, > > First of all, if possible, use the Llama 3rd, not 2nd. > It's not... :-( > > > Second, can you give the expected output and the actual output. > I tried to send the pictures to this list but my e-mail was rejected as it > grew upon 5 bytes > In sumary, this script should generate an one field form. But what appears > in the screen are the strings inside the "q()" function. > > > What platform are you on, what version of perl are you using, etc? > Redhat 6.2 perl version 5.005_03 built for i386-linux > But i tested this script with RH7.2 v5.6.0 built for i386-linux and it > doesn't work too > > Thanks > Bruno. > > Nathanael > > > > "Ain't no blood in my body, it's liquid soul in my veins" > > ~Roots Manuva > > > > > > -- > > 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: Regular expression
> Hi Javeed , > > the last element of the array is $attt[$#attt]. If you have one line per > element, that should do it. Right. This is the easiest way. But, just to answer him, what he could do using regular expression could be something like: foreach (@attt) { /=/ && ( ($out) = (split (/=/))[1] ); } Bruno. > > R > > At 14:24 04/10/2002 +0530, Javeed SAR wrote: > > >I have the following output in array @attt > >I want the last line in a variable $out. > >What should the regular expression be? > > > > > >attribute type "SYNC_CHECK" > > created 04-Oct-02.09:36:42 by javeed.clearuser@BLRK35ED > > "for testing" > > owner: HIS\javeed > > group: HIS\clearuser > > scope: this VOB (ordinary type) > > value type: string > > Attributes: > > SYNC_CHECK = "HELLO" > > > > > >Regards > >j > > > -- > 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 expression
RE: Regular expressionHi Javeed. This code: foreach (@attt) { /=/ && ( ($out) = (split (/=/))[1] ); } stores the string "HELLO" in the variable $out. Then, if you issue print "$out" you would get a "HELLO". But when I read your e-mail again I realized that you want to store the entire last line. So yoy should use this code instead: foreach (@attt) { /=/ && ( $out = $_ ); } The foreach (@attt) starts a loop storing every line of @attt in a default variable called $_ Then, if the regul. exp "/=/" matches against the default variable $_, the && statement is executed, storing the variable $_ in the variable $out. For clarifying purposes, you could write the same code as: foreach $line (@att) { if ($line =~ /=/){ $out = $line ; print "$out"; } } And if you want to get rid of the blank spaces in the last line, add try this: foreach $line (@attt) { if ($line =~ /=/){ $out = $line ; $out =~ s/\s*//; print "$out"; } } I learnt all this from the O'reilly book "Learning Perl second edition". Tied hugs and warmfull kisses, Bruno Negrão. - Original Message - From: Javeed SAR To: Bruno Negrao - Perl List Sent: Monday, October 07, 2002 1:21 AM Subject: RE: Regular expression foreach (@attt) { /=/ && ( ($out) = (split (/=/))[1] ); } Can u explain this statement to me? Which is the variable i should use for printing the output? Regards -Original Message- From: Bruno Negrao - Perl List [mailto:[EMAIL PROTECTED]] Sent: Friday, October 04, 2002 6:54 PM To: [EMAIL PROTECTED] Subject: Re: Regular expression > Hi Javeed , > > the last element of the array is $attt[$#attt]. If you have one line per > element, that should do it. Right. This is the easiest way. But, just to answer him, what he could do using regular expression could be something like: foreach (@attt) { /=/ && ( ($out) = (split (/=/))[1] ); } Bruno. > > R > > At 14:24 04/10/2002 +0530, Javeed SAR wrote: > > >I have the following output in array @attt > >I want the last line in a variable $out. > >What should the regular expression be? > > > > > >attribute type "SYNC_CHECK" > > created 04-Oct-02.09:36:42 by javeed.clearuser@BLRK35ED > > "for testing" > > owner: HIS\javeed > > group: HIS\clearuser > > scope: this VOB (ordinary type) > > value type: string > > Attributes: > > SYNC_CHECK = "HELLO" > > > > > >Regards > >j > > > -- > 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]
Installing Curses.pm on Red Hat 8.0
Hi, I tried to install the Curses.pm module on my redhat linux 8.0 but I didn't compile. Does someone did it successfully? Any trick? Thank you, - -- Bruno Negrão -- Suporte -- Plugway Acesso Internet Ltda. -- (31)34812311 -- bnegrao at plugway dot com dot br -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]