in reply to Re: Splitting data into chunks!
in thread Splitting data into chunks!

Hi

I ma trying to include this code within my script but it seems to through errors!

My Code
#! c:/perl/bin/perl.exe # use strict; use warnings; use Data::Dumper; my ($Rec,$pc_name); undef $/; open (LST,"c:/tim/showtech".$ARGV[0].".txt") || die "$!\n"; my $Switch_Data =<LST>; close LST; my @Switch_Array = split(/\*{66}\n/, $Switch_Data); for (@Switch_Array) { next unless (/show port-channel database/); $pc_name = $1, next if (/(port-channel \d+)$/); $Rec->{$pc_name}->{$1} = $2 if (m|(fc\d+/\d+)\s+\[(\w+)\]|); #print "$_\n"; }
the error I ma getting is
Use of uninitialized value in hash element at C:\Perl\Vodafone\pm_data +_chunks2.p l line 20.
Any Idea why?

Blackadder