in reply to Strange Compilation Failed in Require Error

This line is your problem.
my $SockObj = Comm->new( $self->_serveraddr, $self->_port );

A few issues

Perhaps this is closer to what you want for that line:

sub sock_object { my $self = shift; return $self->{_sock_object} ||= Comm->new( $self->{_serveraddr}, +$self->{_port} ); }

Replies are listed 'Best First'.
Re^2: Strange Compilation Failed in Require Error
by Perllace (Acolyte) on Apr 05, 2011 at 12:11 UTC
    Thanks for that..Using Strict and Warnings helped me remove some errors. Howvere, I'm still getting the Compilation failed in require error in use Device.pm Some of my questions are: In the code that you sent, what's the operator "|| = " ? In the code, could I add a line
    my $SockObj = $self->sock_object;
    in order to call that particular socket object.
    sub Action1 { my ( $self, $x, $y ) = @_; my $tmp = { 'hash1' => 'Command', 'value1' => $x, 'value2' => $y, 'Device' => $self->{_device} }; $InputRequest = $ComObj->CreateInputString($tmp); my $SockObj = $self->sock_object; $SockObj->WriteInfo($InputRequest); my $Response = $SockObj->ReadData(); $ComObj->TapResponse($Response); }
    Thanks so much.. You're inputs gave me some valid direction.

      Operators can be looked up at perlop. Just search for '||='.