[27210] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9013 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 3 03:05:42 2006

Date: Fri, 3 Mar 2006 00:05: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           Fri, 3 Mar 2006     Volume: 10 Number: 9013

Today's topics:
        CPAN shell: automatic 'yes' answers? <markus.dehmann@gmail.com>
    Re: CPAN shell: automatic 'yes' answers? <thepoet_nospam@arcor.de>
        FAQ 9.17 How do I check a valid mail address? <brian@stonehenge.com>
        Native Cut&Paste on Win* and Mac? <nospam-abuse@ilyaz.org>
    Re: Native Cut&Paste on Win* and Mac? <1usa@llenroc.ude.invalid>
    Re: Native Cut&Paste on Win* and Mac? <nospam-abuse@ilyaz.org>
    Re: Problems after updating Net::SSH:Perl <1usa@llenroc.ude.invalid>
    Re: Remote.pm (File::Remote) problem <tkoedge@comcast.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 03 Mar 2006 01:21:19 -0500
From: Markus Dehmann <markus.dehmann@gmail.com>
Subject: CPAN shell: automatic 'yes' answers?
Message-Id: <46q5j1Fc9685U1@individual.net>

I use the CPAN shell to install a modules:

perl -MCPAN -e shell

But if the module needs a lot of other modules, CPAN asks me

"Do you want to add Date::Calc etc to the download chain? [y]"

and I have to hit enter a thousand times to confirm all the additional 
downloads.

Is there an option to allow these additional modules automatically?

Markus


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

Date: Fri, 03 Mar 2006 07:40:57 +0100
From: Christian Winter <thepoet_nospam@arcor.de>
Subject: Re: CPAN shell: automatic 'yes' answers?
Message-Id: <4407e4f9$0$22074$9b4e6d93@newsread2.arcor-online.net>

Markus Dehmann schrieb:
> I use the CPAN shell to install a modules:
> 
> perl -MCPAN -e shell
> 
> But if the module needs a lot of other modules, CPAN asks me
> 
> "Do you want to add Date::Calc etc to the download chain? [y]"
> 
> and I have to hit enter a thousand times to confirm all the additional 
> downloads.
> 
> Is there an option to allow these additional modules automatically?

Just change the prerequisites policy on the cpan shell by saying
cpan> o conf prerequisites_policy follow

If you want to change it back to prompting you everytime, give "ask"
as configuration value instead of "follow".

-Chris


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

Date: Fri, 3 Mar 2006 00:03:02 -0800
From: PerlFAQ Server <brian@stonehenge.com>
Subject: FAQ 9.17 How do I check a valid mail address?
Message-Id: <mq9ld3-s6j.ln1@blue.stonehenge.com>

This is an excerpt from the latest version perlfaq9.pod, which
comes with the standard Perl distribution. These postings aim to 
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

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

9.17: How do I check a valid mail address?

    You can't, at least, not in real time. Bummer, eh?

    Without sending mail to the address and seeing whether there's a human
    on the other end to answer you, you cannot determine whether a mail
    address is valid. Even if you apply the mail header standard, you can
    have problems, because there are deliverable addresses that aren't
    RFC-822 (the mail header standard) compliant, and addresses that aren't
    deliverable which are compliant.

    You can use the Email::Valid or RFC::RFC822::Address which check the
    format of the address, although they cannot actually tell you if it is a
    deliverable address (i.e. that mail to the address will not bounce).
    Modules like Mail::CheckUser and Mail::EXPN try to interact with the
    domain name system or particular mail servers to learn even more, but
    their methods do not work everywhere---especially for security conscious
    administrators.

    Many are tempted to try to eliminate many frequently-invalid mail
    addresses with a simple regex, such as "/^[\w.-]+\@(?:[\w-]+\.)+\w+$/".
    It's a very bad idea. However, this also throws out many valid ones, and
    says nothing about potential deliverability, so it is not suggested.
    Instead, see
    http://www.cpan.org/authors/Tom_Christiansen/scripts/ckaddr.gz , which
    actually checks against the full RFC spec (except for nested comments),
    looks for addresses you may not wish to accept mail to (say, Bill
    Clinton or your postmaster), and then makes sure that the hostname given
    can be looked up in the DNS MX records. It's not fast, but it works for
    what it tries to do.

    Our best advice for verifying a person's mail address is to have them
    enter their address twice, just as you normally do to change a password.
    This usually weeds out typos. If both versions match, send mail to that
    address with a personal message that looks somewhat like:

        Dear someuser@host.com,

        Please confirm the mail address you gave us Wed May  6 09:38:41
        MDT 1998 by replying to this message.  Include the string
        "Rumpelstiltskin" in that reply, but spelled in reverse; that is,
        start with "Nik...".  Once this is done, your confirmed address will
        be entered into our records.

    If you get the message back and they've followed your directions, you
    can be reasonably assured that it's real.

    A related strategy that's less open to forgery is to give them a PIN
    (personal ID number). Record the address and PIN (best that it be a
    random one) for later processing. In the mail you send, ask them to
    include the PIN in their reply. But if it bounces, or the message is
    included via a "vacation" script, it'll be there anyway. So it's best to
    ask them to mail back a slight alteration of the PIN, such as with the
    characters reversed, one added or subtracted to each digit, etc.



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

