[28953] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 197 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 6 06:09:42 2007

Date: Tue, 6 Mar 2007 03:09:05 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 6 Mar 2007     Volume: 11 Number: 197

Today's topics:
    Re: Alan J. Flavell RIP <bik.mido@tiscalinet.it>
    Re: FAQ 6.21 What's wrong with using grep in a void con <bik.mido@tiscalinet.it>
    Re: FAQ 6.21 What's wrong with using grep in a void con <bik.mido@tiscalinet.it>
        IPC::Open2 - Bad File Descriptor <cbkihong@hotmail.com>
    Re: IPC::Open2 - Bad File Descriptor <ben@morrow.me.uk>
    Re: Is it ok to change $ENV{'QUERY_STRING'} before "use <ben@morrow.me.uk>
        Net-SSH-W32Perl strange behaviour. fhornain@gmail.com
    Re: Net-SSH-W32Perl strange behaviour. fhornain@gmail.com
        Posting Guidelines for comp.lang.perl.misc ($Revision:  tadmc@augustmail.com
    Re: Question about wizard Perl programmers <wahab-mail@gmx.de>
    Re: Question about wizard Perl programmers <bik.mido@tiscalinet.it>
    Re: Question about wizard Perl programmers <bik.mido@tiscalinet.it>
    Re: Question about wizard Perl programmers <bik.mido@tiscalinet.it>
    Re: Question about wizard Perl programmers <bik.mido@tiscalinet.it>
    Re: Question about wizard Perl programmers <bik.mido@tiscalinet.it>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 06 Mar 2007 11:31:23 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Alan J. Flavell RIP
Message-Id: <jigqu2h1vn8j9t4jo60gmkss08qqivglsj@4ax.com>

On Wed, 28 Feb 2007 10:49:29 +0000, Ben Morrow <ben@morrow.me.uk>
wrote:

>In the all-too-short time I knew Alan here in clpmisc, he was
>invariably kind, courteous, knowledgeable and helpful.
>
>He will be sorely missed.

I second that. I remember how precise and extremely confident he
always was with complex intricacies regarding encodings and charsets
and network protocols in general. Oh, and always gentle with quite
about everybody, even when someone would get on someone else's
nerves...


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: Tue, 06 Mar 2007 10:22:16 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: FAQ 6.21 What's wrong with using grep in a void context?
Message-Id: <e3cqu2pq3rmg9g9d297ngontl6mk14lah8@4ax.com>

On Fri, 02 Mar 2007 14:49:28 -0500, Uri Guttman <uri@stemsystems.com>
wrote:

>map can emulate grep). grep is meant to filter an input list and map is
>meant to generate a list from a list. those are not the same semantics
>and it is good to have both funcs.

Both are meant to generate a list from a list. And both are meant to
"filter" an input list. map()'s filtering action consists in applying
a common transformation to all elements of the input list, while
grep()'s one in selecting only those elements that satisfy some
condition and is thus a special case of the former of the form

  my @grepped =  map { condition($_) ? $_ : () } @input;

>grep in void context is totally meaningless. even worse IMO than map in
>void context. neither should be used to modify the input list.

In fact, the only reason I may have to do so would be to abuse them
for a C<for>, which would only possibly happen to be convenient in
golf. And there map() would win!  ;-)

>perl -le '@a = qw( aba baa ) ; print map { s/a/z/g } @a'
>22
>
>s/// doesn't return the modified string. you need to use:

Hehe, no .subst() yet!


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: Tue, 06 Mar 2007 10:27:53 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: FAQ 6.21 What's wrong with using grep in a void context?
Message-Id: <4pcqu212lhv1iklvm5lhsqgqe0vj5ss0hm@4ax.com>

On 1 Mar 2007 14:44:08 -0800, "h3xx" <amphetamachine@gmail.com> wrote:

>OK, enough complaining. I guess the reason using grep is wasteful in a
>void context is that it's meant to get all the lines matching an
                                                ^^^^^

No, *items*:

  my @scalars = grep ref eq 'SCALAR' => \1, [], \2, {};

