Hello,
I create a hash, and i want take the keys.
Using Deitel Book, i take this example:
numbers =
(
1 => 'one',
3 => 'two',
5 => 'three',
7 => 'four',
9 => 'five',
);
@hashkey = keys (%numbers);
When I try
Hello,
I need create a square using a single number, but I don't know how to create
the sides.
I have to create this:
* *
* *
My code is below :
print "Enter with number:";
chomp ($number = );
my @array = ();
$cont = 0;
while ($numero > $cont)
{
$array[$cont]="*";
Hello,
Today I write my perls scripts with a simple editor.
I found this link http://www.enginsite.com/Perl.htm, but it run only in Windows.
This link http://www.solutionsoft.com/perl.htm, contain the for linux, but have
to buy.
Anybody knows a simple and good IDE Perl for Linux ?
By,
Faria
Hello,
I would like, put element's array in hash table.
How I can do it ?
my %numbers = (
zero => '0',
one => '1',
two => '2',
three => '3',
four => '4',
five => '5',
six => '6',
seven => '7',
Hello,
I created a hash with some elements and keys.
The hash must receive a array.
Can I do it ?
best regards,
Faria
Abra sua conta no Yahoo! Mail, o único sem limite de espaço para
armazenamento!
http://br.mail.yahoo.com/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For addition
Hello,
I have a problem with a counter.
#!/usr/bin/perl
use strict;
use warnings;
print "Write a number:";
my $number= ;
my @array;
my $div = $number * 2 ;
my $i=0;
while ($div > 0)
{
$div = $div / 2;
$array[$i]=$div;
$i++;
}
print "Value i is: $i\n";
print "$array[0]\n";
prin
Hello,
I'm doing a script, it run a ping in many computers
and create a log file.
I need search in log file the word "Destination Host
Unreachable". So, I have to take below line. After
using regular expressions taking ferrari.lab and print
"The host is down !".
example:
PING ferrari.lab (192.
Hello,
I bought a book about Programming Perl, there is a
exercise :
1) Enter with a number and print asterisks (1..30)
ex: if you type six have go to screen:
**
See the below code :
if (($num1 >= 1 && $num1 <= 30)
{
for (my $i=1 ; $i < 30 ; $i++)
{
while ($num1 == $i)
Hello,
I want to convert the int for string, then use the
function lenght, and return the size of string.
How It is possible ?
Best regards,
Rodrigo Faria
--- Jeff Pang <[EMAIL PROTECTED]> escreveu:
> 2007/8/26, Rodrigo Tavares
> <[EMAIL PROTECTED]>:
> > Hello Jeff,
Hello Jeff,
See this simple script:
print "Enter with the fisrst number\n";
my $num = ;
How I can to convert variable $num, in string ?
Best regards,
Rodrigo Faria
--- Jeff Pang <[EMAIL PROTECTED]> escreveu:
> 2007/8/26, Rodrigo Tavares
> <[EMAIL PROTECTED]>
Hello,
In many languages there is a function for convert int
for string. Ho I can do it in Perl ?
Best regards,
Rodrigo Faria
Flickr agora em português. Você clica, todo mundo vê.
http://www.flickr.com.br/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [E
Hello John,
You could explain the below line ?
print join( ',', ( $arrow[ $_ ] ) x ( $_ + 1 ) ),
"\n";
Thanks,
Rodrigo Faria
--- "John W. Krahn" <[EMAIL PROTECTED]> escreveu:
> Chas Owens wrote:
> > On 7/31/07, John W. Krahn <[EMAIL PROTECTED]>
> wrote:
> > snip
> >> Or more simply as:
> >>
Hello John,
I don't understood the line in loop for the # in
variable arrow.
How It can to be used ?
Best regards,
Rodrigo
--- "John W. Krahn" <[EMAIL PROTECTED]> escreveu:
> Rodrigo Tavares wrote:
> > Hello,
>
> Hello,
>
> > I got make a
--- "John W. Krahn" <[EMAIL PROTECTED]> escreveu:
> Rodrick Brown wrote:
> > On 7/27/07, Rodrigo Tavares
> <[EMAIL PROTECTED]> wrote:
> >>
> >> How I can to make this program, where the
> variable is
> >> enter though , how separete the d
Hello,
In my first lesson, not extist split.
And without split ?
There is a mode more simple ?
Best regards,
Rodrigo Faria
--- Rodrick Brown <[EMAIL PROTECTED]> escreveu:
> On 7/27/07, Rodrigo Tavares
> <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > How I
Hello,
How I can to make this program, where the variable is
enter though , how separete the digits ?
Exercice
01)Write a program than user type five digits,
separates the individual digits of number, and print
the five digits time five, the four digit four times,
thus for ahead.
Best regards,
continents)
[] 2
invalid items entered, try again
Select your continent (or several nearby continents)
It's vey strange !
Bye
Rodrigo Farua
--- Chas Owens <[EMAIL PROTECTED]> escreveu:
> On 6/25/07, Rodrigo Tavares
> <[EMAIL PROTECTED]> wrote:
> snip
> > S
Hello,
See the log with i run perl -MCPAN -e shell:
Now we need to know where your favorite CPAN sites are
located. Push
a few sites onto the array (just in case the first on
the array won't
work). If you are mirroring CPAN to your local
workstation, specify a
file: URL.
First, pick a nearby con
Hello,
I try to install module dialog, but the errors
messages come to screen. I don't now what's happening.
see the logs :
/usr/bin/perl /usr/share/perl/5.8/ExtUtils/xsubpp
-typemap /usr/share/perl/5.8/ExtUtils/typemap -typemap
typemap Dialog.xs > Dialog.xsc && mv Dialog.xsc
Dialog.c
cc -c
Hello,
I like to know, if exist anything as tempfile and
dialog program in Perl.
Both commands is include in shell script.
I produce a software in shell-script that create new
databases in postgresql, define IP Address, Port
Number, set permissions, test versions, replace fields
and others. And
Hello,
I need to use the delimiter " " , (one blank space).
I read perdoc, i try to use this :
if ( "8.1.8" =~ /[\d $versao \s]/)
But the expression is always true.
Where is the error ?
my code :
#!/usr/bin/perl
$version=`/usr/local/pgsql/bin/pg_ctl --version`;
print $version;
if ( "8.1.8" =
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 valu
Hello,
I'm changing the script postgresq-init.sh for
postgresql-init.pl. I made all perl scripts for store
the database names. But my doubt is the case.
In bash i have:
#case $1 in
# start)
# $ECHO_N "Starting PostgreSQL: "$ECHO_C
# su - $PGUSER -c "$DAEMON -D '$PGDATA' &"
>>$PGLOG
Hello,
What's the more fast ?
1) perl -pi -e 's/foo/bar/g' file.txt
2) open the file and make modifications
In C/C++ manipulation of files are operations very
weighed. Slow perfomace.
Best regards,
Rodrigo Faria Tavares
__
Fale com seus ami
an 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.
Best regards,
Rodrigo Faria
> On Mar 23, 10:43 am, [EMAIL PROTECTED]
(Rod
Hello,
My code is below:
$aux = `ls /opt`;
@word = split /\s+/, $aux;
my @bancos = ();
foreach my $i (@word)
{
if ( -e "/opt/$i/postgresql.conf" )
{
push(@bancos,$i);
}
}
for ($i = 0; $i < @bancos; $i++)
{
su postgres -c "/usr/local/pgsql/bin/pg_ctl start -D
@banco
Hello,
I made a script with shell script using dialogs.
I try to use the commando Dialog in a perl script.
But i can't run the dialog in perl script.
Can perl use windows softwares ?
I belive this true.
What is the software ?
best regards,
Rodrigo Faria
Hello,
In shell-script I get a variable with command line:
AUXIP=`cat $INPUTDB/postgresql.conf | grep "localhost"
| awk '{print $3}' | head -n1`
In C++, I use the functions read, write and others for
manipulation files.
And Pearl ?
After I open the file, i like to get a simple word and
store
28 matches
Mail list logo