From 6875a02e7475b8288c0044795c1b77adaf213ba9 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 27 Feb 2017 14:50:47 +0100 Subject: Move debug() to main package Signed-off-by: Florian Pritz --- lib/App/BorgRestore.pm | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'lib/App/BorgRestore.pm') diff --git a/lib/App/BorgRestore.pm b/lib/App/BorgRestore.pm index 6e92c1c..746dffc 100644 --- a/lib/App/BorgRestore.pm +++ b/lib/App/BorgRestore.pm @@ -5,11 +5,7 @@ use warnings; our $VERSION = "2.0.0"; - - -1; -__END__ - +=pod =encoding utf-8 =head1 NAME @@ -49,3 +45,23 @@ Florian Pritz Ebluewind@xinu.atE =cut +sub new { + my $class = shift; + my $opts = shift; + + my $self = {}; + bless $self, $class; + + $self->{opts} = $opts; + + return $self; +} + +sub debug { + my $self = shift; + say STDERR @_ if $self->{opts}->{debug}; +} + + +1; +__END__ -- cgit v1.2.3-24-g4f1b