>expression (or a block of code that evaluates true [read: non-zero]
                                                     ^^^^^^^^^^^^^^

No, read: *true*.


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: Tue, 06 Mar 2007 16:22:20 +0800
From: Bernard Chan <cbkihong@hotmail.com>
Subject: IPC::Open2 - Bad File Descriptor
Message-Id: <pan.2007.03.06.08.20.31.747706@hotmail.com>


Dear All,

I am pretty new to the area of pipes and IPC in general. I'm currently
experimenting with it in different ways trying to understand how it works.

I tried the following simple command:

$ LANG=C perl -MIPC::Open2 -e 'open2(">&1", "<&0", "ls", "-l",
"/dev/shm")' 
total 4
-rw-rw-r-- 1 bernardchan bernardchan 3204 Mar  6 16:00 test.txt 
open2: close(0) failed: Bad file descriptor at -e line 1


As you can see, what I would like to do is simple: to run an "ls -l" and
pipe the output directly to STDOUT and have any input (of course none for
this case of "ls") read from STDIN. I can get back the desired output, but
I also receive the error that open2() cannot close the read filehandle.

This is actually a simplified version - my original version used a socket
(IO::Socket::INET6) in place of STDIN and STDOUT. The problem was similar.

Anyone has some insights about what I am doing wrong?

TIA.

Regards,
Bernard Chan.

-- 
Posted via a free Usenet account from http://www.teranews.com



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

Date: Tue, 6 Mar 2007 10:18:03 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: IPC::Open2 - Bad File Descriptor
Message-Id: <rnrvb4-kjd.ln1@osiris.mauzo.dyndns.org>


Quoth Bernard Chan <cbkihong@hotmail.com>:
> 
> Dear All,
> 
> I am pretty new to the area of pipes and IPC in general. I'm currently
> experimenting with it in different ways trying to understand how it works.
> 
> I tried the following simple command:
> 
> $ LANG=C perl -MIPC::Open2 -e 'open2(">&1", "<&0", "ls", "-l",
> "/dev/shm")' 
> total 4
> -rw-rw-r-- 1 bernardchan bernardchan 3204 Mar  6 16:00 test.txt 
> open2: close(0) failed: Bad file descriptor at -e line 1
> 
> 
> As you can see, what I would like to do is simple: to run an "ls -l" and
> pipe the output directly to STDOUT and have any input (of course none for
> this case of "ls") read from STDIN. I can get back the desired output, but
> I also receive the error that open2() cannot close the read filehandle.
> 
> This is actually a simplified version - my original version used a socket
> (IO::Socket::INET6) in place of STDIN and STDOUT. The problem was similar.
> 
> Anyone has some insights about what I am doing wrong?

The correct syntax is

    open2('>&STDOUT', '<&STDIN', 'ls', '-l', '/dev/shm');

You are getting that error because open2 is attempting to use the
filehandle called '0' (as opposed to fd 0): as this filehandle isn't
open, you get 'bad file descriptor'. The redirection happens to work
because open2 uses the '<&FILEHANDLE' open syntax internally, which
treats numbers as fds rather than filehandles.

You may find IPC::Run easier to work with, not least because open2 seems
to require you to use bareword filehandles, which are not considered
good practice nowadays. (Is it even possible to create a bareword
filehandle to a socket, except by using the raw socket function?)

Ben

-- 
        I must not fear. Fear is the mind-killer. I will face my fear and
        I will let it pass through me. When the fear is gone there will be 
        nothing. Only I will remain.
ben@morrow.me.uk                                          Frank Herbert, 'Dune'


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

Date: Tue, 6 Mar 2007 08:06:24 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Is it ok to change $ENV{'QUERY_STRING'} before "use CGI;" is called..?
Message-Id: <01kvb4-pnc.ln1@osiris.mauzo.dyndns.org>


Quoth "Raymundo" <gypark@gmail.com>:
> 
> Ben, would you please tell me why Encode::Guess isn't safe? Does it
> have a security problem?

Not security, per se; it's just that it's impossible to reliably
distinguish between (say) UTF-8 and ISO8859-1 that just happens to look
like UTF-8.

> > For a (detailed) explanation of details of I18N form submission, see
> > http://xrl.us/u68e. Executive summary: serve forms as 'text/html;
> > charset=utf-8' and assume the results are in UTF-8.

Also, if you read the page linked, you will see that many browsers do...
rather stupid things when the user enters text into a form that is not
representable in the encoding of the page. Since UTF-8 can represent
everything, it doesn't have that problem.

