Ok I have the following code...only part of the total
I am very new to Perl, so this probably very obvious to most of you.
Basically the total code opens a socket and the data comes to here as "$_"....and then is sent to the parser module. And I am trying to break down the hash...
-----------------------------------------
while(<$sock>) {
print $_;
#packets end in \n\r
chop();
chop();
my %aprsPacket;
my($aprsPacket) = parseAPRSPacket($_);
print Dumper($aprsPacket);
print $aprsPacket;
print "\r\n";
while(my ($k, $v) = each %aprsPacket) {
print "key: $k, value: $v\n";
}
}
-------------------------------------------------
My problem is that I dont get any output from the the hash separation in the last while section.
Here is the output
$VAR1 = {
'SYMBOL' => '/-',
'LAT' => '##.714',
'FROM' => '*****',
'COMMENT' => '****** in service. {UIV32N}',
'MESSAGING' => '0',
'LON' => '-###.208333333333',
'PATH' => 'TCPIP*,qAC,T2ONTARIO',
'TO' => 'APU25N',
'AMBIGUITY' => 0
};
HASH(0x8159e74)
---------------------------------------------------------
So as you can see I get Dumper to print the hash for me just fine....and the Hash value is printed....but the last section doesn't work like I expected it to.
while I am here....I want to eventually put all this stuff into a mysql database...maybe yu could point me in the right directon
Thanks to all
and
have a good holiday.
Brian
I am very new to Perl, so this probably very obvious to most of you.
Basically the total code opens a socket and the data comes to here as "$_"....and then is sent to the parser module. And I am trying to break down the hash...
-----------------------------------------
while(<$sock>) {
print $_;
#packets end in \n\r
chop();
chop();
my %aprsPacket;
my($aprsPacket) = parseAPRSPacket($_);
print Dumper($aprsPacket);
print $aprsPacket;
print "\r\n";
while(my ($k, $v) = each %aprsPacket) {
print "key: $k, value: $v\n";
}
}
-------------------------------------------------
My problem is that I dont get any output from the the hash separation in the last while section.
Here is the output
$VAR1 = {
'SYMBOL' => '/-',
'LAT' => '##.714',
'FROM' => '*****',
'COMMENT' => '****** in service. {UIV32N}',
'MESSAGING' => '0',
'LON' => '-###.208333333333',
'PATH' => 'TCPIP*,qAC,T2ONTARIO',
'TO' => 'APU25N',
'AMBIGUITY' => 0
};
HASH(0x8159e74)
---------------------------------------------------------
So as you can see I get Dumper to print the hash for me just fine....and the Hash value is printed....but the last section doesn't work like I expected it to.
while I am here....I want to eventually put all this stuff into a mysql database...maybe yu could point me in the right directon
Thanks to all
and
have a good holiday.
Brian