timothy adigun wrote:
Hi,

Hello,

On 8/29/12, timothy adigun<2teezp...@gmail.com>  wrote:

for(my $i=0; $i<= length(@startSite)-1; $i++) {

   The above could be:
     for(my $i=0; $i<= scalar (@startSite); $i++) {
       ...

for(my $i=0; $i<= scalar (@startSite); $i++) {  ## Oops

for(my $i=0; $i<= scalar (@startSite)-1; $i++) {  ## working

First, length(@startSite) is WRONG so s/could/should/ and second, that is usually written as:

for my $i ( 0.. $#startSite ) {




John
--
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction.                   -- Albert Einstein

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to