ANNOUNCE: IO::Format 0.02 (perl formats, object oriented, footers) 
Author Message
 ANNOUNCE: IO::Format 0.02 (perl formats, object oriented, footers)

This is to announce the availability of IO::Format 0.02.  This is still an
alpha release.  I have only used it in small, toy applications, so there
are probably bugs in it.  Still, it does seem to work well in the cases
I've tested it in, so others may find it useful, and at this point, I would
like to get some feedback about it.

IO::Format is a module for dealing with perl formats, much the way
IO::Handle deals with filehandles.  It is object oriented and has some
added functionality with respect to normal perl formats (the main one is
that it handles footers as well as headers).

The major problem is that it is impossible to use variables declared with
"my" in the format.

This module is not available from CPAN.  When it becomes a bit more mature,
I will submit it, but for now you can get it from my home page:
  http://www.*-*-*.com/ ~beck

Sullivan

One question for perl wizards:

One thing I would like to do is to have the lexical variables (those
declared with "my") from the calling routine available in forming the
format.  The problem is that the format is actually formed by "eval"ing a
string (similar to the way described in the perlform manpage) in one of the
module routines.  Is there any way to gain access to the lexical variables
from the routine that directly called the module routine during the eval?
I am unfamilar with the capabilities of the XS extensions (even after
browsing the man pages).  Would they be able to do this?  If so, I'll learn
how to program them.  Any suggestions would be appreciated.

-----------------
The README file:
-----------------

Copyright (c) 1997 Sullivan Beck. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.

Notes for version 0.02:
  Added footers.
  Added the formline command (though it is a bit different from standard perl).

  I haven't figured out how to make the stdout.t test work properly when
  called via "make test" yet, so I turned it off when called by "make test".
  It still works fine if you call it with the runtests script in the t
  directory.

  I have had minimal feedback on this module so far, so I suggest not using
  it for major operations.  Also, I don't guarantee backwards compatibility
  at this point.  I'm still making decisions about what exactly the interface
  should be.  If you want to have some say in the matter, nows the time.

  ############################################################################
  If you would like to stay informed about future versions of this module,
  and especially if you are interested in beta testing future versions,
  please let me know by email at:

  The newest version (which should be considered a alpha version) is available
  through my home page:
    http://www.*-*-*.com/ ~beck
  Feel free to try it out.

  This module is still in alpha.  As soon as a real release is available, I
  will announce it in comp.lang.perl.misc and comp.lang.perl.announce and
  submit it to CPAN.
  ############################################################################

Formats, like filehandles, were very difficult to work with when perl 5
initially came out, especially when it came to passing them in and out of
subroutines (and especially in and out of modules).  The FileHandle (and
later IO::Handle) module eliminated the problems associated with filehandles,
but the problem still existed with formats.  Hence, this module.  This module
add an object oriented interface to formats in the same way that IO::Handle
adds an interface to filehandles.

This module offers some functionality that normal perl formats do not offer
such as restricting pagebreaks in the middle of a formatted write and the
use of footers as well as headers.

If you work with formats a lot, this may come in handy.

This module is patterned after Graham Barr's IO:: routines (and requires them
to run).  My thanks to him for providing an excellent interface to perl IO.



Sat, 28 Aug 1999 03:00:00 GMT  
 ANNOUNCE: IO::Format 0.02 (perl formats, object oriented, footers)

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc,

:One thing I would like to do is to have the lexical variables (those
:declared with "my") from the calling routine available in forming the
:format.  The problem is that the format is actually formed by "eval"ing a
:string (similar to the way described in the perlform manpage) in one of the
:module routines.  Is there any way to gain access to the lexical variables
:from the routine that directly called the module routine during the eval?

No, that's not possible.  We are not Tcl. :-)

Tell us why you're eval()ing?  Aren't you using formline?

--tim
--

pos += screamnext[pos]  /* does this goof up anywhere? */
    --Larry Wall, from util.c in the v5.0 perl distribution



Sun, 29 Aug 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ANNOUNCE: IO::Format 0.02 (perl formats, object oriented, footers)

2. ANNOUNCE: Games::Object 0.02

3. CFD and ANNOUNCE: IO::Format 0.01

4. CFD and ANNOUNCE: IO::Format 0.01

5. footer in format

6. footer format?

7. ANNOUNCE: DocNav 0.02 - Navigating the Perl Documentation

8. ANNOUNCE: MVS::JESFTP 0.02 - Perl extension for submitting JCL to MVS systems

9. ANNOUNCE: Perl Inference Engine PIE.pm 0.02 is now available for download

10. Perl manual (Emacs info-mode format?, NG format)

11. ANNOUNCE: Tk-Clock 0.02

 

 
Powered by phpBB® Forum Software