Elyse M. Grasso wrote:
But you need to process the file while you haven't reached the end yet, or
until you reach the end. And I can't think of an occasion where I knew going
in what the length of the file I was processing was going to be. I suppose
foreach might make sense if you sucked in the
On Mon, Dec 06, 2004 at 10:59:18AM -0800, Larry Wall wrote:
> On Mon, Dec 06, 2004 at 12:45:18PM -0600, Jonathan Scott Duff wrote:
> : On Mon, Dec 06, 2004 at 09:56:57AM -0800, Larry Wall wrote:
> : > On Mon, Dec 06, 2004 at 10:38:10AM -0500, Austin Hastings wrote:
> : > : Can we ditch C in the exa
On Monday 06 December 2004 01:26 pm, Smylers wrote:
> I think that C reads much better than C for English-ness.
> Having taught Perl 5 beginners that C can be used to iterated
> over each item in a list, many of them then instinctively try to use the
> same keyword for iterating over each line in
On Mon, Dec 06, 2004 at 12:45:18PM -0600, Jonathan Scott Duff wrote:
: On Mon, Dec 06, 2004 at 09:56:57AM -0800, Larry Wall wrote:
: > On Mon, Dec 06, 2004 at 10:38:10AM -0500, Austin Hastings wrote:
: > : Can we ditch C in the examples in favor of C, for a while? :)
: >
: > Okay. Have an example
On Mon, Dec 06, 2004 at 09:56:57AM -0800, Larry Wall wrote:
> On Mon, Dec 06, 2004 at 10:38:10AM -0500, Austin Hastings wrote:
> : Can we ditch C in the examples in favor of C, for a while? :)
>
> Okay. Have an example:
>
> while =$IN -> $line {...}
>
> I think that works. I'm back to thin
Smylers writes:
> To me C makes sense when you've got a pile of stuff you're
> intending to process (such as array items or lines in a file), and
> C makes sense when you're waiting for a condition (such as the
> user correctly entering her/his password) and you couldn't possibly know
> in advance
Austin Hastings writes:
> The other concern is idiom. Using C suggests "start at the
> beginning, continue to the end". OTOH, using C is a little
> "weaker" -- "keep doing this until it's time to stop". Obviously they'll
> usually be used in the same way:
>
> for =<> {...} vs. while (<>)