Rodrigo Tavares wrote:
Hello,
With this line the script run, no errors.
system "su postgres -c '/usr/local/pgsql/bin/pg_ctl
start -D /opt/@bancos[$i]'";
two things :
I use of stricts and warnings, and come this error
compilation when i wrote into my code.
Global symbol "$x" requires explicit
On Tuesday 27 March 2007 06:47, Rodrigo Tavares wrote:
> Hello,
[ . . ]
> I use of stricts and warnings, and come this error
> compilation when i wrote into my code.
>
> Global symbol "$x" requires explicit package name at
> ./start-banco.pl line 7.
> Global symbol "@word" requires explicit package
Hello,
With this line the script run, no errors.
system "su postgres -c '/usr/local/pgsql/bin/pg_ctl
start -D /opt/@bancos[$i]'";
two things :
I use of stricts and warnings, and come this error
compilation when i wrote into my code.
Global symbol "$x" requires explicit package name at
./start-
Rodrigo Tavares wrote:
> Hello,
Hello,
> My code is below:
>
> $aux = `ls /opt`;
> @word = split /\s+/, $aux;
That won't work very well if you have names with embeded spaces. A better
option would be to assign the back-quote results to an array.
> my @bancos = ();
Why are you assigning noth
Hello,
>
>$aux = `ls /opt`;
This is not good since Perl has built-in function for read a dir.
see:
perldoc -f opendir
perldoc -f readdir
> su postgres -c "/usr/local/pgsql/bin/pg_ctl start -D
>@bancos[$i]";
'su' is not Perl's function.This is a unix shell command,you need to call it
with sy