[29730] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 974 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 25 21:09:41 2007

Date: Thu, 25 Oct 2007 18:09:09 -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           Thu, 25 Oct 2007     Volume: 11 Number: 974

Today's topics:
    Re: configurable variables in own file?  ivowel@gmail.com
    Re: control loop for contraction <zaxfuuq@invalid.net>
    Re: Crypt::TripleDES and public/private keys (Alan Curry)
    Re: From "The Camel Book", Ch. 16 (IPC) <ben@morrow.me.uk>
    Re: How to fetch output of some other script in the cur <1usa@llenroc.ude.invalid>
        How to interactively sending the username/password to l  cyrusgreats@gmail.com
    Re: How to interactively sending the username/password  <elvis-85473@notatla.org.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 25 Oct 2007 23:50:24 -0000
From:  ivowel@gmail.com
Subject: Re: configurable variables in own file?
Message-Id: <1193356224.085884.309620@19g2000hsx.googlegroups.com>


thank you everybody.  I also had hidden was that I do want at least
one short sub in the configuration that an enduser should be able to
change.  therefore, layout out the variables to a data file, an
obvious solution, would not work for me.

I am not particularly fond of requiring my more naive users to start
using CPAN.  yes, I love CPAN for my own use, but I don't want them to
get into potential dependency issues.  I want to use only modules that
come with the standard perl distribution.  It is just a personal
choice, that I don't expect anyone else to share.

regards,

/ivo



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

Date: Sun, 25 Nov 2007 16:39:12 -0800
From: "Wade Ward" <zaxfuuq@invalid.net>
Subject: Re: control loop for contraction
Message-Id: <Gu2dnVw0TJeThrzanZ2dnUVZ_oCvnZ2d@comcast.com>




"Joe Smith" <joe@inwap.com> wrote in message 
news:xtGdnUVtp_a2aYPanZ2dnUVZ_sKqnZ2d@comcast.com...
> Wade Ward wrote:
>
>> my $number14 = 42;
>> $number14 = ++ $number14;
>
> Don't attempt to change the value of a variable on both the left and
> the right of an equal sign at the same time.  Use just one of these three:
>
>   $number14 = $number14 + 1;
>   ++$number14;
>   $number14++;
Roger that.

>
>> # a cup is a twelfth of a quart
>
> No, a pint is half a quart and a cup is half a pint.
A bet that if you're correct, then we both are.

> A cup is one quarter of a quart.
>
> Why in the heck is there a comment about line 16 of sugar.pl?
> Why even bother with anything before "$no10=7.5"?  All worthless.
>
> I give up.  It appears that you are not serious.
You're free to give up as
a)  you've helped me signicantly.
b) it used to be a free country.
c) you might not be Ami, so you actually could be free.

As to not being serious, I'll take the event of a perl script that converges 
0n 7.32 as a refutation.  (Still working out the kinks.  I'm resisting the 
urge to write it in a more familiar syntax;  there's no reason that I can't 
get it with a wonderful machine, xp, phone_a_friend, usenet, the camel book, 
and a fish named wanda.)  And Michele.  And the other  italians.


-- 
wade ward

Westates Companies
1108 W. South Jordan pkwy
435 -838-7760
President
wade@zaxfuuq.net 




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

Date: Thu, 25 Oct 2007 19:25:48 +0000 (UTC)
From: pacman@TheWorld.com (Alan Curry)
Subject: Re: Crypt::TripleDES and public/private keys
Message-Id: <ffqqjs$34k$1@pcls6.std.com>

In article <5obi6tFm1i9fU1@mid.individual.net>,
Steve  <SteveSpamTrap@yahoo.com> wrote:
>... but how does this relate back to Perl, through the 
>"Crypt::TripleDES" module?  This module does not appear to take in a key 
>as any of its input parameters... just the text to be 
>encrypted/decrypted, and a passphrase.  Is what "Crypt::TripleDES" calls 
>the "passphrase" actually the private key value that you're referring 
>to?  I do appreciate all the background information, but is anyone out 
>there actually using this "Crypt::TripleDES" module in Perl?

This question turns out to be more interesting than it seemed at first.
In general, a "passphrase" is something that's used to generate a "key".
The difference between them is that the passphrase is made of text, so
it can be entered manually by the user. Text doesn't have a high density
of unpredictable bits, so the passphrase is usually hashed to create a
key.

However, in the case of Crypt/TripleDES.pm we have this:

    $passphrase .= ' ' x (16*3);

    for ( 0..2 ) {
        my @kvs = Crypt::PPDES::des_set_key( pack( "H*", substr($passphrase, 16*
$_, 16 )));
        $keyvecs{$_} = \@kvs;
    }

So the passphrase is padded with spaces to 48 characters, then split
into groups of 16 characters, and interpreted as hex numbers. So the
passphrase in this case should actually be the key you want, expressed
in hex. I suspect the author made a mistake. (Why pad with spaces if
you're going to interpret them as numbers? Wouldn't zeros make more
sense?)

