1 / 15

Module “Data::Locations”

Module “Data::Locations”. “What on earth are Data::Locations?!” Steffen Beyer YAPC::Europe, London, UK, ICA, September 22-24 2000. Agenda. What is it good for? Example How does it work? Gory Details History Questions & Answers, Suggestions. What is it good for?.

Download Presentation

Module “Data::Locations”

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Module “Data::Locations” “What on earth are Data::Locations?!” Steffen Beyer YAPC::Europe, London, UK, ICA, September 22-24 2000

  2. Agenda • What is it good for? • Example • How does it work? • Gory Details • History • Questions & Answers, Suggestions

  3. What is it good for? • Writing (almost) sequential streams of data, with some portions to be filled in later, after most or all of the stream has already been written - without using temporary files: • Web Content Management • Generating code in large IT projects • Mailings to multiple recipients • ...

  4. Example Software Development Environment (Code Generators) Customer: Zeppelin-Caterpillar Development Platform: Unix Tool Language: Perl Production Platform: Mainframe MVS/CICS Production Language: PL/I Costs (just the tools!): approx. 4 man-years

  5. Example • See • file "in.txt" • file "out.txt"

  6. How does it work? (1/2) sd&m 6

  7. How does it work? (2/2) • Data::Locations are implemented so that they behave as if they were an integral part of the Perl language: • you can send data to Data::Locations with "print" like to any other filehandle • you can read from Data::Locations with the "<>" operator as usual • Data::Locations go out of scope as any other Perl object • Data::Locations are fully suited for binary data • Data::Locations can be automatically dumped to a file, a pipe, a command etc. when program ends

  8. Cookie • You can teach people with your head • You can kill people with an overhead • You can overkill people with two overheads

  9. Gory Details • See • file "struct0.pl" • file "struct1.pl" • file "struct1.txt"

  10. Data::Locations are typeglobs, filehandles and objects at the same time • The typeglob is blessed into the Data::Locations class • The filehandle is tied to the object (i.e., to itself, because Perl confuses typeglobs and filehandles) • The typeglob's slots ($, @, %) contain the object's data (the "@" slot actually contains the user's data) • Symbolic references are used as "weak references" for internal interconnections • The reference count is adjusted so that the Location will be destroyed when user's last reference goes out of scope • The symbol table %Data::Locations:: is used as index (for "weak reference" lookups and global destruction)

  11. 80’s 1988/1989 July 1997 : “Delta” macro processor (Delta GmbH) : “ProMAC” macro processor (sd&m GmbH) : Perl module “Data::Locations” (Free Software) History

  12. DELTA macro processor • Product of Delta GmbH • Macro preprocessor to extend the capabilities of COBOL and PL/I • extendable with the help of a “PDL macro generator” • very cryptic • poor performance • hard-coded memory limits

  13. ProMAC macro processor • String interpolation reminding of C preprocessor • built-in functions comparable to Perl • Regular expressions (similar to “egrep”) • “Module concept”: every subroutine is a separate file • Disastrous performance: 100% interpreted (even in loops) • Conceptual weaknesses

  14. Questions & Answers, Suggestions • Please feel free to ask! • Suggestions are welcome.

  15. Another Example Web Content Management Customer: Pentium GCC Group (http://www.goof.com/pcg/) Contact: Marc Lehmann <pcg@goof.com> Application: Generating status pages with bug reports for different releases and branches of development

More Related