#!/usr/bin/perl
# auto.pl
use strict;
use warnings;
use Auto::GUI;
use Auto::MakeArticle;
my $auto = Auto::GUI->new;
$auto->fire_up_front_end
or die;
####
package Auto::GUI;
use strict;
use warnings;
sub new {
my $class = shift;
my $self = {};
bless $self, $class;
return $self;
}
sub fire_up_front_end{
my $self = shift;
# display the gui
# later... a button will call MakeArticle
my $mk = Auto::MakeArticle->new;
$mk->make($self); # pass the GUI object (?)
}
sub msg {
# show progress/error messages
my $self = shift;
my $msg = shift;
print "$msg\n";
}
1;
##
##
package Auto::MakeArticle;
use strict;
use warnings;
sub new {
my $class = shift;
my $self = {};
bless $self, $class;
return $self;
}
sub make{
my $self = shift;
my $gui = shift; # GUI object
# do stuff to make page
my $msg = "message from MakePage";
$gui->msg($msg);
}
1;
##
##
---------- Capture Output ----------
> "C:\Perl\bin\perl.exe" auto.pl
message from MakePage
> Terminated with exit code 0.