Dear Uri,

> though i didn't figure out your 'bug', i disagree with your calling it a
> bug. it is documented behavior ...

No, it is not documented.  The fact that it is an iterator is
documented, but not the fact that the iterator will ignore
argument changes until it "runs out of" iteration values.


> ... and makes sense from an iterator point of view. ...

No, it doesn't make sense.  Not to me.

Consider a variable for a filehandle:

  => sub next_line { my $fh = shift; scalar <$fh>; }
  => print "F1: ", &next_line(*F1);
  => print "F2: ", &next_line(*F2);

Do you expect &next_line(*F2) to fetch a line from file
handle F1?  On what basis does that make sense?



> ... the glob function needs to track its own state more then the
> expression passed to it ...

Why is its internal state more important than its input
argument?  In what interface (programming or otherwise) is
that considered acceptable?

Suppose you went to an ATM, and deposited your paycheck.
Suppose the ATM said (to itself), "My internal state is the
more important than Uri's login attempt.  Let me deposit
this money to the previous successful login, namely, Kripa's
account.".  Wouldn't that be a laugh!  :-)


> ... so it can iterate over all the expanded
> files. this means it won't see new data unless it first hits the end of
> the current iteration. ...

I realise (to my grief) that this is the current behaviour.
But I can't agree that it is the right thing to do.


> ... so the lesson is to call it in a list context
> when you want to force it to always look at new data the
> next time. ...

This is the classic programming technique called a "workaround".  :-)

> ... but
> then again, i never use globs. readdir always works fine and i like the
> power of real perl regexes over the pseudo-regexes in globs.

If I want to grok "~someone/some/stuff", glob() is my only
choice, because readdir() doesn't work for "~someone".

peace,          || Operation Shoe Fly: Send your shoes to Afghan children:
--{kr.pA}       || http://tinyurl.com/6jnpf
-- 
We must believe in luck.  For how else can we explain the success of those
    we don't like?  -- Jean Cocteau, author and painter (1889-1963)
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to