Mallik wrote:
Hi,

Hello,

I have a below hash (printed using Dumper).

$VAR1 = {
          'Technologies':'Optical':'Dense Wavelength Division Multiplexing
(DWDM)'
          };
$VAR2 = {
          'typeInfoSortKey' => '',
          'mdfName' => 'Linear with Optical Add/Drop Multiplexing (OADM)',
          'childKeys' => '',
          'docs' => '',
          'docTitles' => '',
          'mdfId' => '279524369',
          'level' => '4',
          'parentMdfId' => '268436078',
          'count' => 0,
          'link' => 'Linear_with_Optical_Add_D_279524369.html'
        };

Here, the key is 'Technologies':'Optical':'Dense Wavelength Division
Multiplexing (DWDM)'.

Now, I want to replace it with something like 'abc'.

Any pointers on this?

$ perl -le'
my %a = "a" .. "j";
print join " ", %a;
$a{ new } = delete $a{ e };
print join " ", %a;
'
e f c d a b g h i j
c d a b g h new f i j


And you can use that on multiple keys:

$ perl -le'
my %a = "a" .. "j";
print join " ", %a;
@a{ "M", "N", "O", "P", "Q" } = delete @a{ "a", "c", "e", "g", "i" };
print join " ", %a;
'
e f c d a b g h i j
Q j O f M b N d P h




John
--
use Perl;
program
fulfillment

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to