Get the Architecture type

2003-07-07 Thread BUFFERNE,VINCENT (HP-France,ex1)
Hi,

Within a perl script, I would like to get the architecture type of the
machine (ia32, ia64, pa-risc...).
Is there an equivalent routine to the shell call uname -a in Perl?

Thanks,

Vincent

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How to measure Array or Hash's byte size ?

2003-04-04 Thread BUFFERNE,VINCENT (HP-France,ex1)
What's about:

my @foo = ( '1', '2' ,'3' );
my $size = $#foo + 1;
print table size $size\n;

Ouput:
table size 3

Vincent

-Original Message-
From: Li Ngok Lam [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 03, 2003 5:14 PM
To: [EMAIL PROTECTED]
Subject: How to measure Array or Hash's byte size ?


My method  sounds stupid, but still works :

my @array = ('123', 'abc', 'def',  1..9);
my $len_of_array =  0 ;
foreach my $elem(@array)
{$len_of_array += length($elem) }
print $len_of_array ; # I got '18'

my %hash = (1=2, 2=3, 3=4);
foreach my $key(keys(%hash))
{$len_of_hash += length($key) + length($hash{$key}) }
print $len_of_hash ; # I got '6'

I suppose there should be another better and faster way to done this, 
any suggestion ?

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]