FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » a perl guy question; next label? continue label?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
a perl guy question; next label? continue label? [message #176258] Mon, 12 December 2011 20:41 Go to next message
oldyork90 is currently offline  oldyork90
Messages: 9
Registered: December 2011
Karma: 0
Junior Member
It doesn't appear the php has a continue label construct as in (perl)

:outer for(.......
:inner for (....
if (...) {
next outer;

Is that correct?
Re: a perl guy question; next label? continue label? [message #176259 is a reply to message #176258] Mon, 12 December 2011 21:33 Go to previous messageGo to next message
Peter H. Coffin is currently offline  Peter H. Coffin
Messages: 245
Registered: September 2010
Karma: 0
Senior Member
On Mon, 12 Dec 2011 12:41:32 -0800 (PST), oldyork90 wrote:
> It doesn't appear the php has a continue label construct as in (perl)
>
> :outer for(.......
> :inner for (....
> if (...) {
> next outer;
>
> Is that correct?

It does have, sort of. It is, shockingly, called "continue".

PHP-wise, the above would be

for (...) {
for (...) {
if (...) {
continue 2;
}
// This part is skipped by the continue 2 (or continue 1, 0
// or continue all by itself).
}
// This part is ALSO skipped by the continue 2 above, but would
// execute if continue 1, 0, or continue alone were used.
}

--
Whenever you look at a beautiful woman,
always remember that somewhere, someone is tired of her.
Re: a perl guy question; next label? continue label? [message #176261 is a reply to message #176259] Tue, 13 December 2011 01:38 Go to previous messageGo to next message
oldyork90 is currently offline  oldyork90
Messages: 9
Registered: December 2011
Karma: 0
Junior Member
On Dec 12, 3:33 pm, "Peter H. Coffin" <hell...@ninehells.com> wrote:
> On Mon, 12 Dec 2011 12:41:32 -0800 (PST), oldyork90 wrote:
>> It doesn't appear the php has a continue label construct as in (perl)
>
>> :outer for(.......
>>    :inner for (....
>>       if (...) {
>>           next outer;
>
>> Is that correct?
>
> It does have, sort of. It is, shockingly, called "continue".
>
> PHP-wise, the above would be
>
> for (...) {
>     for (...) {
>         if (...) {
>             continue 2;
>         }
>         // This part is skipped by the continue 2 (or continue 1, 0
>         // or continue all by itself).
>     }
>     // This part is ALSO skipped by the continue 2 above, but would
>     // execute if continue 1, 0, or continue alone were used.
>
> }
>
> --
> Whenever you look at a beautiful woman,
> always remember that somewhere, someone is tired of her.

Yah, I saw that. I wondering about the label part of it. (array ==
@ .. what is this strange language :-)
Re: a perl guy question; next label? continue label? [message #176264 is a reply to message #176261] Tue, 13 December 2011 13:26 Go to previous messageGo to next message
Peter H. Coffin is currently offline  Peter H. Coffin
Messages: 245
Registered: September 2010
Karma: 0
Senior Member
On Mon, 12 Dec 2011 17:38:33 -0800 (PST), oldyork90 wrote:
> Yah, I saw that. I wondering about the label part of it. (array ==
> @ .. what is this strange language :-)

Nope, no labels. Maybe someday. Shifting from perl to PHP is learning
that you can still do pretty much everthing you could before, just in
the dumbest way you'd be able to do it in perl. The only saving virtue
is that so much stuff comes rolled into the main distributions of PHP
that no one has ever bothered to propose something like CPAN without a
"Haha! Just kidding!" at the end.

--
74. When I create a multimedia presentation of my plan designed so that
my five-year-old advisor can easily understand the details, I will
not label the disk "Project Overlord" and leave it lying on top of
my desk. --Peter Anspach's list of things to do as an Evil Overlord
Re: a perl guy question; next label? continue label? [message #176265 is a reply to message #176264] Tue, 13 December 2011 14:57 Go to previous messageGo to next message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma: 0
Senior Member
In article <slrnjeekjp(dot)51n(dot)hellsop(at)nibelheim(dot)ninehells(dot)com>,
"Peter H. Coffin" <hellsop(at)ninehells(dot)com> wrote:

> On Mon, 12 Dec 2011 17:38:33 -0800 (PST), oldyork90 wrote:
>> Yah, I saw that. I wondering about the label part of it. (array ==
>> @ .. what is this strange language :-)
>
> Nope, no labels. Maybe someday. Shifting from perl to PHP is learning
> that you can still do pretty much everthing you could before, just in
> the dumbest way you'd be able to do it in perl.

The easiest way, you mean. What used to irritate me about perl was
precisely that there were 1000 ways to do anything - so you had to know
them all. And the doccy always implied that the more esoteric you made
your code, the more Terribly Clever (TM) you were.

I once dipped into the perl ng to ask a question about parameter
passing. But they were all too busy being Terribly Clever (TM) to give
me a civil answer. So fuck 'em.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
Re: a perl guy question; next label? continue label? [message #176266 is a reply to message #176265] Tue, 13 December 2011 19:44 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
Tim Streater wrote:
> In article <slrnjeekjp(dot)51n(dot)hellsop(at)nibelheim(dot)ninehells(dot)com>,
> "Peter H. Coffin" <hellsop(at)ninehells(dot)com> wrote:
>
>> On Mon, 12 Dec 2011 17:38:33 -0800 (PST), oldyork90 wrote:
>>> Yah, I saw that. I wondering about the label part of it. (array ==
>>> @ .. what is this strange language :-)
>>
>> Nope, no labels. Maybe someday. Shifting from perl to PHP is learning
>> that you can still do pretty much everthing you could before, just in
>> the dumbest way you'd be able to do it in perl.
>
> The easiest way, you mean. What used to irritate me about perl was
> precisely that there were 1000 ways to do anything - so you had to know
> them all. And the doccy always implied that the more esoteric you made
> your code, the more Terribly Clever (TM) you were.
>
> I once dipped into the perl ng to ask a question about parameter
> passing. But they were all too busy being Terribly Clever (TM) to give
> me a civil answer. So fuck 'em.
>
In general pretty much my opinion of PERL gurus too.

Penis Extending Rectalists Langauge
Re: a perl guy question; next label? continue label? [message #176269 is a reply to message #176266] Wed, 14 December 2011 13:02 Go to previous message
Erwin Moller is currently offline  Erwin Moller
Messages: 228
Registered: September 2010
Karma: 0
Senior Member
On 12/13/2011 8:44 PM, The Natural Philosopher wrote:
> Tim Streater wrote:
>> In article <slrnjeekjp(dot)51n(dot)hellsop(at)nibelheim(dot)ninehells(dot)com>,
>> "Peter H. Coffin" <hellsop(at)ninehells(dot)com> wrote:
>>
>>> On Mon, 12 Dec 2011 17:38:33 -0800 (PST), oldyork90 wrote:
>>>> Yah, I saw that. I wondering about the label part of it. (array ==
>>>> @ .. what is this strange language :-)
>>>
>>> Nope, no labels. Maybe someday. Shifting from perl to PHP is learning
>>> that you can still do pretty much everthing you could before, just in
>>> the dumbest way you'd be able to do it in perl.
>>
>> The easiest way, you mean. What used to irritate me about perl was
>> precisely that there were 1000 ways to do anything - so you had to
>> know them all. And the doccy always implied that the more esoteric you
>> made your code, the more Terribly Clever (TM) you were.
>>
>> I once dipped into the perl ng to ask a question about parameter
>> passing. But they were all too busy being Terribly Clever (TM) to give
>> me a civil answer. So fuck 'em.
>>
> In general pretty much my opinion of PERL gurus too.
>
> Penis Extending Rectalists Langauge

Hmm,

I have had good experience with perl newsgroups in the past.
But that was like 800 years ago. :-)

Maybe the nice chaps all moved to PHP/Python and the likes and the ones
that were in need of a penis extension stayed behind. ;-)

Regards,
Erwin Moller


--
"That which can be asserted without evidence, can be dismissed without
evidence."
-- Christopher Hitchens
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Blogs
Next Topic: Joyhong Software wishes you a good day!
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 09:55:09 GMT 2024

Total time taken to generate the page: 0.02353 seconds