xjlittle has asked for the wisdom of the Perl Monks concerning the following question:
Thanks for your help! John#!/usr/bin/perl -w # print "Please put in the username for which you want to setup a virtua +l host:\n"; my $user = <STDIN>; my @fields = (); my $fields = (); open TPL, "vh_template.tpl"; my @vhost = <TPL>; close TPL; foreach my $vhost(@vhost){ if ($vhost =~ /^ServerName/){ @fields = split /\./, $vhost; $fields = @fields; s/$fields\[0\]/$user/; #this line generates the error print "$fields[0]\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: uninitialized value in substitution
by ihb (Deacon) on Sep 09, 2004 at 19:40 UTC | |
|
Re: uninitialized value in substitution
by bobf (Monsignor) on Sep 09, 2004 at 19:46 UTC | |
|
Re: uninitialized value in substitution
by ikegami (Patriarch) on Sep 09, 2004 at 19:50 UTC | |
|
Re: uninitialized value in substitution
by mayhem (Hermit) on Sep 09, 2004 at 19:36 UTC |