summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2020-01-19 09:40:41 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2020-01-19 09:40:41 (GMT)
commitfdea256ea75e0ca072915d7522564052a9f683f0 (patch) (side-by-side diff)
tree3067c9747649b21d85b5bb74e583b6777f17d37c
parentbfd076f64698d8985723547726cd6adb9b30eb67 (diff)
downloadfile-backup-fdea256ea75e0ca072915d7522564052a9f683f0.tar.gz
file-backup-fdea256ea75e0ca072915d7522564052a9f683f0.tar.bz2
Don't export specific backup interfaces by default.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--lib/File/Backup.pm14
-rw-r--r--t/00simple.t2
-rw-r--r--t/01numbered.t2
-rw-r--r--t/02auto.t2
4 files changed, 11 insertions, 9 deletions
diff --git a/lib/File/Backup.pm b/lib/File/Backup.pm
index 2550bdf..7e1eb5f 100644
--- a/lib/File/Backup.pm
+++ b/lib/File/Backup.pm
@@ -16,10 +16,9 @@ our @EXPORT = qw(BACKUP_NONE
BACKUP_SIMPLE
BACKUP_NUMBERED
BACKUP_AUTO
- backup
- backup_simple
- backup_numbered
- backup_auto);
+ backup);
+
+our @EXPORT_OK = qw(backup_simple backup_numbered backup_auto);
use constant {
BACKUP_NONE => 0, # No backups at all (none,off)
@@ -203,23 +202,26 @@ above, B<BACKUP_AUTO> is assumed.
The function returns the name of the backup file it created (C<undef> if
called with B<BACKUP_NONE>). On error, it calls B<croak()>.
-The following functions are provided for explicitly using a specific backup
-naming scheme:
+The following functions are available for using a specific backup naming
+scheme. These functions must be exported explicitly.
=head2 backup_simple
+ use File::Backup qw(backup_simple);
$backup_name = backup_simple($orig_name);
Creates simple backup.
=head2 backup_numbered
+ use File::Backup qw(backup_numbered);
$backup_name = backup_numbered($orig_name);
Creates numbered backup.
=head2 backup_auto
+ use File::Backup qw(backup_auto);
$backup_name = backup_auto($orig_name);
Creates numbered backup if any numbered backup version already exists for
diff --git a/t/00simple.t b/t/00simple.t
index d3444de..e6d3630 100644
--- a/t/00simple.t
+++ b/t/00simple.t
@@ -2,7 +2,7 @@
use lib qw(t lib);
use strict;
use TestBackup;
-use File::Backup;
+use File::Backup qw(backup_simple);
plan test => 4;
diff --git a/t/01numbered.t b/t/01numbered.t
index a464684..26a89b6 100644
--- a/t/01numbered.t
+++ b/t/01numbered.t
@@ -2,7 +2,7 @@
use lib qw(t lib);
use strict;
use TestBackup;
-use File::Backup;
+use File::Backup qw(backup_numbered);
plan test => 4;
diff --git a/t/02auto.t b/t/02auto.t
index 354e136..03f842a 100644
--- a/t/02auto.t
+++ b/t/02auto.t
@@ -2,7 +2,7 @@
use lib qw(t lib);
use strict;
use TestBackup;
-use File::Backup;
+use File::Backup qw(backup_numbered backup_auto);
plan test => 6;

Return to:

Send suggestions and report system problems to the System administrator.