Re: Send both parts of a multipart email

2008-08-22 Thread Jeff Pang
On Fri, Aug 22, 2008 at 8:02 AM, David Allender <[EMAIL PROTECTED]> wrote: > > send an email to a person with text/enriched text at the top of the > email, and text/html at the bottom of the email. Yes, MIME::Lite can do that. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands

Re: timing a fork

2008-08-22 Thread Rob Dixon
Raymond Wan wrote: > Rob Dixon wrote: >> >> use strict; >> use warnings; >> >> $|++; # autoflush >> >> $SIG{CHLD} = 'IGNORE'; >> >> my $kid = fork; >> >> if ($kid) { >> print "in parent whose kid is $kid\n"; >> sleep 10; >> my $running = kill(0, $kid); >> print "Child process ", $running ?

Re: timing a fork

2008-08-22 Thread Raymond Wan
Hi Rob, Rob Dixon wrote: Raymond Wan wrote: Rob Dixon wrote: What do you need to accomplish that something as simple as the code below won't do? use strict; use warnings; my $kid = fork; if ($kid) { print "in parent whose kid is $kid\n"; } elsif ($kid == 0) { print "In child\

Re: "use constant" as hash key

2008-08-22 Thread John W. Krahn
Rob Dixon wrote: Moon, John wrote: How can I use a "constant" as a hash key? $ perl -e 'use constant CAT=>A; $hash{CAT} = q{Bobby}; $hash{"CAT"} = q{Muffy}; $hash{'CAT'} = q{Fluffy}; $hash{qq{CAT}} = q{Tuffy}; print "$_ = $hash{$_}\n" foreach (keys %hash);' CAT = Tuffy $ Want... A=Bobby I

Re: "use constant" as hash key

2008-08-22 Thread Rob Dixon
Moon, John wrote: > > How can I use a "constant" as a hash key? > > $ perl -e 'use constant CAT=>A; >> $hash{CAT} = q{Bobby}; >> $hash{"CAT"} = q{Muffy}; >> $hash{'CAT'} = q{Fluffy}; >> $hash{qq{CAT}} = q{Tuffy}; >> print "$_ = $hash{$_}\n" foreach (keys %hash);' > CAT = Tuffy > $ > > Want... >

Re: Makefile.PL

2008-08-22 Thread Rob Dixon
Patrick Dupre wrote: >> Patrick Dupre wrote: >>> On Fri, 22 Aug 2008, Rob Dixon wrote: Patrick Dupre wrote: > > How can I modify my Makefile.PL to have a Makefile which can make > cc -o test.o -c test.c `perl -MExtUtils::Embed -e ccopts` > > Thank Makefile.PL is a

Re: "use constant" as hash key

2008-08-22 Thread John W. Krahn
Moon, John wrote: How can I use a "constant" as a hash key? $ perl -e 'use constant CAT=>A; $hash{CAT} = q{Bobby}; $hash{"CAT"} = q{Muffy}; $hash{'CAT'} = q{Fluffy}; $hash{qq{CAT}} = q{Tuffy}; print "$_ = $hash{$_}\n" foreach (keys %hash);' CAT = Tuffy $ Want... A=Bobby See the "Not-so-sym

Re: Makefile.PL

2008-08-22 Thread Patrick Dupre
Hello Bob, So, you do not have any solution for me ? Regards. Patrick Dupre wrote: On Fri, 22 Aug 2008, Rob Dixon wrote: Patrick Dupre wrote: How can I modify my Makefile.PL to have a Makefile which can make cc -o test.o -c test.c `perl -MExtUtils::Embed -e ccopts` Thank Makefile.PL is

Send both parts of a multipart email

2008-08-22 Thread David Allender
Hello all, I was wondering if i can send both parts of a multipart email. Basically what im trying to do is, send an email to a person with text/enriched text at the top of the email, and text/html at the bottom of the email. The reason being is so: Its a cgi that handles a form, and i need it

Re: LWP and authentication

2008-08-22 Thread Rob Dixon
ssinn wrote: > > I am currently writing a script that will connect to a URL, > authenticate itself and GET information to the site. > I am using this code out of the Perl & LWP book but it is failing. > > #!/usr/bin/perl -w > > use strict; > use warnings; > use LWP; > use URI; > > # This authent

Re: Could anyone point me to a good site for pearl compiler download.

