CGI::FileUpload::Manager - manipulating the list of CGI::FileUpload


CGI-FileUpload documentation Contained in the CGI-FileUpload distribution.

Index


Code Index:

NAME

Top

CGI::FileUpload::Manager - manipulating the list of CGI::FileUpload

DESCRIPTION

Top

brwose the working directory and build a list of CGI:FileUpload

EXPORT

Top

FUNCTIONS

Top

lskey()

Return an array (sorted by date) of upload file keys

ls()

Return an array (sorted by date) of upload file CGI::FileUpload objects

AUTHOR

Top

Alexandre Masselot, <alexandre.masselot at genebio.com>

BUGS

Top

Please report any bugs or feature requests to bug-cgi-fileupload at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CGI-FileUpload. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc CGI::FileUpload




You can also look for information at:

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=CGI-FileUpload

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/CGI-FileUpload

* CPAN Ratings

http://cpanratings.perl.org/d/CGI-FileUpload

* Search CPAN

http://search.cpan.org/dist/CGI-FileUpload

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


CGI-FileUpload documentation Contained in the CGI-FileUpload distribution.

package CGI::FileUpload::Manager;

use warnings;
use strict;


use CGI::FileUpload;
use File::Basename;
use File::Glob qw(:glob);


require Exporter;
our (@ISA,@EXPORT,@EXPORT_OK);
@ISA=qw (Exporter);
@EXPORT=qw(&ls &lskey);
@EXPORT_OK=qw();

sub lskey{
  my %tmp;
  foreach(glob CGI::FileUpload::uploadDirectory()."/*.properties"){
    my $k=basename($_);
    $k=~s/\.properties$//;
    $tmp{$k}=(stat($_))[9];
  }
  return sort {$tmp{$b} <=> $tmp{$a}} keys %tmp;
}

sub ls{
  my @keys=lskey();
  my @ret;
  foreach(@keys){
    push @ret, CGI::FileUpload->new(key=>$_);
  }
  return @ret;
}

1;