The perlfaq-workers, a group of volunteers, maintain the perlfaq. They
are not necessarily experts in every domain where Perl might show up,
so please include as much information as possible and relevant in any
corrections. The perlfaq-workers also don't have access to every operating
system or platform, so please include relevant details for corrections 
to examples that do not work on particular platforms. Working code is
greatly appreciated.

If you'd like to help maintain the perlfaq, see the details in 
perlfaq.pod.
*** Free account sponsored by SecureIX.com ***
*** Encrypt your Internet usage with a free VPN account from http://www.SecureIX.com ***


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

Date: Fri, 3 Mar 2006 01:22:10 +0000 (UTC)
From:  Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Native Cut&Paste on Win* and Mac?
Message-Id: <du85o2$2ulp$1@agate.berkeley.edu>


My current version of Term::ReadLine::Perl (should be on CPAN in a
couple of hours) supports native cut&paste only on OS/2.  If somebody
can very quickly supply patches (or code snippets) which work on Win*
and Mac, there is a good chance of their inclusion into the module.

Here are two samples:

    if ($^O eq 'os2') {
      eval {
        require OS2::Process;
	$in = OS2::Process::ClipbrdText();
	$in =~ s/\r\n/\n/g;		# With old versions, or what?
      }
    } else {

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

    my $in = shift;
    if ($^O eq 'os2') {
      eval {
        require OS2::Process;
	OS2::Process::ClipbrdText_set($in);
	1
      } and return;
    }

Thanks,
Ilya


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

Date: Fri, 03 Mar 2006 02:00:56 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Native Cut&Paste on Win* and Mac?
Message-Id: <Xns977AD5E263A5asu1cornelledu@127.0.0.1>

Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote in news:du85o2$2ulp$1
@agate.berkeley.edu:

> 
> My current version of Term::ReadLine::Perl (should be on CPAN in a
> couple of hours) supports native cut&paste only on OS/2.  If somebody
> can very quickly supply patches (or code snippets) which work on Win*
> and Mac, there is a good chance of their inclusion into the module.
> 
> Here are two samples:
> 
>     if ($^O eq 'os2') {
>       eval {
>         require OS2::Process;
>      $in = OS2::Process::ClipbrdText();
>      $in =~ s/\r\n/\n/g;          # With old versions, or what?
>       }
>     } else {
> 

I was not able to locate the module. But, would something like this 
work?

    if ($^O eq 'MSWin32') {
      eval {
        require Win32::Clipboard;
        $in = Win32::Clipboard::GetText();
        $in =~ s/\r\n/\n/g;  # is this needed?
      }
    } else {

and

> -------------------
> 
>     my $in = shift;
>     if ($^O eq 'os2') {
>       eval {
>         require OS2::Process;
>      OS2::Process::ClipbrdText_set($in);
>      1
>       } and return;
>     }

    my $in = shift;
    if ($^O eq 'MSWin32') {
      eval {
        require Win32::Clipboard;
        Win32::Clipboard::Set($in);
        1
      } and return;
    }

I can patch and test, probably on Monday afternoon.

HTH.

Sinan

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

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



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

Date: Fri, 3 Mar 2006 04:10:10 +0000 (UTC)
From:  Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Native Cut&Paste on Win* and Mac?
Message-Id: <du8fj2$98$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to
A. Sinan Unur
<1usa@llenroc.ude.invalid>], who wrote in article <Xns977AD5E263A5asu1cornelledu@127.0.0.1>:
> I was not able to locate the module. But, would something like this 
> work?

Sorry, I have no way to test on Win32 and Mac.  So what I need is code
which is tested to work (at least to some extent ;-).

Well, I can incorporate the stuff even if only compiles ;-); and I can
test *this*.  Running is an extra (with eval{}, it can't break things
much).  ;-)

