Timothy Appnel > Boulder-Simple > Boulder::Simple



Annotate this POD

View/Report Bugs
Module Version: 0.021   Source  


Boulder::Simple - a class for simple Boulder IO interaction. DEPRECATED. Use Boulder::Util instead.


 #!/usr/bin/perl -w
 use strict;
 use Boulder::Simple;
 my $file ='boulder.txt';
 my $data = { 
     vocals => ['frank', 'kim'],
     guitar => ['frank', 'joey'],
     bass => 'kim',
     drums => 'david'
 my $fh;
 open ($fh,">$file");
 close $fh;
 my $fh2;
 open ($fh2,"$file");
 while(my $q = Boulder::Simple->load_as_query($fh2)) {
     print "$q\n";
 close $fh2;


Boulder::Simple is a simple lightweight class for manipulating Boulder IO records. DEPRECATED. Use Boulder::Util instead.

Boulder IO is the native format output by the CGI package's save method. While working on a project I used that method to serialize the state of a query for later use. That later use did not involve a CGI request though. I wanted to avoid loading up the CGI package just to read in the file memory and the Boulder package itself seemed like a bit much. What I wished I had was a quick way of reading those records without incurring the overhead of either package. Hence Boulder::Simple.

The package provides just a save and a few load methods for reading and writing. The load methods work like quasi-iterators were only one record is loaded at a time to allow developers to control memory consumption as they see fit.

This package does not support the entire Boulder IO format and makes a few asusmptions in the name of simplicity. Heirarchical records are not supported. Also the = character is assumed to always be the record delimiter. All data is always URL encoded. If you are working with data that was serialized by CGI as I was these are not a problem. If you do need these features then perhaps the Boulder package is for you.

The release is quite functional, but may better serve it purpose with some interface tweaks. Feedback is appreciated.


A file handle is required for all methods. When working with a HASH, multi-valued keys (field names) are represented as an ARRAY reference.


Loads one record from the handle provided and returns an array of its lines. The key/value pairs are unprocessed.


Loads one record from the handle provided and returns the key/value pairs as an HTTP query string.


Loads one record from the handle provided and returns the key/value pairs as an HTTP query string.


Writes the HASH reference to the file. How it writes (append, overwrite/create) is entirely up to the handle that it is passed.






The software is released under the Artistic License. The terms of the Artistic License are described at http://www.perl.com/language/misc/Artistic.html.


Except where otherwise noted, Boulder::Simple is Copyright 2004-2005, Timothy Appnel, tima@cpan.org. All rights reserved.

syntax highlighting: