sub receive { my $self = shift; # Perl OO mantra ... return undef unless ref $self; # .. continued unless (@_) { $self->{ERROR}->set(ILL_NUM); return 0; } my $sock = shift; local $/ = undef; # again the magic unless (defined ($sock->recv ($self->{COMMAND}, $self->{COMMANDSIZE})) && defined ($sock->recv ($self->{CONTENT_LENGTH}, $self->{CONTENTSIZE})) && defined ($sock->recv ($self->{CONTENT}, $self->{CONTENT_LENGTH}))) { $self->{ERROR}->set(SOCK_RECV); return 0; } 1; }