Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^2: List Wrapper for Object Methods.

by pelagic (Priest)
on Dec 03, 2004 at 15:45 UTC ( #412157=note: print w/replies, xml ) Need Help??

in reply to Re: List Wrapper for Object Methods.
in thread List Wrapper for Object Methods.

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.


    use Archive;

    ##  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

    ##  create a physical Archive using 'gtar czvf'

    ##  or

    ##  extract a physical Archive using 'gtar xzvf'

    ##  or

    ##  remove a physical Archive using 'rm -f'

    ##  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

    ##  now you can use all Archive methods also on all members of a Archive::List object


Use Archive to create, extract or remove archives.


Archive Methods


Create a Archive object.


The check_archive Function checks whether an archive exists and refuses to overwrite it unless we set the parameter 'force'. It also checks whether the directory of the archive-to-be exists, is really a directory and is writeable for this user.


The create Function actually creates a physical gtar-ed archive.


The prepare_extract Function checks whether an archive exists and whether the target directory of the extraction exists, is really a directory and is writeable for this user.


The extract Function actually restores all files contained in a gtar-ed archive.


The remove Function removes a gtar-ed archive.

Archive::List Methods


Create a Archive::List object.


Adds a Archive object to the Archive::List object that invoked the method.

prepare_create create prepare_extract extract remove

These methods called on a Archive::List object do the same for all Archive objects in the list.

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 ....)


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://412157]
[shmem]: good $localtime monkses
[holli]: mmh. maybe a user handle "dry arian" is a bit unfortunate? https://www. dryarian/
[Discipulus]: exists!
[shmem]: holli, agreed. "dry airan" would be slightly better :P
[holli]: virtualsue: How much was left?
[shmem]: Discipulus: oh. tatsächlich.
shmem missed his monkday yesterday :P - 12 years and way to go...
[1nickt]: Happy Monkday shmem. I was at my stepson's birthday party and thought of you.
[virtualsue]: holli about half
[choroba]: "Tatsächlich, das ist die Knochenstruktur eines Bettlers!" ??

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (13)
As of 2017-11-21 12:52 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (301 votes). Check out past polls.