> The script does so when it prints forms and receives POST data from
> the forms, which seemed to be doing well.
> 
> The problem is related to GET request, that is, when URL includes
> multi-bytes characters. W3C recommends that multi-bytes chars in URL
> should be %-encoded. (http://www.w3.org/TR/REC-html40/interact/
> forms.html#form-content-type) But I still want to support when
> visitors type URL using their fingers (they would not like to type "%EC
> %90.." :-) and when other webpage gives a link to my page not using %-
> encoded string.

Well... a not-url-encoded URL is invalid. At least Firefox appears to
automatically translate (say) a URL typed into the address bar into its
correct URL-escaped form before submitting it to the server; I don't
know what IE or Konq/Safari or Opera do.

> Returing to my first post in this thread... Is it so bad idea to
> change the environment variable QUERY_STRING? It solves every problem
> about this. It requires only one additional line in code. I think that
> change may affect only the script and its child processes, and the
> script doesn't fork any child process.

If you're using CGI.pm to process QUERY_STRING, then you should stick to
that. Messing about is just asking for trouble. What is the problem with
decoding the submitted values afterwards? (It can still be one line or
so of code, if you do it right. See Anno's example.)

Ben

-- 
        I must not fear. Fear is the mind-killer. I will face my fear and
        I will let it pass through me. When the fear is gone there will be 
        nothing. Only I will remain.
ben@morrow.me.uk                                          Frank Herbert, 'Dune'


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

Date: 6 Mar 2007 00:54:56 -0800
From: fhornain@gmail.com
Subject: Net-SSH-W32Perl strange behaviour.
Message-Id: <1173171296.209051.155770@p10g2000cwp.googlegroups.com>

Hi,

Well, I am currently stuck with a stange Perl behaviour.
Indeed, I am trying to create a Perl SSH client script on Windows -
but you have already noticed that in the title of this message :) -
which could be connected on a Vandyke Vshell - SSH deamon for Ms
Windows -.

This is the content of my script I have mostly retreived from the CPAN
web site - http://search.cpan.org/~scotts/Net-SSH-W32Perl-0.05/lib/Net/SSH/W32Perl.pm
- :

     use strict;
     use warnings;
     use Net::SSH::W32Perl;

     &windows();

     sub windows ()
     {
           my ($user,$pass,$host,$cmd)
=("MY_USER","MY_PASSWORD","MY_MACHINE_ADDRESS","MY_NICE _COMMAND");
           my $ssh = Net::SSH::W32Perl->new($host,protocole =>2, debug
=> 0);
           $ssh->login($user, $pass);
           my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
           print "Standard out: $stdout\nStandard Error: $stderr\nExit
code: $exit\n";
     }

The problem is firstly it returns the following messages :

    IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
    IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
    IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
    IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
    IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
    IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
    IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
    IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
    IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
    IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
    IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
    IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
    IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
    IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
    IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
    IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 118
    IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
    IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
    IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
    IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110

Ok, I agree despite this message it return the correct result.
Well, sometime ! - I am going to explain below -

In fact, it returns the correct result only the first or the second
time you launch it.
Otherwise, it freezes.
Behaviour that I do not really want. ;)

So, this is the ouput of this program during its execution but in
debug mode :

    machinename: Reading configuration data /.ssh/config
    machinename: Reading configuration data /etc/ssh_config
    machinename: Connecting to localhost, port 22.
    machinename: Socket created, turning on blocking...
    machinename: Remote protocol version 2.0, remote software version
VShell_2_6_4_4
8 VShell
    machinename: Net::SSH::Perl Version 1.23_01, protocol version 2.0.
    machinename: No compat match: VShell_2_6_4_448 VShell
    machinename: Connection established.
    machinename: Sent key-exchange init (KEXINIT), wait response.
    machinename: Algorithms, c->s: 3des-cbc hmac-sha1 none
    machinename: Algorithms, s->c: 3des-cbc hmac-sha1 none
    machinename: Entering Diffie-Hellman Group 1 key exchange.
    machinename: Sent DH public key, waiting for reply.
    machinename: Received host key, type 'ssh-dss'.
    machinename: Host 'localhost' is known and matches the host key.
    machinename: Computing shared secret key.
    machinename: Verifying server signature.
    machinename: Waiting for NEWKEYS message.
    machinename: Enabling incoming encryption/MAC/compression.
    machinename: Send NEWKEYS, enable outgoing encryption/MAC/
compression.
    machinename: Sending request for user-authentication service.
    machinename: Service accepted: ssh-userauth.
    machinename: Trying empty user-authentication request.
    machinename: Authentication methods that can continue: password.
    machinename: Next method to try is password.
    machinename: Trying password authentication.
    machinename: Login completed, opening dummy shell channel.
    machinename: channel 0: new [client-session]
    machinename: Requesting channel_open for channel 0.
    machinename: channel 0: open confirm rwindow 32768 rmax 16384
    machinename: Got channel open confirmation, requesting shell.
    machinename: Requesting service shell on channel 0.
    machinename: channel 1: new [client-session]
    machinename: Requesting channel_open for channel 1.
    machinename: Entering interactive session.
    IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
    machinename: Sending command: cluster localhost group /status
    machinename: Requesting service exec on channel 1.
    machinename: channel 1: open confirm rwindow 32768 rmax 16384
    IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
    IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
    IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
    IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
    IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
    IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
    IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
    IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
    IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
    IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
    IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
    IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
    IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
    IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
    IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 118
    IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
    IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110

Now, cherry on the cake!
I have tried to do the same test with an OpenSSH deamon - for the
server side, I mean -.
Ok, I always have the error message :

    IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
    IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
    BlaBla...

But in contrary of Vshell the Perl SSH client script does not seem
stuck.
it runs every time.

This what I have noticed :
With Vandyke VShell, the script uses

    machinename: channel 0: open confirm rwindow 32768 rmax 16384

However with OpenSSH, the script uses :

    machinename: channel 1: open confirm rwindow 0 rmax 32768


So I have got five questions :


     - How can I make my little Perl SSH Client script work ?
     - How can I fix error message during the Perl script execution ?
     - Why there is difference between Vshell and OpenSsh with the SSH
packet window size ?
     - Is there a way to specify the SSH packet window size in Perl?
     - Could you give me a hand please ?

Thanks a lot in advance.
BR
Fred



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

Date: 6 Mar 2007 00:59:58 -0800
From: fhornain@gmail.com
Subject: Re: Net-SSH-W32Perl strange behaviour.
Message-Id: <1173171598.367239.151950@n33g2000cwc.googlegroups.com>

Hi again,

I think that I forgot two important information.

Well, I use active perl and Net-SSH-W32Perl modules comming from
http://www.soulcage.net/PPDS.58/.

And yes, I have still got one little questions.

    - Knowing that I can not use public key, do you know another mean
in perl to access SSH Server on Windows platform ?

Thanks in advance for your help.
BR
Fred





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

Date: 06 Mar 2007 08:10:27 GMT
From: tadmc@augustmail.com
Subject: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.7 $)
Message-Id: <45ed21f2$0$3163$ae4e5890@news.nationwide.net>

