[28218] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 9582 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 9 14:10:14 2006

Date: Wed, 9 Aug 2006 11:10:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 9 Aug 2006     Volume: 10 Number: 9582

Today's topics:
    Re: perl editor <bik.mido@tiscalinet.it>
    Re: perl editor <1usa@llenroc.ude.invalid>
    Re: perl editor <glennj@ncf.ca>
    Re: Question about Arrays <guenther.sohler@wipro.com>
    Re: Question about Arrays <uri@stemsystems.com>
        Read socket using both <> and sysread() <ynleder@nspark.org>
    Re: Read socket using both <> and sysread() <uri@stemsystems.com>
    Re: Read socket using both <> and sysread() xhoster@gmail.com
    Re: What bless() do actually? <bik.mido@tiscalinet.it>
    Re: What bless() do actually? <jimi@webu.co.uk>
    Re: What bless() do actually? <bik.mido@tiscalinet.it>
    Re: What bless() do actually? <jimi@webu.co.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 9 Aug 2006 12:25:56 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: perl editor
Message-Id: <gtdjd2tqc6kq2nc5cv7ubv8v5j495rqhck@4ax.com>

On 9 Aug 2006 01:52:23 -0700, "Ronny" <ro.naldfi.scher@gmail.com>
wrote:

>However, Jext recognizes Perl programs only by their
>extension, not due to the #! line, which I consider its
>biggest weakness.

jed, and I suspect also vi* and the various incarnations of emacs,
also recognizes a pattern which one often embeds in a comment (usually
at the top), like thus

  # -*- Perl -*-

I find this feature very useful for modules, although I may set up
another association for '.pm'.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: Wed, 09 Aug 2006 13:15:10 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: perl editor
Message-Id: <Xns981A5E385F705asu1cornelledu@127.0.0.1>

"Ronny" <ro.naldfi.scher@gmail.com> wrote in news:1155113543.024609.83370@
75g2000cwc.googlegroups.com:

>> Look at this: http://www.scintilla.org/SciTE.html
> 
> What I don't like with Scite (but I'm using still version 1.58, so
> correct me if this is wrong with a newer version),

I have version 1.68. It allows me to select and then indent a block of 
text using the tab key. I don't know when this feature was introduced.

> (x)emacs and the *vi* family of editors are for sure powerful,
> but over the time I found their user interface a bit annoying

I use GVim almost exclusiely. I am a wimp. I have only learned a minimal 
set of original vi commands.

I am genuinely scared of emacs ;-)

Sinan
-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html



------------------------------

Date: 9 Aug 2006 13:25:08 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: perl editor
Message-Id: <slrnedjohk.6cv.glennj@smeagol.ncf.ca>

At 2006-08-09 06:25AM, Michele Dondi <bik.mido@tiscalinet.it> wrote:
>  jed, and I suspect also vi* and the various incarnations of emacs,
>  also recognizes a pattern which one often embeds in a comment (usually
>  at the top), like thus
>  
>    # -*- Perl -*-

The vim modeline is:
    # vim: set ft=perl:

See ":help modeline"

-- 
Glenn Jackman
Ulterior Designer


------------------------------

Date: Wed, 09 Aug 2006 14:02:16 +0200
From: Guenther Sohler <guenther.sohler@wipro.com>
Subject: Re: Question about Arrays
Message-Id: <pan.2006.08.09.12.02.16.104562@wipro.com>

Perfect!

Thanks a lot



------------------------------

Date: Wed, 09 Aug 2006 11:40:31 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Question about Arrays
Message-Id: <x7lkpxape8.fsf@mail.sysarch.com>

>>>>> "JM" == Josef Moellers <josef.moellers@fujitsu-siemens.com> writes:


  JM> $database{"fruits"}=["Apple","Pear"];
  JM> # Note the angle brackets making this an anonymous array rather than a
  JM> # list

s/angle/square/ ;

useful nit to pick IMO :)

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


------------------------------

Date: Tue, 8 Aug 2006 13:06:12 +0200
From: Yohan N. Leder <ynleder@nspark.org>
Subject: Read socket using both <> and sysread()
Message-Id: <MPG.1f428e8e79cfda619898ad@news.tiscali.fr>

Hello. In the framework of a dialog with an ESMTP server, I would like 
to alternate some incoming socket reading using <> (when server replies 
with a single line) and sysread() (when server replies with several 
lines), is there something to take care with this kind of alternance ?

Here a piece of typical part (without response codes checking) :

