comp.lang.perl.misc
  Home FAQ Contact Sign in
comp.lang.perl.misc only
 
Advanced search
November 2007
motuwethfrsasuw
   1234 44
567891011 45
12131415161718 46
19202122232425 47
2627282930   48
2007
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.perl.misc Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Re: Email with text file attachment         


Author: Why Tea
Date: Nov 30, 2007 20:12

>> (without MIME::LITE, etc)?
>
> Oh, in that case I would guess by re-implementing significant parts of
> MIME::LITE from scratch in your program.

Oh, not really. I have seen bits and pieces about using sendmail or
similar. I'm only after a minimal way of sending an email with a text
attachment without any additional package.
6 Comments
  Re: Newbie Question: How do I make this code snippet a loop?         


Author: Jürgen Exner
Date: Nov 30, 2007 19:16

prelim_questions@yahoo.com wrote:
> How do I turn the following into a loop or otherwise make it much
> easier to write?
> if (param("pick") eq "$quiz11[4]"){
> system("/home/username/script option1 option2 \"$quiz11[4]\" ");
> print redirect("http:my_url");
> } elsif (param("pick") eq "$quiz11[3]"){
> system("/home/username/script option1 option2 \"$quiz11[3]\" ");
> print redirect("http:my_url");
> } elsif (param("pick") eq "$quiz11[2]"){
> system("/home/username/script option1 option2 \"$quiz11[2]\" ");
> print redirect("http:my_url");
> } elsif (param("pick") eq "$quiz11[1]"){
> system("/home/username/script option1 option2 \"$quiz11[1]\" ");
> print redirect("http:my_url");
> }

Easy. Just check what changes between each case and make that part a
variable:
Show full article (1.35Kb)
no comments
  Re: Newbie Question: How do I make this code snippet a loop?         


Author: Ben Morrow
Date: Nov 30, 2007 18:51

Quoth prelim_questions@yahoo.com:
> I have only a couple weeks of experience with Perl. In that time, I
> figured out how to put together a prototype CGI application. But at
> times, I had to resort to writing bad code, because I did not know how
> to do certain things in Perl.
>
> How do I turn the following into a loop or otherwise make it much
> easier to write?
>
> if (param("pick") eq "$quiz11[4]"){

You don't need the double quotes here. See perldoc -q quoting.
> system("/home/username/script option1 option2 \"$quiz11[4]\" ");

I don't know what this script does, but if it's written in Perl there's
almost certainly a better way to use it than running it with system.

When you do need system, it's better to use the list form when you can:

system '/home/username/script', 'option1', 'option2', $quiz11[4];

or use qw// which splits on whitespace:

system qw{ /home/username/script option1 option2 }, $quiz11[4];
Show full article (3.03Kb)
no comments
  Re: OT raibow         


Author: Tad McClellan
Date: Nov 30, 2007 17:57

Petr Vileta wrote:
> My question is not perl specific but here are many clever people :-)

Folks who knowingly make off topic posts get stiffer scorefile entries.

Hope it was worth it...

--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
no comments
  Re: OT raibow         


Author: Joost Diepenmaat
Date: Nov 30, 2007 11:50

On Fri, 30 Nov 2007 18:39:35 +0100, Petr Vileta wrote:
> My question is not perl specific but here are many clever people :-) I
> want to generate html
9 Comments
  Get Paid $$$$ for Taking Online Surveys         


Author: Mike
Date: Nov 30, 2007 11:32

Get Paid $$$$ for Taking Online Surveys

Join today and receive $4 to $250 for taking online surveys that
influence the development of new products and services.

Check my web site and start immediately earning extra money from your
own computer at anywhere by taking online surveys

http://www3.sympatico.ca/abdo4/

Send me your e-mail address as well to be invited to special focus
groups and other paid surveys sites.

Don't worry there are NO FEES at all to be paid.
no comments
  Re: Net::SSH::Perl security question         


Author:
Date: Nov 30, 2007 10:28

On Fri, 30 Nov 2007 08:49:39 -0800, Joe wrote:
> We have a need to allow users to submit a job through a web server
> (front end machine) to run on back end cluster machines. I made use of
> Net::SSH::Perl in a CGI program to realize this. One thing I notice is
> that the CGI program requires a "/.ssh/known_hosts2" at the top path of
> the file system on the front end machine where Apache is running. I
> wonder does this potentially compromise any security on the system?
> Need expert advice ...

Just guessing but....

The CGI is probably looking for $HOME/.ssh/known_hosts2. Which means that
either the HOME variable is not filled, or the user has / as his homedir.

M4
no comments
  Re: Perl and a Ramdisk         


Author: smallpond
Date: Nov 30, 2007 10:12

On Nov 30, 12:46 pm, Bill H wrote:
> I am working on a chat program and am thinking of using a ramdisk to
> hold the chat data. Is there anything special I should know about
> accessing ramdisk from perl or is it just another disk to perl? On my
> development machine I don't have a ramdisk, so I will be using the HD
> for storing while debuging, but on the machine it will run on there is
> one, and it would be nice if I could just have a variable holding the
> destination and only have to change that instead of changing any
> routines that did any file i/o.
>
> Bill H

"Premature optimization is the root of all evil."
-- C. A. R. Hoare

Your plan is good right up to the part where you actually
switch over to using the ramdisk. Every modern OS already
has excellent code to do secure and reliable caching of disk
data. I would see if the disk access is actually a problem
before changing, which should be just the filename that you
open or a symbolic link.
Show full article (1.21Kb)
4 Comments
  Re: Why is a perl script 'sleep 100' uses 100 MEGS of RAM         


Author: smallpond
Date: Nov 30, 2007 09:25

Ignoramus22774 wrote:
> I have a Fedora 8 Linux box with 64 bit OS and stock perl.
>
> Just invoking perl executable seems to take 100 MEGS of virtual memory!
>
> That's a huge amount. Here's proof:
>
> work$ perl -e 'sleep 10' & sleep 1; ps -eo pid,vsz,rsz,args|grep perl |grep 'sleep 10'
> [3] 15023
> 15023 98892 1404 perl -e sleep 10
> ^^^^^^^ virtual memory use
>
> My question is, WTF is going on, why does it need so much memory all of a sudden.
>
> For your information, on my home 32 bit linux box running Fedora 6, it uses 3 megs of VM:
>
> home$
> perl -e 'sleep 10' & sleep 1; ps -eo pid,vsz,rsz,args|grep perl |grep 'sleep 10'
> [1] 27037
> 27037 3744 1236 perl -e sleep 10 ...
Show full article (1.63Kb)
3 Comments
  East european characters from LaTex to UTF8         


Author: Francois
Date: Nov 30, 2007 08:11

Hi
With the module TeX::Encode and Encode, I convert characters from
LaTex to UTF8. It works great except for characters use in Slovacia,
for example c or z with caron: č ž

TeX::Encode use the followings modules
use Encode::Encoding;
use Pod::LaTeX;
use HTML::Entities

and from the comments in TeX::Encode "It uses the the mapping from
Pod::LaTeX, but we use HTML::Entities
to get the Unicode character".
Is there another module I should install to convert these east
european characters ?
Thanks for any advice !

Francois
4 Comments
1 2 3 4 5 6 7 8 9