2008-08-22 Thread Rob Dixon
rich murphy wrote: > > Could anyone point me to a good site for pearl compiler download. The short answer is here http://www.perl.org/ But it depends on what platform you are working on, and whether you know what the perl compiler is. Tell us more about what you want to do if this doesn't ans

Re: condition in a single line

2008-08-22 Thread Robert Citek
An alternate version: my $value = ( $t1lsq{$interfaceName} >= 4) ? 4 : $t1lsq{$interfaceName}; and a test: $ perl -le ' $t1lsq{$interfaceName}=2 ; my $value = ( $t1lsq{$interfaceName} >= 4) ? 4 : $t1lsq{$interfaceName}; print $value ' 2 $ perl -le ' $t1lsq{$interfaceName}=5 ; my $value = ( $t1l

LWP and authentication

2008-08-22 Thread ssinn
I am currently writing a script that will connect to a URL, authenticate itself and GET information to the site. I am using this code out of the Perl & LWP book but it is failing. #!/usr/bin/perl -w use strict; use warnings; use LWP; use URI; # This authenticates my $browser = LWP::UserAgent->ne

Could anyone point me to a good site for pearl compiler download.

2008-08-22 Thread rich murphy
Could anyone point me to a good site for pearl compiler download. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

"use constant" as hash key

2008-08-22 Thread Moon, John
How can I use a "constant" as a hash key? $ perl -e 'use constant CAT=>A; > $hash{CAT} = q{Bobby}; > $hash{"CAT"} = q{Muffy}; > $hash{'CAT'} = q{Fluffy}; > $hash{qq{CAT}} = q{Tuffy}; > print "$_ = $hash{$_}\n" foreach (keys %hash);' CAT = Tuffy $ Want... A=Bobby John W Moon -- To unsubscribe,

Re: What is wrong with this script ??

2008-08-22 Thread Perry Smith
I'm going to not CC beginners@perl.org after this point since I don't think this is a perl question right now. Please speak up if you want to be included in this thread. I'm not sure you understood my previous question. I was asking if such things as chgrp, chown, etc work from the shell

Re: What is wrong with this script ??

2008-08-22 Thread Jyotishmaan Ray
Dear All, Thanks a lot for providing me the pointers. Now i could create the homedirectories of 420 students with explicit chown and chgrp privilgeses. The thing was that the groups didnt exist so was not accepted in the chown command. Now that i have solved my problem, Thanks a zillion!!!

Re: Makefile.PL

2008-08-22 Thread Patrick Dupre
On Fri, 22 Aug 2008, Rob Dixon wrote: Patrick Dupre wrote: On Fri, 22 Aug 2008, Rob Dixon wrote: Patrick Dupre wrote: How can I modify my Makefile.PL to have a Makefile which can make cc -o test.o -c test.c `perl -MExtUtils::Embed -e ccopts` Thank Makefile.PL is a program written using Ext

Re: condition in a single line

2008-08-22 Thread Peter Scott
On Fri, 22 Aug 2008 07:15:49 -0700, John W. Krahn wrote: > Peter Scott wrote: >> my $value = max( 4, $t1lsq{$interfaceName} ); > > s/max/min/ > > :-) Wow, they are different. Maybe that explains my overdraft... -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ -- To

Re: Makefile.PL

2008-08-22 Thread Rob Dixon
Patrick Dupre wrote: > On Fri, 22 Aug 2008, Rob Dixon wrote: > >> Patrick Dupre wrote: >>> How can I modify my Makefile.PL to have a Makefile which can make >>> cc -o test.o -c test.c `perl -MExtUtils::Embed -e ccopts` >>> >>> Thank >> Makefile.PL is a program written using ExtUtils::MakeMaker to

Re: file manipulation

2008-08-22 Thread Rob Dixon
John W. Krahn wrote: > Rob Dixon wrote: >> >> There is no write function. > > I beg to differ: > > perldoc -f write > write FILEHANDLE > write EXPR > write Writes a formatted record (possibly multi-line) to the > specified FILEHANDLE, using the format associated with

Re: Makefile.PL

2008-08-22 Thread Patrick Dupre
On Fri, 22 Aug 2008, Rob Dixon wrote: Patrick Dupre wrote: How can I modify my Makefile.PL to have a Makefile which can make cc -o test.o -c test.c `perl -MExtUtils::Embed -e ccopts` Thank Makefile.PL is a program written using ExtUtils::MakeMaker to generate a makefile for building a Perl

Re: Makefile.PL

