MaxConnPerIP 12 NoIPLimit image/* MaxConnPerIP 0 MaxConnPerIP 0 #### #!/usr/bin/perl use strict; use warnings; use Tie::File; use File::Copy; my $f = 'ipconn.conf'; my $location = '/'; # Was an attempt to parameterize the location field that way I can toggle through it once I have the below loop working. tie my @filelines, 'Tie::File', "$f", autochomp => 0 or die $!; foreach ( @filelines ) { if (!/^#/ && m/\/ && /^\s*MaxConnPerIP\s*/) { $_ = '#' . localtime . $_; $_ .= "\n\t\tMaxConnPerIP 10"; } else { print "in else"; } } untie @filelines or die $!; #### open (FILE, "< ipconn.conf") or die $!; my $file = ; close FILE; if ($file =~ m/\/s) print $&;