Perl::Critic recommended a couple minor changes

pull/318/head
Andrew Bauer 2014-01-25 12:42:33 -06:00
parent dbe6fc539c
commit e707e72fe3
1 changed files with 4 additions and 4 deletions

View File

@ -121,7 +121,7 @@ PARAMETERS:
--import [file.sql] - Import new camera controls and presets found in
zm_create.sql into the ZoneMinder dB.
Optionally specify an alternate sql file to read from.
--topreset [id] - Copy a monitor to a Camera Preset given the monitor id.
--topreset id - Copy a monitor to a Camera Preset given the monitor id.
--overwrite - Overwrite any existing controls or presets.
with the same name as the new controls or presets.
--help - Print usage information
@ -229,10 +229,10 @@ sub importsql
$sqlfile = $Config{ZM_PATH_DATA}.'/db/zm_create.sql';
}
open(SQLFILE, $sqlfile) or die( "Can't Open file: $!\n" );
open(my $SQLFILE,"<",$sqlfile) or die( "Can't Open file: $!\n" );
# Find and extract ptz control and monitor preset records
while (<SQLFILE>) {
while (<$SQLFILE>) {
# Our regex replaces the primary key with NULL
if (s/^(INSERT INTO .*?Controls.*? VALUES \().*?(,')(.*?)(',.*)/$1NULL$2$3$4/i) {
$controls{$3} = $_;
@ -240,7 +240,7 @@ sub importsql
$monitorpresets{$3} = $_;
}
}
close SQLFILE;
close $SQLFILE;
if ( ! (%controls || %monitorpresets) ) {
die( "Error: No relevant data found in $sqlfile.\n" );