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"; } }
In reply to uninitialized value in substitution by xjlittle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |