X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FTak.git;a=blobdiff_plain;f=lib%2FTak.pm;h=7258b73829809aba832a6e1ca68154a9ee2dc13e;hp=b77a77067cd82ee33254304eebba91ee749e7aaf;hb=4a66f5286d8acbc7cf2b8aafcc9cebd474a30614;hpb=ac3e780c183dfb0a70dfce38f4766cfd587a3575 diff --git a/lib/Tak.pm b/lib/Tak.pm index b77a770..7258b73 100644 --- a/lib/Tak.pm +++ b/lib/Tak.pm @@ -85,6 +85,43 @@ A drink leaked in my bag on the way back from LPW. My laptop is finally alive again though so I'll try and turn my slides into a vague attempt at documentation while I'm traveling to/from christmas things. +=head1 Example + +$ cat Takfile +package Tak::MyScript; + +use strict; +use warnings; + +use Tak::Takfile; +use Tak::ObjectClient; +use lib "./lib"; + +sub each_host { + my ($self, $remote) = @_; + + my $oc = Tak::ObjectClient->new(remote => $remote); + my $name = $oc->new_object('My::Hostname'); + print "Connected to hostname: " . $name . "\n"; + } + +1; + +----- + +$cat ./lib/My/Hostname +package My::Hostname; + +use Sys::Hostname; + +sub new { + my ($self) = @_; + my $name = hostname; + return $name; + } + +1; + =head1 AUTHOR mst - Matt S. Trout (cpan:MSTROUT)