[ale] Invalid value for share scalar?

Watson, Keith R. krwatson at cc.gatech.edu
Mon Oct 2 13:12:56 EDT 2006


> -----Original Message-----
> From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of
> Christopher Fowler
> Sent: Monday, October 02, 2006 10:13
> To: ale at ale.org
> Subject: [ale] Invalid value for share scalar?
> 
> I'm playing around with Net::Pcap and I've written a program that will
> capture packets and push those packets to a list (array).  A thread
will
> then process that list.
> 
> Here are some pieces:
> 
>      12 {
>      13   package Packet;
>      14
>      15   sub new {
>      16     shift;
>      17     my ($v1, $v2)  = @_;
>      18     my $Packet = {
>      19     "timestamp" => $v1,
>      20     "packet"    => $v2,
>      21     };
>      22
>      23     bless $Packet, 'Packet';
>      24     return $Packet;
>      25   }
>      26
>      27   sub get_packet {
>      28     my $self = shift;
>      29     return $self->{'packet'};
>      30   }
>      31
>      32   sub get_timestamp {
>      33     my $self = shift;
>      34     return $self->{'timestamp'};
>      35   }
>      36
>      37 }
>      38
>      39 my @objs  : shared = ();

Chris,

I'm unfamiliar with the syntax of line 39. What is it supposed to do?

keith



>      40
> 
> ...
> 
>     105 sub catch {
>     106   my ($arg,$hdr,$pkt) = @_ ;
>     107   push @objs, Packet->new(now(), $pkt);
>     108 }
> 
> 
> Here is the error I'm getting:
> Invalid value for shared scalar at ./syn.pl line 106.
> Can someone tell me what I did wrong?
> 
> The whole idea of the thread is that I want the packets logged.
> Eventually to a database.  I need the capture thread to do nothing but
> read data from the device as fast as possible.  The processing thread
> can take its sweet time going through the results.
> 
> 
> Thanks,
> Chris
> 


-- 

Keith R. Watson                        Georgia Institute of Technology
Systems Support Specialist IV          College of Computing
keith.watson at cc.gatech.edu             801 Atlantic Drive NW
(404) 385-7401                         Atlanta, GA  30332-0280




More information about the Ale mailing list