Click here to get back home

Problem with loop control LAST exiting prematurely

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Problem with loop control LAST exiting prematurely Rodion 03-18-2008
Posted by Tad J McClellan on March 18, 2008, 9:45 pm
Please log in for more thread options
> Jednom davno, ne znam vise kad, xhoster@gmail.com duboko zamisljen/a
> rece:

>> If you want to pursue the matter,
>> post a complete, runnable script to illustrate this.

> Well, I'm most certanly misundrestanding something, but I'd like to know
> what, so I don't make the same mistake twice :/


Then simply post a complete, runnable program to illustrate the
problem you are having.


> The following subrutine


A snippet of subroutine is not a complete program that we can run.


--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher0cmdat/"

Posted by Brian Helterline on March 18, 2008, 3:42 pm
Please log in for more thread options
Rodion wrote:
> Jednom davno, ne znam vise kad, John W. Krahn duboko zamisljen/a rece:
>
>> Couldn't you just write that as:
>>
>> $found = 1 if exists $cb;
>
> Well, I have to thank you for putting me on the right track!
>
> There was a problem with some numeric data having prefixed zeroes while
> some of the hash keys did not so there could be no match ( 0567 != 567).

If you are doing the testing using numeric comparison, then they are equal.

print "equal" if '0567' == '567';

--
-brian

Posted by Lawrence Statton on March 18, 2008, 3:58 pm
Please log in for more thread options
> If you are doing the testing using numeric comparison, then they are equal.
>
> print "equal" if '0567' == '567';
>
> --
> -brian

Does not print "equal"

However

perl -le 'print "equal" if '0567' == '375''

Does.

Why can't programmers tell Haloween from Christmas?

Because OCT 31 == DEC 25









--
        Lawrence Statton - lawrenabae@abaluon.abaom s/aba/c/g
Computer software consists of only two components: ones and
zeros, in roughly equal proportions. All that is required is to
place them into the correct order.

Posted by Brian Helterline on March 19, 2008, 7:29 pm
Please log in for more thread options
Lawrence Statton wrote:
>> If you are doing the testing using numeric comparison, then they are equal.
>>
>> print "equal" if '0567' == '567';
>>
>> --
>> -brian
>
> Does not print "equal"

It does on my system:


C:\>perl -le "print 'equal' if '0567' == '567'"
equal

C:\>perl -v

This is perl, v5.8.8 built for MSWin32-x86-multi-thread
(with 33 registered patches, see perl -V for more detail)

Posted by Lawrence Statton on March 18, 2008, 3:58 pm
Please log in for more thread options
> If you are doing the testing using numeric comparison, then they are equal.
>
> print "equal" if '0567' == '567';
>
> --
> -brian

Does not print "equal"

However

perl -le 'print "equal" if '0567' == '375''

Does.

Why can't programmers tell Haloween from Christmas?

Because OCT 31 == DEC 25

--
        Lawrence Statton - lawrenabae@abaluon.abaom s/aba/c/g
Computer software consists of only two components: ones and
zeros, in roughly equal proportions. All that is required is to
place them into the correct order.

Similar ThreadsPosted
Re: stuck in a control loop October 24, 2007, 3:05 am
What does "exit the block or routine with a loop control operator" mean? July 24, 2004, 4:17 am
prematurely closed filehandle June 29, 2006, 11:02 am
Problem expanding filenames in loop June 23, 2008, 2:43 pm
Exiting without printing December 22, 2005, 8:48 pm
executing code without exiting the interpreter April 1, 2007, 4:35 pm
How can I prevent perl from exiting during a network error? May 8, 2005, 9:32 am
How to stop perl from exiting when stat($_)->size fails February 15, 2006, 11:50 am
process control September 28, 2004, 12:12 am
How to control version of OS September 27, 2005, 1:52 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap