Re: 57-my-last-mying-changes.patch

2001-02-24 Thread Tom Tromey

 "Derek" == Derek R Price [EMAIL PROTECTED] writes:

Derek  require 5.004;
Derek  use IO::File;

Derek  my $fh = new IO::File " filetoread";
Derek  while ($fh-getline)
Derek  {
Derek  dostuff $_;
Derek  }

Switching automake to use this would be good.

Tom




Re: 57-my-last-mying-changes.patch

2001-02-23 Thread Derek R. Price

Tom Tromey wrote:

  "Akim" == Akim Demaille [EMAIL PROTECTED] writes:

 Akim Six, six for them! (I'm not counting those for file handles,
 Akim which perl refuses as my, not sure to understand why).

 The way file handles work is another reason to dislike Perl.  At
 least, I've always found them confusing.

The Perl5 file handles are different.  This example is for reading a file.
Really, the arguments to "new" are the same arguments open accepted.:


 require 5.004;
 use IO::File;

 my $fh = new IO::File " filetoread";
 while ($fh-getline)
 {
 dostuff $_;
 }

The other functions available for old style file handles are similar.  These
are just front ends for the old Perl builtins, but context switching just
happens automatically now.  e.g. $fh-eof, $fh-print, $fh-open (usually
called implicitly with arguments to new), $fh-close (unnecessary - "undef
$fh" will autoclose), $fh-autoflush, $fh-fileno, etc.

"$fh-getlines;" will work like calling $fh in an array context.

"my $line = $fh-getline;"  "my @lines = $fh-getlines;" (to read an entire
file) are valid constructs.  I don't remember if the same was true of , but
I think so.

P.S.  You probably won't need to know, but Perl5 prior to 5.004 used
FileHandle in lieu of IO::File, and FileHandle is still supported as a front
end for IO::File, but is deprecated.

Derek

--
Derek Price  CVS Solutions Architect ( http://CVSHome.org )
mailto:[EMAIL PROTECTED] OpenAvenue ( http://OpenAvenue.com )
--
As honest as the day is long.

- S. Z. Sakall as Headwaiter Carl, _Casablanca_







Re: 57-my-last-mying-changes.patch

2001-02-22 Thread Tom Tromey

 "Akim" == Akim Demaille [EMAIL PROTECTED] writes:

Akim Six, six for them! (I'm not counting those for file handles,
Akim which perl refuses as my, not sure to understand why).

The way file handles work is another reason to dislike Perl.  At
least, I've always found them confusing.

Akim   * automake.in: Mying changes.
Akim   * Makefile.am (maintainer-check): Check the stability of the
Akim   number of uses of `local'.

This is ok if you make one small change.

Akim +   [0-5] ) \
Akim + echo "Wow, congrats!  There are $$locals \`local' now!." 2; \
Akim + echo "Please update Makefile.am (maintainer-check)." 2; \
Akim +   ;; \

I think this case should `exit 1'.
We expect exactly a certain number.
If this changes then there is a bug -- either one got deleted by
accident, or the person forgot to update Makefile.am.

Tom