Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: my first packet sniffer in perl

by davorg (Chancellor)
on Jun 29, 2009 at 13:58 UTC ( [id://775679]=note: print w/replies, xml ) Need Help??


in reply to my first packet sniffer in perl

use Strict; #i usually don't use it

And you're not really using it here. There's no module called "Strict.pm", it's "strict.pm". Capitalisation is important and a good programmer needs an eye for detail like that.

Update: Just noticed this too.

$snaplen=150; #atleast 80 chars
$to_ms=100; #wait for 1 sec

Are you deliberately writing comments that don't match the code? Are you trying to confuse anyone who maintains your code?

--

See the Copyright notice on my home node.

Perl training courses

Replies are listed 'Best First'.
Re^2: my first packet sniffer in perl
by hnd (Scribe) on Jun 29, 2009 at 14:16 UTC
    um....no
    the $snaplen thing is the ssize of the data in the packet
    actually it was 135 but i rounded it off to nearest 50 :/
    and the $to_ms thing is the time to wait for a packet
      the $to_ms thing is the time to wait for a packet

      Right. The time to wait in milliseconds. You've set it to 100 milliseconds. But your comment says you've set it to one second. 100 milliseconds is not one second. Hence, it's a confusing comment.

      --

      See the Copyright notice on my home node.

      Perl training courses

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-03-29 00:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found