Skip Menu |

This queue is for tickets about the File-BaseDir CPAN distribution.

Report information
The Basics
Id: 41744
Status: resolved
Worked: 10 min
Priority: 0/
Queue: File-BaseDir

People
Owner: Nobody in particular
Requestors: mg.pub [...] gmx.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.03
Fixed in: 0.04



Subject: only emit "Warning: HOME not set" if neccessary
(Already confirmed in email conversation with the package maintainer) Web applications do not neccessarily have a $HOME, as you need to change config files to explicitly set it for CGI scripts. It would therefore be good if File::BaseDir only emits the warning about missing $HOME if it *must* access it for storing data there (it currently does always on "use 'File::BaseDir'). An alternative: make it configurable, if the application using File::BaseDir is a desktop app that needs $HOME or a webservice that doesn't. Thank you for considering.
From: selsky [...] columbia.edu
Trivial patch to omit the warning is attached.
Subject: omit-warning.patch
--- /usr/lib/perl5/vendor_perl/5.8.8/File/BaseDir.pm 2007-11-08 19:55:13.000000000 -0500 +++ /tmp/BaseDir.pm 2012-07-01 19:03:05.000000000 -0400 @@ -34,7 +34,7 @@ } my $home = $ENV{HOME}; unless ($home) { - warn "WARNING: HOME is not set, using root: $rootdir\n"; + #warn "WARNING: HOME is not set, using root: $rootdir\n"; $home = $rootdir; }
Applied suggest patch, no warnings issued if $ENV{HOME} is not set.