To fix this line, just remove the "my" before "$VARDB_database":
if ( ($line =~ /^VARDB_database/) && ($CLIDB_database < 1) )
{$VARDB_database = $line; my $VARDB_database =~ s/.*=//gi;}
Using strict and warnings will save you from bugs like the above which fail silently:
use strict;
use warnings;
#path to astguiclient configuration file:
my $PATHconf = '/etc/astguiclient.conf';
my (
$PATHlogs,
$VARserver_ip,
$VARDB_server,
$VARDB_database,
$VARDB_user,
$VARDB_pass,
$VARDB_custom_user,
$VARDB_custom_pass,
$VARDB_port);
# Now perl knows the variables you will use, so if there is
# a typo later like "$PATHlog" instead of "$PATHlogs" then
# perl will tell you how to fix it, instead of just failing
# silently (like crappy PHP and Python :^)
open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n";
my @conf = <conf>;
close(conf);
my $i=0;
foreach(@conf){
my $line = $conf[$i];
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.