baxy77bax has asked for the wisdom of the Perl Monks concerning the following question:
i have this problem where i would like to create a path and directories automatically. my script is :
so when i initialize Main, the sub that checks if there is a path to my specific variable is started. like :use strict; use lib "./Lib"; use Main; my $control = Main->new(); print "finished \n";
so my question is : do people tend to do it like this or is there some other more practical/elegant way to do it ?package Main; use strict; use File::Path qw(make_path remove_tree); ################################################## sub new { ################################################## my ($class)=@_; craete_path(); my $hash = {}; bless ($hash,$class); } sub create_path { # here it first checks if the path already exists or not, and if ther +e is no path, then it creates a path (with all necessary directory's) +. } 1;
thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to create the path automatically
by moritz (Cardinal) on Jun 18, 2009 at 12:34 UTC | |
by rovf (Priest) on Jun 18, 2009 at 12:49 UTC | |
by baxy77bax (Deacon) on Jun 18, 2009 at 12:56 UTC | |
by holli (Abbot) on Jun 18, 2009 at 20:57 UTC | |
|
Re: how to create the path automatically
by rovf (Priest) on Jun 18, 2009 at 12:42 UTC |