misconfiguration has asked for the wisdom of the Perl Monks concerning the following question:
if ($nossl) { &mkdirs($nossl); }
sub mkdirs { # Can be used to build SSL and non-SSL sites. my $nossl; my $newsite = $nossl; if ( -e "/virtual/$newsite" ) { die "The site \"$newsite\" must already be built!\n"; } else { my %mkdircmd = ( virtual => "mkdir /virtual/$newsite", apachedir => "mkdir /etc/httpd/conf/$newsite", ssl_crt => "mkdir /etc/httpd/conf/$newsite/ssl.crt", ssl_csr => "mkdir /etc/httpd/conf/$newsite/ssl.csr", ssl_key => "mkdir /etc/httpd/conf/$newsite/ssl.crt", logs => "mkdir /var/log/httpd/$newsite" ); system( $mkdircmd {'virtual'} ); system( $mkdircmd {'apachedir'} ); system( $mkdircmd {'ssl_crt'} ); system( $mkdircmd {'ssl_csr'} ); system( $mkdircmd {'ssl_key'} ); system( $mkdircmd {'logs'} ); sleep 2; print "Directories have been built!\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Passing a variable to a sub process.
by apl (Monsignor) on Apr 02, 2008 at 17:49 UTC | |
|
Re: Passing a variable to a sub process.
by toolic (Bishop) on Apr 02, 2008 at 17:50 UTC | |
by misconfiguration (Sexton) on Apr 02, 2008 at 18:21 UTC | |
by Bilbo (Pilgrim) on Apr 02, 2008 at 18:58 UTC | |
|
Re: Passing a variable to a sub process.
by johngg (Canon) on Apr 02, 2008 at 21:56 UTC | |
|
Re: Passing a variable to a sub process.
by mhearse (Chaplain) on Apr 02, 2008 at 18:43 UTC |