RE: Silly question
Thank you. -Sharad -Original Message- From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED] Sent: Monday, September 22, 2003 10:20 PM To: Gupta, Sharad Cc: [EMAIL PROTECTED] Subject: Re: Silly question On Sep 22, Gupta, Sharad said: > package Foo; > use overload q("") => sub {return shift->{bar}}; > $s = bless{bar=>"hello"}, Foo; > print "$s\n" > >prints "hello". Because you have overloaded "" for objects of class Foo. > package Foo; > use overload q("") => sub {return shift->{bar}}; > $s = bless{bar=>"hello"},Foo; > $wilma = "how r u"; > print "$wilma\n" > >prints "how r u". Because you have overloaded "" for objects of class Foo, but there is no object of class Foo in double quotes. If you want to intercept ALL quoted strings, you'll need to use overload::constant, but that becomes tricky business. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ what does y/// stand for? why, yansliterate of course. [ I'm looking for programming work. If you like my work, let me know. ]
Re: Silly question
On Sep 22, Gupta, Sharad said: > package Foo; > use overload q("") => sub {return shift->{bar}}; > $s = bless{bar=>"hello"}, Foo; > print "$s\n" > >prints "hello". Because you have overloaded "" for objects of class Foo. > package Foo; > use overload q("") => sub {return shift->{bar}}; > $s = bless{bar=>"hello"},Foo; > $wilma = "how r u"; > print "$wilma\n" > >prints "how r u". Because you have overloaded "" for objects of class Foo, but there is no object of class Foo in double quotes. If you want to intercept ALL quoted strings, you'll need to use overload::constant, but that becomes tricky business. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ what does y/// stand for? why, yansliterate of course. [ I'm looking for programming work. If you like my work, let me know. ] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: silly question
On 09 Jul 2003 09:09:34 -0700, [EMAIL PROTECTED] (John Tarn) wrote: >i am still a novice in perl so forgive me for this simple question. >what is socket programming? what do sockets do? is there a site >that can explain them to me? thanks >From a really simple viewpoint, I compare sockets to the concept of "extensions" on the old phone system. When you used to call a pbx system, they would ask, what extension do you want to connect to? A tcp networked computer is similar, it has an IP address (the number), then it has 64000+ extensions(called ports). You can assign programs to "listen to their assigned ports" and do stuff when "packets" (calls) come in. A whole standard has emerged as to what programs are supposeded to listen to what port numbers. http is 80 . https is 443 ..smtp is 25..pop3 is 110..ftp is 21 If you are using linux, look at the file /etc/services. You will see all the ports and what is defined for them. Also check out /etc/inetd.conf or /etc/xinetd.conf. Ports are so important, that some general purpose "port daemons" have been written, to make port programming easier. They are called inetd and xinetd. They handle alot of the socket details, and you can write socket programs to use them, or be independent. Now computer ports are much more complicated than what I described above. There are tcp and udp protocols for each port, and the simplest way to describe sockets is a "filehandle to a port". Just like you open a filehandle to read and write to a file, you open a socket to read and write to a port. Socket programming allows programs to open ports to talk to one another, sometimes the programs can be on the same machine, where sockets are a convenient way to do inter-process communication. Sometimes the programs are on different machines, where it is networking, over the internet for example. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: silly question
On Wed, 2003-07-09 at 10:25, Tim Johnson wrote: > Short answer: > > A socket is a machine address and a TCP port, identifying a particular > application running at a particular address. This allows two-way > communication between machines running a particular application. > > Long answer: > > http://www.faqs.org/rfcs/rfc147.html > at least with unix and its varients..you also have "file sockets". Does not need a inetrnet addr just a file name. If you have ever worked with files using perl...you pretty much already know how to do some basic stuff with internet or unix sockets. HTH, jd > -Original Message- > From: john tarn [mailto:[EMAIL PROTECTED] > Sent: Wednesday, July 09, 2003 9:10 AM > To: [EMAIL PROTECTED] > Subject: silly question > > > i am still a novice in perl so forgive me for this simple question. > what is socket programming? what do sockets do? is there a site > that can explain them to me? thanks > > john > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- jdavis <[EMAIL PROTECTED]> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: silly question
The fact that "you are still a novice in Perl" has nothing to do with socket's notions :) As you will see from defintions sent in previous post sockets are not specifics to Perl you can do "Socket Programming" with any decent programming language (C,Java,PHP,Python etc ..). With Perl, the module IO::Socket is certainly a good place to start. See: http://search.cpan.org/author/JHI/perl-5.8.0/ext/IO/lib/IO/Socket.pm José. -Original Message- From: Tim Johnson [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 6:25 PM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: silly question Short answer: A socket is a machine address and a TCP port, identifying a particular application running at a particular address. This allows two-way communication between machines running a particular application. Long answer: http://www.faqs.org/rfcs/rfc147.html -Original Message- From: john tarn [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 9:10 AM To: [EMAIL PROTECTED] Subject: silly question i am still a novice in perl so forgive me for this simple question. what is socket programming? what do sockets do? is there a site that can explain them to me? thanks john -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] DISCLAIMER "This e-mail and any attachment thereto may contain information which is confidential and/or protected by intellectual property rights and are intended for the sole use of the recipient(s) named above. Any use of the information contained herein (including, but not limited to, total or partial reproduction, communication or distribution in any form) by other persons than the designated recipient(s) is prohibited. If you have received this e-mail in error, please notify the sender either by telephone or by e-mail and delete the material from any computer". Thank you for your cooperation. For further information about Proximus mobile phone services please see our website at http://www.proximus.be or refer to any Proximus agent. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: silly question
I would say the other name of socket programming is network programming. The socket modules will act as a interface to deal with other machines, such as FTP, telnet, smtp, pop, etc. I would recommand Network Programming with Perl, by Addison Weskey, but that's a book, not a site =) - Original Message - From: "john tarn" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 10, 2003 12:09 AM Subject: silly question > i am still a novice in perl so forgive me for this simple question. > what is socket programming? what do sockets do? is there a site > that can explain them to me? thanks > > john > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: silly question
Short answer: A socket is a machine address and a TCP port, identifying a particular application running at a particular address. This allows two-way communication between machines running a particular application. Long answer: http://www.faqs.org/rfcs/rfc147.html -Original Message- From: john tarn [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 9:10 AM To: [EMAIL PROTECTED] Subject: silly question i am still a novice in perl so forgive me for this simple question. what is socket programming? what do sockets do? is there a site that can explain them to me? thanks john -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Silly question
actually it gives you an error :) You misspelled variable! You made a boo...boo I know bad Halloween humor If you set the examples... you don't have to set the rules Royce Wells Unix Systems Engineer let's suppose $variable = "some text"; print "$variable\n"; # prints: some text >> print '$varibale\n'; # prints: $variable\n get it? double quotes interpolate - expands variables and special characters. single quotes do not interpolate - it's all just plain text don't think of them as variables or special characters. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Silly question
.--[ Gajo Csaba wrote (2002/10/31 at 20:19:43) ]-- | | While I'm at silly questions, I guess I could ask this one | too: what is the difference between a " " and a ' '. I have | a book that explains it to me in one sentence, and I don't | understand one word that the author's using (I suck at | English), so could someone explain it to me? An example | would be nice too :) | `- Basically it is to parse, or not to parse. :) If we have a scalar variable called $foo which is defined as: my $foo = 'is really cool.'; And we want to print it out using both methods as such: print "1 -- This $foo\n"; print '2 -- This $foo\n'; Will produce the following: 1 -- This is really cool. 2 -- This $foo\n If you have variables or special characters ( i.e. \n, \t, etc ) in a string enclosed by ""s then they will be replaced with their values. If you have them enclosed in ''s they will be used literally. Hope that helps. - Frank Wiles <[EMAIL PROTECTED]> http://frank.wiles.org - -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Silly question
let's suppose $variable = "some text"; print "$variable\n"; # prints: some text print '$varibale\n'; # prints: $variable\n get it? double quotes interpolate - expands variables and special characters. single quotes do not interpolate - it's all just plain text don't think of them as variables or special characters. > -Original Message- > From: Gajo Csaba [mailto:[EMAIL PROTECTED]] > Sent: Thursday, October 31, 2002 2:20 PM > To: perl-beginners > Subject: Silly question > > > While I'm at silly questions, I guess I could ask this one > too: what is the difference between a " " and a ' '. I have > a book that explains it to me in one sentence, and I don't > understand one word that the author's using (I suck at > English), so could someone explain it to me? An example > would be nice too :) > > Thanx, Csaba > > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > The views and opinions expressed in this email message are the sender's own, and do not necessarily represent the views and opinions of Summit Systems Inc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: silly question
A good forum is the linux forum. Go to www.redhat.com, and join a group in your geographical region. A good forum is [EMAIL PROTECTED] __ William Ampeh (x3939) Federal Reserve Board -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]