suppose my @{$data1{$callid}}; cotains
one two three
three five six
one two three
of random patterns but each item is separated by white space or tab,
Below code extract and get rid of the whitespace perfectly so that it shows now like this
onetwothree
threefivesix
onetwothree
39 foreach $callid (sort keys %data1) {
40 my @fields = @{$data1{$callid}};
41
42 for my $element (@fields) {
43 $element =~ s/\s+//g;
44 print "$element";
48 }
50 print "\n";
but I wanted to do it so that certain length of output woudln't show, such as less than 5, so I thought I could do this,
39 foreach $callid (sort keys %data1) {
40 my @fields = @{$data1{$callid}};
41 # print "$callid\n";
42 for my $element (@fields) {
43 $element =~ s/\s+//g;
44 #print "$element";
45 # next if (length($element) < 15) ;
46 # print "length($element)";
47 my @element = join(//,$element);
48 }
49 print "@element";
50 print "\n";
I first did the 45 and 46 but then I realize that I am doing the length on the field(not for the record), so I just try to gather back all the record in array, but I am not having much luck...