comp.lang.perl.misc
  Home FAQ Contact Sign in
Your Ad Here
comp.lang.perl.misc only
 
Advanced search
May 2008
motuwethfrsasuw
   1234 18
567891011 19
12131415161718 20
19202122232425 21
262728293031  22
2008
 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
  把同事的大頭相片放到youtube裏唱衰, 這行為論瘋狂度, 值多少分?         


Author: edmundyautinho
Date: May 7, 2008 20:02

把同事的大頭相片放到youtube裏唱衰, 這行為論瘋狂度, 值多少分?
http://www.youtube.com/watch?v=7y5I8Ktcf94
no comments
  Using Win32::OLE(         


Author: Cosmic Cruizer
Date: May 7, 2008 19:39

Everyday I'm finding out more and more I can do with Win32::OLE(
1 Comment
  FAQ 4.1 Why am I getting long decimals (eg, 19.9499999999999) instead of the numbers I should be getting (eg, 19.95)?         


Author: PerlFAQ Server
Date: May 7, 2008 18:03

This is an excerpt from the latest version perlfaq4.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

--------------------------------------------------------------------

4.1: Why am I getting long decimals (eg, 19.9499999999999) instead of the numbers I should be getting (eg, 19.95)?

Internally, your computer represents floating-point numbers in binary.
Digital (as in powers of two) computers cannot store all numbers
exactly. Some real numbers lose precision in the process. This is a
problem with how computers store numbers and affects all computer
languages, not just Perl.

perlnumber shows the gory details of number representations and
conversions.

To limit the number of decimal places in your numbers, you can use the
printf or sprintf function. See the "Floating Point Arithmetic" for more
details.

printf "%%.2f", 10/3;

my $number = sprintf "%%.2f", 10/3;
Show full article (1.74Kb)
no comments
  The Importance of Terminology's Quality         


Author: xahlee
Date: May 7, 2008 16:13

I'd like to introduce a blog post by Stephen Wolfram, on the design
process of Mathematica. In particular, he touches on the importance of
naming of functions.

• Ten Thousand Hours of Design Reviews (2008 Jan 10) by Stephen
Wolfram
http://blog.wolfram.com/2008/01/10/ten-thousand-hours-of-design-reviews/

The issue is fitting here today, in our discussion of “closure”
terminology recently, as well the jargons “lisp 1 vs lisp2” (multi-
meaning space vs single-meaning space), “tail recursion”, “currying”,
“lambda”, that perennially crop up here and elsewhere in computer
language forums in wild misunderstanding and brouhaha.
Show full article (5.43Kb)
28 Comments
  FAQ 3.25 Where can I learn about CGI or Web programming in Perl?         


Author: PerlFAQ Server
Date: May 7, 2008 12:03

This is an excerpt from the latest version perlfaq3.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

--------------------------------------------------------------------

3.25: Where can I learn about CGI or Web programming in Perl?

For modules, get the CGI or LWP modules from CPAN. For textbooks, see
the two especially dedicated to web stuff in the question on books. For
problems and questions related to the web, like "Why do I get 500
Errors" or "Why doesn't it run from the browser right when it runs fine
on the command line", see the troubleshooting guides and references in
perlfaq9 or in the CGI MetaFAQ:

http://www.perl.org/CGI_MetaFAQ.html

--------------------------------------------------------------------
Show full article (1.49Kb)
no comments
  2 simple questions         


Author: amirovic
Date: May 7, 2008 11:08

Hi,

I got two simple question where I don't know the answer and would
appreciate any help.

1) my $sting = "afdsf,sdgj,sdgjkgd,"
How can I find out how many commas are in this string. I think that
there should be a very simple perl solution to this without find it
out in a very wild way.

2) my $no = 0.00001;
print $no; // Output 1e-05
How can get 0.00001 and not an e-number?

Thanks for your help.
Regards,
Amir
3 Comments
  Net::SMTP fails         


Author: hendedav
Date: May 7, 2008 08:01

Gang,

I am trying to use Net::SMTP to send email from a computer and it
fails to send (debug info below). I can take this same script and put
it on another computer and it works just fine. That would tell me
some piece of software isn't installed on the non-working computer,
but I have no idea as to what it may be. I have made sure the files
are the same on both computers that are listed in the "use" statements
at the top of the Net::SMTP module. I am using Debian 3.1 on the one
that works and 4.0 on the one that doesn't work. Any help would
greatly be appreciated.

Thanks,

Dave
Show full article (1.13Kb)
12 Comments
  state of Erlang?         


Author: cartercc
Date: May 7, 2008 06:29

Please excuse this OT post.

I have had the experience of attempting to implement some wireless
routing protocols (GPSR and AODV) in Java in the past two years, and
the experience hasn't been particularly fulfilling. The ideas are good
but the technology, Java, leaves something to be desired.

Having some spare time, I picked up Joe Armstrong's book 'Programming
Erlang' and have been going through it. When I got to the sections on
concurrent programming, I felt that the floor just dropped from under
me. Having done some significant network programming in Java, I was
rendered breathless at the ease at which the same thing can be done in
Erlang.

Out of curiosity, I checked the job boards (Dice, etc.) for Erlang
jobs, and there seemed to be precious few. Erlang dates from the same
generation as Perl (mid 80s), and has strengths in concurrent,
distributed, and multi-processor programming. It also had an
impressive framework in the OTP.
Show full article (1.36Kb)
4 Comments
  FAQ 4.28 How do I change the Nth occurrence of something?         


Author: PerlFAQ Server
Date: May 7, 2008 06:03

This is an excerpt from the latest version perlfaq4.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

--------------------------------------------------------------------

4.28: How do I change the Nth occurrence of something?

You have to keep track of N yourself. For example, let's say you want to
change the fifth occurrence of "whoever" or "whomever" into "whosoever"
or "whomsoever", case insensitively. These all assume that $_ contains
the string to be altered.

$count = 0;
s{((whom?)ever)}{
++$count == 5 # is it the 5th?
? "${2}soever" # yes, swap
: $1 # renege and leave it there
}ige;

In the more general case, you can use the "/g" modifier in a "while"
loop, keeping count of matches.
Show full article (2.12Kb)
no comments
Your Ad Here
  cpan shell and MyConfig.pm problem         


Author: Ronny
Date: May 7, 2008 03:31

I would like to install CPAN modules with the cpan command. Since I
don't have
write permission to the Perl installation directories, I need to do a
local installation.

After playing around with the cpan command a bit and looking at the
source code of
CPAN::Config, I created a $HOME/.cpan/CPAN/MyConfig.pm with the
following content:

$CPAN::Config->{cpan_home}="$ENV{HOME}/.cpan";
$CPAN::Config->{keep_source_where}=$CPAN::Config->{cpan_home}.'/
sources';
$CPAN::Config->{histfile}=$CPAN::Config->{cpan_home}.'/history';
$CPAN::Config->{build_dir}=$CPAN::Config->{cpan_home}.'/build';

This works fine for download and test, but install still tries to
write the modules into
the Perl installation directory. In addition, I get during install the
error message

sh: /Perl/cpan-autoconfig: not found

What is broken here?
Show full article (0.84Kb)
2 Comments
1 2