use Socket;
[here code to connect using two sockets : SOCKET_IN and SOCKET_OUT]
select(SOCKET_IN); $| = 1; select(SOCKET_OUT); $| = 1; select(STDOUT);
my $resp = <SOCKET_IN>; # wait server be ready
syswrite(SOCKET_OUT, "EHLO test\cM\cJ", 11); # engage dialog
sysread(SOCKET_IN, $resp, 1024); # fetch a multi-lines response
syswrite(SOCKET_OUT, "AUTH PLAIN\cM\cJ", 11); # engage authentication
$resp = <SOCKET_IN>; # wait server ask for username
[...]


------------------------------

Date: Wed, 09 Aug 2006 11:45:45 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Read socket using both <> and sysread()
Message-Id: <x7hd0lap5i.fsf@mail.sysarch.com>

>>>>> "YNL" == Yohan N Leder <ynleder@nspark.org> writes:

  YNL> Hello. In the framework of a dialog with an ESMTP server, I would like 
  YNL> to alternate some incoming socket reading using <> (when server replies 
  YNL> with a single line) and sysread() (when server replies with several 
  YNL> lines), is there something to take care with this kind of alternance ?

do you know the difference between <> and sysread? the docs or faq
(not sure where ATM) strongly state that you should never mix them on a
single handle unless you are extremely sure of what you are doing. the
problem is that <> uses stdio which will buffer input from the handle
and then return only one line to you. a following sysread won't (or may
not) find any data to read as it was already read into a buffer by
stdio. the best way to do this is to only use sysread and do your own
buffering and then parse out a line from the beginning of the buffer
when you need one. this isn't too hard to do but it does require some
code beyond just a simple sysread call.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


------------------------------

Date: 09 Aug 2006 16:13:44 GMT
From: xhoster@gmail.com
Subject: Re: Read socket using both <> and sysread()
Message-Id: <20060809122307.514$55@newsreader.com>

Yohan N. Leder <ynleder@nspark.org> wrote:
> Hello. In the framework of a dialog with an ESMTP server, I would like
> to alternate some incoming socket reading using <> (when server replies
> with a single line) and sysread() (when server replies with several
> lines), is there something to take care with this kind of alternance ?

Why not just use read() instead of sysread()?

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


------------------------------

Date: 9 Aug 2006 12:41:54 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: What bless() do actually?
Message-Id: <arejd21j94b4m68odaisfqm0u3bpbortik@4ax.com>

On Tue, 08 Aug 2006 14:53:33 GMT, Jimi-Carlo Bukowski-Wills
<jimi@webu.co.uk> wrote:

>But it doesn't alter the fact that a C++ programmer who understands about
>classes and inheritance and all that is gonna get a wee bit confused when
>he realises that he has to implement the "new" keyword himself.  Coming

It's not as much a matter of "implementing the new keyword" as much
one of implementing a constructor, which is something you have to do
in C++ too, with the difference that in the former case it can have
any name and is called like a class method while in the latter by
*means* of the new keyword.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: Wed, 09 Aug 2006 12:27:51 GMT
From: Jimi-Carlo Bukowski-Wills <jimi@webu.co.uk>
Subject: Re: What bless() do actually?
Message-Id: <pan.2006.08.09.12.28.02.683057@webu.co.uk>

[snip]
> It's not as much a matter of "implementing the new keyword" as much
> one of implementing a constructor, which is something you have to do
> in C++ too, 
no!  You don't HAVE to do it in C++... you can make a class without a
constructor.  You can still make a new instance with the new keyword
without having written a constructor.

> with the difference that in the former case it can have
> any name and is called like a class method while in the latter by
> *means* of the new keyword.
> 
> 
> Michele



------------------------------

Date: 9 Aug 2006 15:11:31 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: What bless() do actually?
Message-Id: <glnjd2do31p6pf5l34g1t66bes6be9rt84@4ax.com>

On Wed, 09 Aug 2006 12:27:51 GMT, Jimi-Carlo Bukowski-Wills
<jimi@webu.co.uk> wrote:

>> It's not as much a matter of "implementing the new keyword" as much
>> one of implementing a constructor, which is something you have to do
>> in C++ too, 
>no!  You don't HAVE to do it in C++... you can make a class without a
>constructor.  You can still make a new instance with the new keyword
>without having written a constructor.

Fair enough. The main point still being that it's not as much a matter
of "implementing the new keyword" as much one of implementing a
constructor.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: Wed, 09 Aug 2006 15:52:54 GMT
From: Jimi-Carlo Bukowski-Wills <jimi@webu.co.uk>
Subject: Re: What bless() do actually?
Message-Id: <pan.2006.08.09.15.52.54.794083@webu.co.uk>

[snip]
> Fair enough. The main point still being that it's not as much a matter
> of "implementing the new keyword" as much one of implementing a
> constructor.
> 
> 
> Michele
Yeah... although the main point was really to tell Davy that he shouldn't
expect Perl to be anything like C++ in terms of OO.


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 9582
***************************************


home help back first fref pref prev next nref lref last post