commit 209212d59e9214fca8063e979d9c18995eb340d9 parent f0ea9f9fa6bfc1b5833deb0bc7cff1e2f7010a5f Author: Kyle Milz <kyle@getaddrinfo.net> Date: Thu, 19 Mar 2015 01:34:28 -0600 PriceChart: forgotten, the new xmkdir function Diffstat:
M | PriceChart.pm | | | 13 | ++++++++++++- |
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/PriceChart.pm b/PriceChart.pm @@ -4,7 +4,7 @@ use DBI; use Exporter; @ISA = ("Exporter"); -@EXPORT = qw(get_config get_dom get_log get_dbh trunc_line new_ua); +@EXPORT = qw(get_config get_dom get_log get_dbh trunc_line new_ua xmkdir); sub get_config @@ -148,4 +148,15 @@ sub trunc_line return $chopped . "..."; } +sub xmkdir +{ + my $dir = shift; + my $verbose = shift; + + unless (-d $dir) { + print "info: mkdiring $dir\n" if ($verbose); + mkdir $dir or die "couldn't mkdir $dir: $!"; + } +} + 1;