By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,852 Members | 1,426 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,852 IT Pros & Developers. It's quick & easy.

Perl function vec and select-- help needed

P: 3
Hi all,

I am studying network programming using Perl, while going through examples I found below 2 functions.
I tried to understand myself what these below functions does except socket, bind, connect, send and recv by reading perl documentation but failed to do... Still I don't know why they are used.

Expand|Select|Wrap|Line Numbers
  1. my $rin = $win = $ein = '';
  2. vec($rin, fileno(serv_sock), 1) = 1;
  3. my $nfound = select($rout=$rin,$wout=$win,$eout=$ein,2.0);
  4. if($nfound >= 0)
  5. {
  6.     do send...
  7. }
I blindly tried implementation and running availed examples from Internet but failed.. nfound always returns 0;'
Please help me in this regards...

Thanks...
Jan 26 '08 #1
Share this Question
Share on Google+
1 Reply


eWish
Expert 100+
P: 971
What is you desired goal? You might be better using a module like IO::Socket or possibly another module depending on your goal. If it just a learning experience then go to perldoc.perl.org and search for IO. There should be some helpful information there for you.

--Kevin
Jan 26 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.