Wednesday, February 24, 2010

Learning Perl: List all environment variables

Listing all the environment variables using the built-in %ENV hash and simple for loop:

my @env_names = keys %ENV;

my $n;
my $v;

for ($k=0 ; $k<=$#env_names ; $k++)
{
    $n = $env_names[$k];
    $v = $ENV{"$n"};
    print "\n $n=$v";
}

A much shorter version using for each:

my @env_names = keys %ENV;
my $v;
foreach (@env_names)
{

    $v = $ENV{"$_"};
    print "\n $_=$v";
}

Putting it all in one line

print "\n $_=" , $ENV{"$_"} foreach (keys %ENV);

However, DOS still attractive … just use the SET command to get same result of the above :)

Thursday, February 04, 2010

Monday, January 11, 2010

Tuesday, January 05, 2010

IBM software architect kit

Get yourself a wealth of architecture resources in the following kit from IBM:

https://www6.software.ibm.com/developerworks/offers/kits/archkit1/index.html

Monday, January 04, 2010

Learn DB2 in one day

 

A complete online video based course to learn DB2

http://www.channeldb2.com/group/db2oncampus