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
  FAQ 4.6 Why doesn't & work the way I want it to?         


Author: PerlFAQ Server
Date: May 2, 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.6: Why doesn't & work the way I want it to?

The behavior of binary arithmetic operators depends on whether they're
used on numbers or strings. The operators treat a string as a series of
bits and work with that (the string "3" is the bit pattern 00110011).
The operators work with the binary form of a number (the number 3 is
treated as the bit pattern 00000011).

So, saying "11 & 3" performs the "and" operation on numbers (yielding
3). Saying "11" & "3" performs the "and" operation on strings (yielding
"1").

Most problems with "&" and "|" arise because the programmer thinks they
have a number but really it's a string. The rest arise because the
programmer says:
Show full article (2.02Kb)
no comments
  Perl OLE Excel - STDEVA function         


Author: Slickuser
Date: May 2, 2008 17:25

I try to calculate the standard deviation of average of C2:C35.
But I get random range in the worksheet G$i. It's not showing as:

D2 =STDEVA(C2:C35,D2)
D3 =STDEVA(C2:C35,D3)
.....

It's showing as:

D2 =STDEVA(C2:C35,D2)
D3 =STDEVA(C2:C31,D3)
D4 =STDEVA(C2:C33,D4)
.....

Any one know why? I tried with " " doesn't help and q { } show nothing
since it's like ' '.

Thanks.
Show full article (0.55Kb)
2 Comments
  FAQ 4.10 Why aren't my random numbers random?         


Author: PerlFAQ Server
Date: May 2, 2008 12: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.10: Why aren't my random numbers random?

If you're using a version of Perl before 5.004, you must call "srand"
once at the start of your program to seed the random number generator.

BEGIN { srand() if $] < 5.004 }

5.004 and later automatically call "srand" at the beginning. Don't call
"srand" more than once--you make your numbers less random, rather than
more.
Show full article (2.25Kb)
no comments
  Help: Reverse Letters         


Author: Amy Lee
Date: May 2, 2008 07:43

Hello,

There's a problem while I'm processing sequences. My file content.
>seq1
ATGCCCTGACGTAAACGTAGGCTACG
>seq2
GCATGCCCTACGGGTACCCCAGTA

And I hope I can reverse the sequences to be this.
>seq1
GCATCGGATGCAAATGCAGTCCCGTA
>seq2
ATGACCCCATGGGCATCCCGTACG

I use "reverse" to do this, but it dose not work any more.
So could you tell me how to solve this problem?

Thank you very much~

Regards,

Amy Lee
13 Comments
  FAQ 3.19 How can I make my CGI script more efficient?         


Author: PerlFAQ Server
Date: May 2, 2008 06: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.19: How can I make my CGI script more efficient?

Beyond the normal measures described to make general Perl programs
faster or smaller, a CGI program has additional issues. It may be run
several times per second. Given that each time it runs it will need to
be re-compiled and will often allocate a megabyte or more of system
memory, this can be a killer. Compiling into C isn't going to help you
because the process start-up overhead is where the bottleneck is.

There are two popular ways to avoid this overhead. One solution involves
running the Apache HTTP server (available from http://www.apache.org/ )
with either of the mod_perl or mod_fastcgi plugin modules.
Show full article (2.55Kb)
no comments
  Deeper level of hashing         


Author: dn.perl
Date: May 2, 2008 04:15

I am using (roughly) the following code.

my %%counter = () ;

$counter{label11}{parent} = 'label1' ;
$counter{label11}{hits} = 14 ;
$counter{label12}{parent} = 'label1' ;
$counter{label12}{hits} = 14 ;

If I use: for my $key(keys %%counter), I get label11 and label12 as
values.
I would like to run something like: foreach my $key(keys %%
($counter(label11) ) )
and get 'parent' and 'hits' as the sub-keys.

Is there any quick way to do this but quicker than what? So let's say
is there a 'standard way' in which this is done? Or do I have to do it
the 'hard way' ? Define a sub-hash, and then assign it to the parent
hash as its key's value?
1 Comment
Your Ad Here
  FAQ 4.7 How do I multiply matrices?         


Author: PerlFAQ Server
Date: May 2, 2008 00: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.7: How do I multiply matrices?

Use the Math::Matrix or Math::MatrixReal modules (available from CPAN)
or the PDL extension (also available from CPAN).

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

The perlfaq-workers, a group of volunteers, maintain the perlfaq. They
are not necessarily experts in every domain where Perl might show up,
so please include as much information as possible and relevant in any
corrections. The perlfaq-workers also don't have access to every
operating system or platform, so please include relevant details for
corrections to examples that do not work on particular platforms.
Working code is greatly appreciated.

If you'd like to help maintain the perlfaq, see the details in
perlfaq.pod.
no comments