#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my %Env = ('PPA_CURRENT_PROJECT' => 'D:\Projects\CurrentProject' => 'Directory', 'PPA_DMS' => 'D:\DMS' => 'Directory', 'PPA_DMS_MKL' => 'D:\MKL\ia32\bin' => 'Directory', 'PPA_DataQualityDistributor_CSVFILEPATH' => '\\e4n-00\SR5_ASRRE\CSV' => 'Path', 'PPA_DataQualityDistributor_DVLOGSPATH' => '\\e33n-003\SR5_ASRD\DVLOGS' => 'Path', 'PPA_DataQualityDistributor_INTERMEDIATEFILEPATH' => '\\e34n-001\SR5_ASRD\INTERMEDIATE' => 'Path', 'USERDNSDOMAIN' => 'PP008.COGY.NET' => 'Value', 'USERDOMAIN' => 'PP008' => 'Value', 'USERNAME' => 'k004lv7w' => 'Value'); #::my @Env_Dir = (\@Env1, \@Env2, \@Env3, \@Env4, \@Env5, \@Env6, \@Env7, \@Env8, \@Env9); #::print Dumper \@Env_Dir; my @directory = ();#Array containing environment directory my @path = (); #Array containing environment path my @value = (); #Array containing environment value foreach $_(values %Env) { if ($_ == "Directory") { print 'This is a Directory'; push (@directory, ($Env{$_})); } elsif ($_ == 'Value') { print 'This is a Path'; push (@path, $Env{$_}); } elsif ($_ =='Path') { print 'This is a Value'; push (@value, $Env{$_}); } } print Dumper \@directory; print Dumper \@path; print Dumper \@value;