2008-08-22 Thread Rob Dixon
Patrick Dupre wrote: > > How can I modify my Makefile.PL to have a Makefile which can make > cc -o test.o -c test.c `perl -MExtUtils::Embed -e ccopts` > > Thank Makefile.PL is a program written using ExtUtils::MakeMaker to generate a makefile for building a Perl /extension/ module. ExtUtils::Em

Re: condition in a single line

2008-08-22 Thread John W. Krahn
Peter Scott wrote: On Thu, 21 Aug 2008 21:55:46 -0700, Noah wrote: Is there a way to simplify the following to one line? my $value = $t1lsq{$interfaceName}; $value = 4 if $value > 4; If you happen to already have use List::Util qw(max); in your code

Re: condition in a single line

2008-08-22 Thread Peter Scott
On Thu, 21 Aug 2008 21:55:46 -0700, Noah wrote: > Is there a way to simplify the following to one line? > > my $value = $t1lsq{$interfaceName}; > $value = 4 if $value > 4; If you happen to already have use List::Util qw(max); in your code (or don't mind

Re: condition in a single line

2008-08-22 Thread Rob Dixon
Noah wrote: > > Is there a way to simplify the following to one line? > > > --- > > my $value = $t1lsq{$interfaceName}; > $value = 4 if $value > 4; I'm wondering why you want to do that? Depending on your reasons, perhaps this would do? my $value = $t1lsq{

Re: timing a fork

2008-08-22 Thread Rob Dixon
Raymond Wan wrote: > Rob Dixon wrote: >> >> What do you need to accomplish that something as simple as the code below >> won't do? >> >> use strict; >> use warnings; >> >> my $kid = fork; >> >> if ($kid) { >> print "in parent whose kid is $kid\n"; >> } >> elsif ($kid == 0) { >> print "In child

Re: get external IP address

2008-08-22 Thread John W. Krahn
William wrote: Hello, Hello, if I want to make an application to allow user find their WAN IP address, what are the available options in Perl ? I have searched around. perldoc -q "How do I find out my hostname, domainname, or IP address?" John -- Perl isn't a toolbox, but a small machine

Unit testing

2008-08-22 Thread Vyacheslav Karamov
Hi All! I need to add unit tests to my project which I will start soon. I'm using latest ActivePerl in Win32 (because I have to) and I installed Test::Unit::Lite through ppm.bat. But! When I tried to run example test: #!/usr/bin/perl -w use strict; use warnings; use File::Basename; use File

Makefile.PL

2008-08-22 Thread Patrick Dupre
Hello, How can I modify my Makefile.PL to have a Makefile which can make cc -o test.o -c test.c `perl -MExtUtils::Embed -e ccopts` Thank -- --- == Patrick DUPRÉ | | Department of Chemistry

get external IP address

2008-08-22 Thread William
Hello, if I want to make an application to allow user find their WAN IP address, what are the available options in Perl ? I have searched around. Thank you, William New Email names for you! Get the Email name you've always wanted on the new @ymail and @rocketmail. Hurry before someon

Re: condition in a single line

2008-08-22 Thread Mr. Shawn H. Corey
On Thu, 2008-08-21 at 21:55 -0700, Noah wrote: > Hi there, > > Is there a way to simplify the following to one line? > > > --- > > my $value = $t1lsq{$interfaceName}; > $value = 4 if $value > 4; > > > > > Simple in a Rube Goldberg's kind of way ;) (

Re: condition in a single line

2008-08-22 Thread Dr.Ruud
Noah schreef: > Is there a way to simplify the following to one line? > >my $value = $t1lsq{$interfaceName}; >$value = 4 if $value > 4; Not really. You might not want to get $t1lsq{$interfaceName} twice, because of side effects for example, one being that it is just slower to do things tw

RE: About the error message in Perl : "Missing right curly braces"

2008-08-22 Thread Stewart Anderson
> -Original Message- > From: Peter Scott [mailto:[EMAIL PROTECTED] > Sent: 21 August 2008 20:14 > To: beginners@perl.org; "Amit Saxena" > Subject: Re: About the error message in Perl : "Missing right curly > braces" > > On Thu, 21 Aug 2008 17:48:00 +0530, Amit Saxena wrote: > >> Load the

Re: doubt in code

2008-08-22 Thread Dr.Ruud
"Irfan J Sayed (isayed)" schreef: Irfan, trim your postings. Cut out any piece of text that is no longer relevant. You quoted all the nonsense that Stewart Anderson thinks he needs to include. Clean up your act. > Agree, but where is the file name?? > $server will just store the server name rig