Thanks,
Ilya



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

Date: Fri, 03 Mar 2006 00:37:33 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Problems after updating Net::SSH:Perl
Message-Id: <Xns977AC7BF3FD9asu1cornelledu@127.0.0.1>

Martin Kissner <news@chaos-net.de> wrote in 
news:slrne0ejsd.219.news@maki.homeunix.net:

> A. Sinan Unur wrote :
>> Martin Kissner <news@chaos-net.de> wrote in 
>> news:slrne0e5d1.14b.news@maki.homeunix.net:
>>
 ...
>>> Can't locate object method "blocking" via package "IO::Handle" at
>>> /System/Library/Perl/5.8.6/Net/SSH/Perl.pm line 212, <GEN0> line 1.
>>
>> According to:
>>
>> http://search.cpan.org/src/DBROBINS/Net-SSH-Perl-1.29/Changes
>>
>> (by the way, it would have been nice if you had looked this up 
>> yourself):
> 
> Thank you. You are, of course, right.
> I am not too familiar with the cpan archive. Didn't mean to be lazy.

That's OK. Now you know.

>> 1.28  2005.03.17
 ...
>>     - Fix for "Can't locate object method "blocking" via package 
>>       "IO::Handle"" error (rt.cpan.org #11674, Daniel C. Silverstein 
>>       (dans AT pch.net)).
>>
>> So, something between 1.28 and 1.29 reintroduced the bug.
>>
>> You should probably let the author know (after checking if it has 
>> already been reported).
> 
> I wil do so, although I can't imagin this has not been discovered 
>> since 2005.10.08.

It's quite possible that the only people who upgraded to 1.29 were the 
ones who cared fixes in that version, and the "blocking" bug did not 
show up on those systems. Who knows.

Sinan

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

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



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

Date: Thu, 02 Mar 2006 17:12:24 -0800
From: Dayton Jones <tkoedge@comcast.net>
Subject: Re: Remote.pm (File::Remote) problem
Message-Id: <DqKdnaW_o4NlCprZ4p2dnA@comcast.com>

A. Sinan Unur wrote:

> Upon looking at File::Remote again, I noticed that there is another 
> potential bug in File::Remote::_system:
> 
> sub _system {
>    my($self, @cmd) = _self_or_default(@_);
> 
>    # return "Broken pipe" if cmd invalid
>    chomp(my $return = `@cmd 2>&1 1>/dev/null || echo 32`);
>    _debug("_system(@cmd) = $return");
> 
>    if ($return) {
>       # if echo'ed an int (internal tests), use it, 
>       #  else use "Permission denied" (13)
>       $return =~ m/^(\d+)$/;
>       $! = $1 || 13;
> 
> Notice how $! is set without checking if the match above succeeded? That 
> might cause this routine to report an error when there was none if $1 
> had been set earlier.
> 
> Are you sure the file was not copied?
> 
> Another idea is to temporarily enable debugging by setting $DEBUG = 1 
> aorund line 114 of the module:
> 
> # Simple debugging function
> my $DEBUG = 1;
> sub _debug { warn "debug: ", @_ if $DEBUG };
> 
> See what you get in the actual trace.
> 
> 
> Sinan



Well, enabling debug basically looks like it's pointing the finger at 
ssh/scp :

debug: copy -- system(File::Remote=HASH(0x9bd55b4)->setrcp, 
host1:/tmp/file, host1:/tmp/file2) at 
/usr/lib/perl5/site_perl/5.8.5/File/Remote.pm line 115.
debug: _system(/usr/bin/scp host1:/tmp/file host1:/tmp/file2) = Host key 
verification failed.
lost connection
32 at /usr/lib/perl5/site_perl/5.8.5/File/Remote.pm line 115.
host1 :: Permission denied


So even though, as that user I can ssh/scp to host1 with no problems, 
the module can't pass the host verification stage...


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

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 9013
***************************************


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