|Perl: the Markov chain saw|
Re^2: List Wrapper for Object Methods.by pelagic (Priest)
|on Dec 03, 2004 at 15:45 UTC||Need Help??|
I freely admit: I'm not that experienced with OO.
But instead of asking us all to Abandon hope you might be willing and able to post a hint on how to do it better.
In case you would like to do so I put the POD of that code in question here:
Archive - Manage Archives as Objects.
## create a Archive object supplying all information needed my $force = 1; my $arch = Archive->new( archive => $full_path_archive , source_dir => $source_directory , file_glob => '.' , log_file => $log_object ## a LogFile object (see LogFile.pm) );
## create a physical Archive using 'gtar czvf' $arch->prepare_create(force=>$force); $arch->create;
## extract a physical Archive using 'gtar xzvf' $arch->prepare_extract; $arch->extract;
## remove a physical Archive using 'rm -f' $arch->remove;
## You can create a list of Archive objects as Archive::List object my $arch_list = Archive::List->new;
## and add Archive objects to the list $arch_list->add($arch); $arch_list->add($brch);
## now you can use all Archive methods also on all members of a Archive::List object $arch_list->prepare_create; $arch_list->create;
Use Archive to create, extract or remove archives.
The idea to create the Class Archive::List is actually just to be able of serialising method invocations.
(update: on dio's suggestion I put the POD directly into this node ....)