473,385 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Perl function vec and select-- help needed

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
1 1747
eWish
971 Expert 512MB
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

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

Similar topics

1
by: sam | last post by:
I have a function writen in Perl that takes a name-value list (array) as argument and returns a name-value list (array). My question is: How to call this function from PHP and get the returned...
3
by: Alfred von Campe | last post by:
I would think this is simple to do, but I just can't figure it out this morning. Assume I have a function in Perl which writes some output to STDOUT. I want to call this function from a Perl...
0
by: Ferindo Middleton Jr | last post by:
I am trying to write a Perl Function for one of the databases I'm building a web application for. This function is triggered to occur BEFORE INSERT OR UPDATE. This function is complex in that it...
4
by: Christopher Murtagh | last post by:
Greetings, Thanks to a lot of help on this list, I've managed to get my pl/perl function working. However, I have an unexpected result. Here's a simple way to reproduce this problem: CREATE...
3
by: Widge | last post by:
I've got a listbox which is pulling up: Merchant Merchant Code Description Price and what I would like to do is have a textbox drive what the listbox is displaying. Basically I can get the...
4
by: achiganmi | last post by:
hi all... i need to write a perl program which does the following: it connects to the database and retrieves the rows from a table, which i am able to do. For example, the table looks like...
10
by: kj | last post by:
Hi. I'd like to port a Perl function that does something I don't know how to do in Python. (In fact, it may even be something that is distinctly un-Pythonic!) The original Perl function takes...
1
by: Sep410 | last post by:
Hi All, I am looking for date validation function in vb.net. The format that I need is MM/DD/YYYY. I am looking for simple way to do that. Please help me.
5
by: needchelp | last post by:
Hi, I'm very new to C and need help with what I'm doing wrong here and why this piece of code doesn't work (the total column prints rubbish): /* Total 2 arrays into a 3rd array in a function and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.