On 4/9/07, Rodrigo Tavares <[EMAIL PROTECTED]> wrote:
Hello,
I put in my code:
use strict;
use warnings;
So I declared many variables. By example counters and
arrays. Using my.
My script start the postgres.
./postgresql.pl start|stop|reload|status
I'm using this below structure. When I run the script
como the message :
Use of uninitialized value in string eq at
./postgresql.pl line 67
One of your variables as undef as its value. This can be an error or
can be something you are doing on purpose. It is best to put guard
code that sets a default value around variables that may or may not be
set:
$var = "" unless defined $var;
if i put in code : my @ARGV = ('a');
Come the message:
sh: -c: line 0: unexpected EOF while looking for
matching `''
sh: -c: line 1: syntax error: unexpected end of fil
It is odd that you are receiving borne shell errors while running a
Perl script. Do you have a #! line at the start of your file that
points to the perl interpreter? It looks like you have an unbalanced
quote somewhere.
I tried create this array, but all attempts fail.
How I can to resolve this problem ?
if ($ARGV[0] eq 'stop')
{
print "Stopping PostgreSQL:\n";
unless (fork)
{
for (my $i = 0; $i < @banks; $i++)
If you must loop this way at least do it like this:
for my $i (0 .. $#banks) {}
But most likely you don't need to loop that way and it is better to
loop this way:
for my $bank (@banks) {}
{
print "Hello World !"
}
} # fecha fork
}
best regards,
Faria
__________________________________________________
Fale com seus amigos de graça com o novo Yahoo! Messenger
http://br.messenger.yahoo.com/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/