Outline
   Before posting to comp.lang.perl.misc
      Must
       - Check the Perl Frequently Asked Questions (FAQ)
       - Check the other standard Perl docs (*.pod)
      Really Really Should
       - Lurk for a while before posting
       - Search a Usenet archive
      If You Like
       - Check Other Resources
   Posting to comp.lang.perl.misc
      Is there a better place to ask your question?
       - Question should be about Perl, not about the application area
      How to participate (post) in the clpmisc community
       - Carefully choose the contents of your Subject header
       - Use an effective followup style
       - Speak Perl rather than English, when possible
       - Ask perl to help you
       - Do not re-type Perl code
       - Provide enough information
       - Do not provide too much information
       - Do not post binaries, HTML, or MIME
      Social faux pas to avoid
       - Asking a Frequently Asked Question
       - Asking a question easily answered by a cursory doc search
       - Asking for emailed answers
       - Beware of saying "doesn't work"
       - Sending a "stealth" Cc copy
      Be extra cautious when you get upset
       - Count to ten before composing a followup when you are upset
       - Count to ten after composing and before posting when you are upset
-----------------------------------------------------------------

Posting Guidelines for comp.lang.perl.misc ($Revision: 1.7 $)
    This newsgroup, commonly called clpmisc, is a technical newsgroup
    intended to be used for discussion of Perl related issues (except job
    postings), whether it be comments or questions.

    As you would expect, clpmisc discussions are usually very technical in
    nature and there are conventions for conduct in technical newsgroups
    going somewhat beyond those in non-technical newsgroups.

    The article at:

        http://www.catb.org/~esr/faqs/smart-questions.html

    describes how to get answers from technical people in general.

    This article describes things that you should, and should not, do to
    increase your chances of getting an answer to your Perl question. It is
    available in POD, HTML and plain text formats at:

     http://www.augustmail.com/~tadmc/clpmisc.shtml

    For more information about netiquette in general, see the "Netiquette
    Guidelines" at:

     http://andrew2.andrew.cmu.edu/rfc/rfc1855.html

    A note to newsgroup "regulars":

       Do not use these guidelines as a "license to flame" or other
       meanness. It is possible that a poster is unaware of things
       discussed here.  Give them the benefit of the doubt, and just
       help them learn how to post, rather than assume that they do 
       know and are being the "bad kind" of Lazy.

    A note about technical terms used here:

       In this document, we use words like "must" and "should" as
       they're used in technical conversation (such as you will
       encounter in this newsgroup). When we say that you *must* do
       something, we mean that if you don't do that something, then
       it's unlikely that you will benefit much from this group.
       We're not bossing you around; we're making the point without
       lots of words.

    Do *NOT* send email to the maintainer of these guidelines. It will be
    discarded unread. The guidelines belong to the newsgroup so all
    discussion should appear in the newsgroup. I am just the secretary that
    writes down the consensus of the group.

