January 31, 2012

Solaris: How to verify 64 bit Perl installation

Posted in Perl at 10:15 am by alessiodini


Today i needed to understand if a Perl installation was 32 or 64 bit.
Looking on the web i found that is possible to know this even using perl command itself , as follow:

system2 # perl -V:use64bitall
use64bitall=’undef’;
system2 # perl -V:use64bitint
use64bitint=’undef’;

With these commands there are 2 possibilities:
define = says “yes”
undefined = says “no”

So , where i ran these commands Perl running was in 32 bit.

March 3, 2009

Uniq command

Posted in Perl at 4:25 pm by alessiodini


Today in my free time at job , i wrote a perl script that works as uniq command:

[cr@eseross01 tmp]$ cat test
ciao
bello
brutto
alessio
pippo
pluto
alessio
alessio

The test file contains three “alessio” , so this string is replicated.
I run my script on this file:

[cr@eseross01 tmp]$ perl uniq.pl test
ciao
bello
brutto
alessio
pippo
pluto

He returns the singles strings!
The code is here