#!/usr/local/bin/perl

use strict;

while (<>) {
        chomp;
        my @values = split(/;/);
        my ($mtype,$cell,$sector,$rlptxat) =
($values[5],$values[31],$values[32],$values[44]);
        print "$mtype - $cell - $sector - $rlptxat\n";
}

i dont know if that is over simplified, you may have to add or
subtract from the array indexes i provided.

-jose

On Thu, Jan 6, 2011 at 12:49 PM, Robert Wohlfarth <rbwohlfa...@gmail.com> wrote:
> On Thu, Jan 6, 2011 at 12:25 PM, Chris Stinemetz <
> cstinem...@cricketcommunications.com> wrote:
>
>> 11.   %fieldMap = split(/;/, $data);
>>
>>
>> 12.   foreach my $data (keys %fieldMap) {
>>
>> 13.   print "$fieldMap{$data}\t";
>>
>> 14.   }
>>
>> Odd number of elements in hash assignment at./beta2.pl line 15, <> line 1.
>> Use of uninitialized value within %fieldMap in concatenation (.) or string
>> at ./beta2.pl line 18, <> line 1.
>>
>
> Line 11 treats the result of "split" as a list of "key => value" pairs. You
> end up with something like this...
> $fieldMap{8} = 1023240136
> $fieldMap{1218} = 0
> $fieldMap{1} ="00a000001a2bcdc7"
>
> Perl expects the data to have a value for every key. The first error - odd
> number of elements - means that Perl saw a key without a corresponding
> value. The data has an odd number of elements. To save into a hash, it
> should have an even number of elements.
>
> --
> Robert Wohlfarth
>

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to