#!/usr/bin/perl package subs::utils; use strict; use warnings; BEGIN { require Exporter; # set the version for version checking our $VERSION = 1.00; # Inherit from Exporter to export functions and variables our @ISA = qw(Exporter); # Functions and variables which are exported by default # exported only if fully qualified our @EXPORT_OK = qw($henky); } my $filename = 'store.txt'; our $henky; if (open my $fh, '<', $filename) { local $/; $henky = <$fh>; } else { $henky = "henky_init"; } END { open my $fh, '>', $filename or die "Storage failed: $!" print $fh $henky; } 1; # return a true value, standard module behaviour