NAME
CGI::Listman::exporter - exporting database records with bookkeeping
SYNOPSIS
use CGI::Listman::exporter;
DESCRIPTION
CGI::Listman::exporter provides some simple API to export instances of CGI::Listman::line to "Comma-Separated Values"-formatted files. Such files will generally be transmitted through a CGI (see the file_contents method below). Between instances of this CGI, you want to use the save_file method since there is no way for CGI::Listman to know when a CGI session get closed.
API
new
Creates an initialized instance of CGI::Listman::exporter.
- Parameters
-
All the parameters are optional with this method.
- filename
-
An optional string representing the filename of the export file.
- separator
-
An optional single-character string representing the CSV separator to be used. If not specified, the default will of course be a comma.
- Return values
-
An instance of CGI::Listman::exporter
set_file_name
This method is of mandatory use if the filename is not specified when calling the new method. It cannot however be called twice.
- Parameters
-
- filename
-
A string representing the filename of the export file.
- Return values
-
This methods returns nothing.
set_separator
This method's name is quite explicit. It is useful when people want to use any other separator than the comma. People should however not be afraid of using the latter since even textual data containing such a character will be encapsulated in a way that prevent formatting conflicts.
- Parameters
-
- separator
-
A single-character string representing the separator in the CSV file.
- Return values
-
This methods returns nothing.
add_line
Add an instance of CGI::Listman::line to your instance of CGI::Listman::exporter.
- Parameters
-
- line
-
A single instance of CGI::Listman::line to be exported.
- Return values
-
This method returns nothing.
add_selection
Add instances of CGI::Listman::line in batch to your instance of CGI::Listman::exporter.
- Parameters
-
- selection
-
An instance of CGI::Listman::selection.
- Return values
-
This method returns nothing.
file_contents
- Parameters
-
This method takes no parameter.
- Return values
-
A perl string containing the contents of the export file in a DOS-formatted fashion (with both a "linefeed" and a "carriage return" at the end of each line). This is to ensure compatibility with the world-dominating operating systems.
save_file
Except when defining and exporting the data put in a CGI::Listman::exporter during the same CGI session, it is wyse to save its contents in-between.
AUTHOR
Wolfgang Sourdeau, <Wolfgang@Contre.COM>
COPYRIGHT
Copyright (C) 2002 iScream multimédia <info@iScream.ca>
This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
CGI::Listman::lines(3) CGI::Listman::selection(3)
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 338:
Non-ASCII character seen before =encoding in 'multimédia'. Assuming CP1252