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 package name at
./start-banco.pl line 7.
Global symbol "@word" requires explicit package name
at ./start-banco.pl line 11.
Global symbol "@bancos" requires explicit package name
at ./start-banco.pl line 17.

The compilation show there are variables globals.

What I can to resolve this problem ?

And How I can to use perldoc to read a directory and
store your names in a array ?

equal with x =`ls opt`;  @word = split /\s+/, $x;

I'm bash programmer, and i want learn perl.

As Alan has explained, $x, @word and @bancos need declaring before you use
them, with 'my'.

You will also have got the message

 Scalar value @bancos[$i] better written as $bancos[$i]

which is self-explanatory.

Rob

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to