The documentation is misleading:

  The passphrase is an ASCII character string of upto 48 characters.

48 characters which will go through an "H*" packing! perlfunc says that
packing isn't even well-defined for all inputs.

-- 
Alan Curry
pacman@world.std.com


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

Date: Fri, 26 Oct 2007 00:03:23 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: From "The Camel Book", Ch. 16 (IPC)
Message-Id: <ruj7v4-rq21.ln1@osiris.mauzo.dyndns.org>


Quoth xhoster@gmail.com:
> Ben Morrow <ben@morrow.me.uk> wrote:
> > Quoth rihad <rihad@mail.ru>:
> > > Chapter 16 "Interprocess Communication" of "Programming Perl" has this
> > > part:
> > >
> > > use Fcntl ':flock';
> > > eval {
> > >     local $SIG{ALRM} = sub { die "alarm clock restart" };
> > >     alarm 10;               # schedule alarm in 10 seconds
> > >     eval {
> > >         flock(FH, LOCK_EX)  # a blocking, exclusive lock
> > >             or die "can't flock: $!";
> > >     };
> > >     alarm 0;                # cancel the alarm
> > > };
> > > alarm 0;               # race condition protection
> > > die if $@ && $@ !~ /alarm clock restart/; # reraise
> >
> > It should be noted that this won't work under 5.8 with 'safe signals',
> > as $SIG{ALRM} won't be called until after flock returns (which is
> > exactly what you're trying to avoid).
> 
> On my system at least, the alarm causes flock to return immediately,
> setting $! to "Interrupted system call", rather than automatically
> restarting it.  That means that $SIG{ALRM} will be called almost
> immediately.  Of course, it also means that on my system the whole thing
> can be done much more easily, without any dies or evals.

Yes: I should have tested before posting :). It seems that at least
SIGALRM can interrupt a blocking flock.

Ben



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

Date: Thu, 25 Oct 2007 19:00:50 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: How to fetch output of some other script in the current running perl script?
Message-Id: <Xns99D498BB153EDasu1cornelledu@127.0.0.1>

ritugoyal12@gmail.com wrote in news:1193314694.744816.302990@v29g2000prd.googlegroups.com:

> Code
> $Response = system("start test.wbt");
> print $Response;
> 
> By the above code I am able to execute test.wbt but program doesnt
> wait for test.wbt to get executed.
> 
> Please help me what i m doing wrong also it would be nice if somebody
> could explain me why the above program fails and how can I print the
> output of the executed programin the current program.

You are using the system function. The system function does not do what 
you want it to do. Wouldn't you first consult the documentation for the
system function:

perldoc -f system

Or, alternatively, you can use the HTML documentation that comes with 
ActiveState Perl:

file:///C:/Perl/html/lib/pods/perlfunc.html#alphabetical_listing_of_perl_functions

file:///C:/Perl/html/index.html

Sinan


-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
clpmisc guidelines: <URL:http://www.augustmail.com/~tadmc/clpmisc.shtml>



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

Date: Thu, 25 Oct 2007 23:11:24 -0000
From:  cyrusgreats@gmail.com
Subject: How to interactively sending the username/password to login using ssh
Message-Id: <1193353884.604742.187320@e9g2000prf.googlegroups.com>

Hi ,
I'm trying to interactively sending the username/password to login and
then send CLI commands usinf ssh, this is the only way I can access
the device, and then sending the commands when logged in, I used the
following but it seems does not pass the password, I'm sure one of you
guyus out there have an idea. Thanks in advance..


#!/usr/bin/perl

use IPC::Session;

 # open ssh session to your applinace
 # -- set timeout of 30 seconds for all send() calls
 my $mybox = "10.0.42.111";
 my $session = new IPC::Session("ssh -l usrname $mybox",30);

 # use like 'expect':
 print $session->send("passwd");


Here I see the Password prompt but I can't pass password ..
cheers



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

Date: 26 Oct 2007 00:05:03 GMT
From: all mail refused <elvis-85473@notatla.org.uk>
Subject: Re: How to interactively sending the username/password to login using ssh
Message-Id: <slrnfi2bg2.kh5.elvis-85473@notatla.org.uk>

On 2007-10-25, cyrusgreats@gmail.com <cyrusgreats@gmail.com> wrote:

> I'm trying to interactively sending the username/password to login and

passwordless logins are in the SSH docs and FAQ
 http://www.snailbook.com/faq/

"expect" deals with terminal input if you really need
to provide a password that way.  Various CPAN modules
involve it.
 http://search.cpan.org/search?query=expect&mode=module

-- 
Elvis Notargiacomo  master AT barefaced DOT cheek
http://www.notatla.org.uk/goen/


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

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


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