Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: A CDMA problem

by Fighter2 (Novice)
on Nov 17, 2011 at 19:43 UTC ( #938675=note: print w/ replies, xml ) Need Help??


in reply to Re: A CDMA problem
in thread A CDMA problem

Hi juster.

So my code compiles. and thanks for cleaning it up so nicely. I do have an error when I try to run it though.

C:\Dropbox\PandaDBCM>perl -d logprocessTempNff.pl sample2.nff out.txt 1069 Can't use string ("980904258.881354") as a HASH ref while "strict refs +" in use at logprocessTempNff. pl line 222. C:\Dropbox\PandaDBCM>

I think "980904258.881354" is the timestamp. It looks like it. I know it will take a few tries to make this work. but how do I fix this error I wonder. Hmm. ?


Comment on Re^2: A CDMA problem
Download Code
Re^3: A CDMA problem
by juster (Friar) on Nov 17, 2011 at 22:34 UTC
    The error is pretty straightforward. That happens when you try to use a string as a hash reference. I.e.:

    my $foo = 'bar'; $foo->{'key'} = 'value'; # or likely for my $k (values %{$foo}){ ... }

    Just look at the line number specified and back-track from there. Use Data::Dumper or Data::Dump to ensure you have the values you are expecting (like a hashref instead of a string). Print them to screen alot, etc.

    I know there is one typo where I used the wrong variable ($logpkt should be $fngpkt in one spot) and I think I might have used values() where I shouldn't have. Make sure you understand values. Make sure you understand references, read perlreftut for example.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://938675]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2014-11-28 01:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (191 votes), past polls