Scarborough has asked for the wisdom of the Perl Monks concerning the following question:
Anyone approched something like this before below is a small section of code.
use strict; my $inv870 = new Job("INV870","perl INV870.pl","172.**.***.**",sub{ #do +something after the job }); my $suite = new Suite('AMREPS',[$inv870]); print $suite->xml; package Job; sub new { my $class = shift; my $name = shift; my $command = shift; my $location = shift; my $afterhook= shift; my $data = {UNIQUENAME => $name, COMMAND_LINE => $command, LOCATION => $location, HOOK => $afterhook}; my $self = bless $data, $class; return $self; } 1; package Suite; use XML::Simple; sub new { my $class = shift; my $name = shift; my $jobarray = shift; my $data = {UNIQUENAME => $name, JOBS => $jobarray}; my $self = bless $data, $class; return $self; } sub xml{ my $class = shift; return XMLout($class); } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML and code snippets
by holli (Abbot) on Jul 28, 2005 at 13:11 UTC | |
by Scarborough (Hermit) on Jul 28, 2005 at 13:17 UTC | |
|
Re: XML and code snippets
by jhourcle (Prior) on Jul 28, 2005 at 13:55 UTC | |
by Scarborough (Hermit) on Jul 29, 2005 at 10:51 UTC |