Before posting to comp.lang.perl.misc
  Must
    This section describes things that you *must* do before posting to
    clpmisc, in order to maximize your chances of getting meaningful replies
    to your inquiry and to avoid getting flamed for being lazy and trying to
    have others do your work.

    The perl distribution includes documentation that is copied to your hard
    drive when you install perl. Also installed is a program for looking
    things up in that (and other) documentation named 'perldoc'.

    You should either find out where the docs got installed on your system,
    or use perldoc to find them for you. Type "perldoc perldoc" to learn how
    to use perldoc itself. Type "perldoc perl" to start reading Perl's
    standard documentation.

    Check the Perl Frequently Asked Questions (FAQ)
        Checking the FAQ before posting is required in Big 8 newsgroups in
        general, there is nothing clpmisc-specific about this requirement.
        You are expected to do this in nearly all newsgroups.

        You can use the "-q" switch with perldoc to do a word search of the
        questions in the Perl FAQs.

    Check the other standard Perl docs (*.pod)
        The perl distribution comes with much more documentation than is
        available for most other newsgroups, so in clpmisc you should also
        see if you can find an answer in the other (non-FAQ) standard docs
        before posting.

    It is *not* required, or even expected, that you actually *read* all of
    Perl's standard docs, only that you spend a few minutes searching them
    before posting.

    Try doing a word-search in the standard docs for some words/phrases
    taken from your problem statement or from your very carefully worded
    "Subject:" header.

  Really Really Should
    This section describes things that you *really should* do before posting
    to clpmisc.

    Lurk for a while before posting
        This is very important and expected in all newsgroups. Lurking means
        to monitor a newsgroup for a period to become familiar with local
        customs. Each newsgroup has specific customs and rituals. Knowing
        these before you participate will help avoid embarrassing social
        situations. Consider yourself to be a foreigner at first!

    Search a Usenet archive
        There are tens of thousands of Perl programmers. It is very likely
        that your question has already been asked (and answered). See if you
        can find where it has already been answered.

        One such searchable archive is:

         http://groups.google.com/advanced_group_search

  If You Like
    This section describes things that you *can* do before posting to
    clpmisc.

    Check Other Resources
        You may want to check in books or on web sites to see if you can
        find the answer to your question.

        But you need to consider the source of such information: there are a
        lot of very poor Perl books and web sites, and several good ones
        too, of course.

