in reply to read binary datas

I would guess (not knowing your protocol) that between the line my $cmd="MYGET\n"; and the line  while(<$sock>) { print } you probably meant to say print $sock $cmd;. Otherwise your $cmd isn't doing you any good.

Also, please observe the Writeup Formatting Tips when posting to PerlMonks, including the use of <code> tags.