Posting to comp.lang.perl.misc
    There can be 200 messages in clpmisc in a single day. Nobody is going to
    read every article. They must decide somehow which articles they are
    going to read, and which they will skip.

    Your post is in competition with 199 other posts. You need to "win"
    before a person who can help you will even read your question.

    These sections describe how you can help keep your article from being
    one of the "skipped" ones.

  Is there a better place to ask your question?
    Question should be about Perl, not about the application area
        It can be difficult to separate out where your problem really is,
        but you should make a conscious effort to post to the most
        applicable newsgroup. That is, after all, where you are the most
        likely to find the people who know how to answer your question.

        Being able to "partition" a problem is an essential skill for
        effectively troubleshooting programming problems. If you don't get
        that right, you end up looking for answers in the wrong places.

        It should be understood that you may not know that the root of your
        problem is not Perl-related (the two most frequent ones are CGI and
        Operating System related), so off-topic postings will happen from
        time to time. Be gracious when someone helps you find a better place
        to ask your question by pointing you to a more applicable newsgroup.

  How to participate (post) in the clpmisc community
    Carefully choose the contents of your Subject header
        You have 40 precious characters of Subject to win out and be one of
        the posts that gets read. Don't waste them. Take care while
        composing them, they are the key that opens the door to getting an
        answer.

        Spend them indicating what aspect of Perl others will find if they
        should decide to read your article.

        Do not spend them indicating "experience level" (guru, newbie...).

        Do not spend them pleading (please read, urgent, help!...).

        Do not spend them on non-Subjects (Perl question, one-word
        Subject...)

        For more information on choosing a Subject see "Choosing Good
        Subject Lines":

         http://www.cpan.org/authors/id/D/DM/DMR/subjects.post

        Part of the beauty of newsgroup dynamics, is that you can contribute
        to the community with your very first post! If your choice of
        Subject leads a fellow Perler to find the thread you are starting,
        then even asking a question helps us all.

    Use an effective followup style
        When composing a followup, quote only enough text to establish the
        context for the comments that you will add. Always indicate who
        wrote the quoted material. Never quote an entire article. Never
        quote a .signature (unless that is what you are commenting on).

        Intersperse your comments *following* each section of quoted text to
        which they relate. Unappreciated followup styles are referred to as
        "top-posting", "Jeopardy" (because the answer comes before the
        question), or "TOFU" (Text Over, Fullquote Under).

        Reversing the chronology of the dialog makes it much harder to
        understand (some folks won't even read it if written in that style).
        For more information on quoting style, see:

         http://web.presby.edu/~nnqadmin/nnq/nquote.html

    Speak Perl rather than English, when possible
        Perl is much more precise than natural language. Saying it in Perl
        instead will avoid misunderstanding your question or problem.

        Do not say: I have variable with "foo\tbar" in it.

        Instead say: I have $var = "foo\tbar", or I have $var = 'foo\tbar',
        or I have $var = <DATA> (and show the data line).

    Ask perl to help you
        You can ask perl itself to help you find common programming mistakes
        by doing two things: enable warnings (perldoc warnings) and enable
        "strict"ures (perldoc strict).

        You should not bother the hundreds/thousands of readers of the
        newsgroup without first seeing if a machine can help you find your
        problem. It is demeaning to be asked to do the work of a machine. It
        will annoy the readers of your article.

        You can look up any of the messages that perl might issue to find
        out what the message means and how to resolve the potential mistake
        (perldoc perldiag). If you would like perl to look them up for you,
        you can put "use diagnostics;" near the top of your program.

    Do not re-type Perl code
        Use copy/paste or your editor's "import" function rather than
        attempting to type in your code. If you make a typo you will get
        followups about your typos instead of about the question you are
        trying to get answered.

    Provide enough information
        If you do the things in this item, you will have an Extremely Good
        chance of getting people to try and help you with your problem!
        These features are a really big bonus toward your question winning
        out over all of the other posts that you are competing with.

        First make a short (less than 20-30 lines) and *complete* program
        that illustrates the problem you are having. People should be able
        to run your program by copy/pasting the code from your article. (You
        will find that doing this step very often reveals your problem
        directly. Leading to an answer much more quickly and reliably than
        posting to Usenet.)

        Describe *precisely* the input to your program. Also provide example
        input data for your program. If you need to show file input, use the
        __DATA__ token (perldata.pod) to provide the file contents inside of
        your Perl program.

        Show the output (including the verbatim text of any messages) of
        your program.

        Describe how you want the output to be different from what you are
        getting.

        If you have no idea at all of how to code up your situation, be sure
        to at least describe the 2 things that you *do* know: input and
        desired output.

    Do not provide too much information
        Do not just post your entire program for debugging. Most especially
        do not post someone *else's* entire program.

    Do not post binaries, HTML, or MIME
        clpmisc is a text only newsgroup. If you have images or binaries
        that explain your question, put them in a publically accessible
        place (like a Web server) and provide a pointer to that location. If
        you include code, cut and paste it directly in the message body.
        Don't attach anything to the message. Don't post vcards or HTML.
        Many people (and even some Usenet servers) will automatically filter
        out such messages. Many people will not be able to easily read your
        post. Plain text is something everyone can read.

  Social faux pas to avoid
    The first two below are symptoms of lots of FAQ asking here in clpmisc.
    It happens so often that folks will assume that it is happening yet
    again. If you have looked but not found, or found but didn't understand
    the docs, say so in your article.

    Asking a Frequently Asked Question
        It should be understood that you may have missed the applicable FAQ
        when you checked, which is not a big deal. But if the Frequently
        Asked Question is worded similar to your question, folks will assume
        that you did not look at all. Don't become indignant at pointers to
        the FAQ, particularly if it solves your problem.

    Asking a question easily answered by a cursory doc search
        If folks think you have not even tried the obvious step of reading
        the docs applicable to your problem, they are likely to become
        annoyed.

        If you are flamed for not checking when you *did* check, then just
        shrug it off (and take the answer that you got).

    Asking for emailed answers
        Emailed answers benefit one person. Posted answers benefit the
        entire community. If folks can take the time to answer your
        question, then you can take the time to go get the answer in the
        same place where you asked the question.

        It is OK to ask for a *copy* of the answer to be emailed, but many
        will ignore such requests anyway. If you munge your address, you
        should never expect (or ask) to get email in response to a Usenet
        post.

        Ask the question here, get the answer here (maybe).

    Beware of saying "doesn't work"
        This is a "red flag" phrase. If you find yourself writing that,
        pause and see if you can't describe what is not working without
        saying "doesn't work". That is, describe how it is not what you
        want.

    Sending a "stealth" Cc copy
        A "stealth Cc" is when you both email and post a reply without
        indicating *in the body* that you are doing so.

  Be extra cautious when you get upset
    Count to ten before composing a followup when you are upset
        This is recommended in all Usenet newsgroups. Here in clpmisc, most
        flaming sub-threads are not about any feature of Perl at all! They
        are most often for what was seen as a breach of netiquette. If you
        have lurked for a bit, then you will know what is expected and won't
        make such posts in the first place.

        But if you get upset, wait a while before writing your followup. I
        recommend waiting at least 30 minutes.

    Count to ten after composing and before posting when you are upset
        After you have written your followup, wait *another* 30 minutes
        before committing yourself by posting it. You cannot take it back
        once it has been said.

AUTHOR
    Tad McClellan <tadmc@augustmail.com> and many others on the
    comp.lang.perl.misc newsgroup.



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

Date: Tue, 06 Mar 2007 09:37:09 +0100
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: Re: Question about wizard Perl programmers
Message-Id: <esj9i5$fm2$1@mlucom4.urz.uni-halle.de>

Ayaz Ahmed Khan wrote:
> "De Vliegende Hollander" typed:
>> The sentient life form Ayaz Ahmed Khan posted the following:
>>> [Perl/Python]
>> But it's not nearly as powerful as Perl...
> 
> That is pretty subjective: what makes a language powerful?

IMHO, succinct idioms of 'accepted powerfulness'.

Furthermore, the ability of chaining idioms
into 'super idioms' and allowing for forms
one can remember with ease.

If that's what was meant: 'expressional powerfulness'.

Of the three more or less widely used 'P'-languages,
in my personal and subjective view, the one P smells
like "Windows System", the other one like "Macintosh
System", whereas the third is "Unix system".

(I use all three of them, but mostly stick to the
'unix-flavor' if possible - and don't want to throw
flames).


Regards

Mirco


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

Date: Tue, 06 Mar 2007 11:40:44 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Question about wizard Perl programmers
Message-Id: <hsgqu2l2q0ovq2o19tkj7lst7lak3pfjab@4ax.com>

On 4 Mar 2007 20:12:11 -0800, "LovesHisLittleShad" <jgrace5@gmail.com>
wrote:

>Is it my imagination, or is Perl a million times harder than other
>languages?  Looking at books on all the languages of the past (I'm a

No, it's harder than some, in some respects. And it's easier than
other ones, in some other respects.

>programmer), I've notices that Perl is the only one that seems greek
>in most chapters, with very little explanation of what the people are
>doing.

FUD. Perl can be quite readable. And quite unreadable. It depends on
the programmer's will. It just doesn't get in your way forcing you to
program in some particular way.

>Am I wrong, or does the Perl language literally attract the wizards of
>the world to it, more than other languages?  Consider the following
>code someone wrote that I found on a web site:
[snip obfu]

This is a famous punctuation-less JAPH. For the record, there are
punctuation only ones available. Whatever, that's obfu, i.e., a game.
Reading your comment, I wonder whether I was wrong in

http://perlmonks.org/?node_id=602997

(I'm blazar there.)


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: Tue, 06 Mar 2007 11:45:02 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Question about wizard Perl programmers
Message-Id: <5ehqu299gtron25bragt5v9poin3f7me61@4ax.com>

On Sun, 04 Mar 2007 23:30:48 -0500, Uri Guttman <uri@stemsystems.com>
wrote:

>i won't run it. but you can run it through a deparser and it will be

Not necessarily: here follows the output from B::Deparse,

: print ' ' and eval " undef or oct xor\ntime xor ref print chr int ord lc\nforeac
: h qw y hex alarm chdir kill\nexec return y " gt sin sort(split(" ", $_, 0)) unle
: ss not exp log srand xor s// /x xor s/ / length uc ord and print chr\nord for qw
:  q join use sub tied q/ xor eval $_ xor print ' ' xor int eval " cos and print c
: hr ord\nfor qw y abs ne open tied hex exp\nref y " xor scalar srand print(' ') x
: or int eval " sqrt cos\nand print chr ord for qw x printf\neach return local x "
: ;


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: Tue, 06 Mar 2007 11:49:59 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Question about wizard Perl programmers
Message-Id: <imhqu2djrrlk5qboqkdeu81lef4n93fk0i@4ax.com>

On Mon, 5 Mar 2007 09:08:32 +0100, "Marco Neumann"
<krotowitz@yahoo.com> wrote:

>Why it does this, is beyond me.

  perldoc -q japh

Funny remark:

: You're using rational arguments against irrational behavior. It doesn't matter. I'm telling you what the irrational behavior is. People who should know better disproportionally point at Golf and Obfu. That's the sad reality. I'm not saying that if all Golf and Obfu were eliminated, people would flock to Perl in the masses, but they're by far the leading candidates for discrediting Perl. It makes my job very hard.
: 
: And this is a bit ironic, since I invented the JAPH, so I've effectively created my own worst enemy here. {grin}
: 
: -- Randal L. Schwartz, Perl hacker 

(from <http://perlmonks.org/?node_id=603084>.)


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: Tue, 06 Mar 2007 11:55:38 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Question about wizard Perl programmers
Message-Id: <e3iqu29ldl2p1ilmt0r36ugpspg2v7hnib@4ax.com>

On Mon, 05 Mar 2007 11:00:28 +0200, Alex <check.sig@for.email.invalid>
wrote:

>It compiles and runs. Does this make Java a very difficult language? (It
>simply prints "Hi!", in case you're interested.)

Not to mention widely known C stuff, from a friend of mine's .sig:

  char code[] =
  "\xeb\x19\x31\xc0\x31\xdb\x31\xc9\x31\xd2\xb0"
  "\x04\xb3\x01\x59\xb2\x03\xcd\x80\x31\xc0\x31"
  "\xdb\xb0\x01\xcd\x80\xe8\xe2\xff\xff\xffG.\n"
  ;


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: Tue, 06 Mar 2007 12:00:26 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Question about wizard Perl programmers
Message-Id: <4biqu2lctf5ln282q5v3q9uok4kld3v2r7@4ax.com>

On Mon, 05 Mar 2007 10:33:51 +0100, Mirco Wahab <wahab-mail@gmx.de>
wrote:

>> Who are these people?
>
>These people are artists, and they
>are dead serious in giving boring
>daily stuff an appearance that
>transcends it to the extreme in
>'having no more profane use' ...

They are, and moreover contrary to what one may naively expect, golf
and obfu players are generally perfectly able to write sane and
readable code too, when it matters, e.g. in "production", whatever
that means.


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: 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 V11 Issue 197
**************************************


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