[31063] in Perl-Users-Digest
Perl-Users Digest, Issue: 2308 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 31 06:09:45 2009
Date: Tue, 31 Mar 2009 03:09:11 -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 Tue, 31 Mar 2009 Volume: 11 Number: 2308
Today's topics:
Re: bareword question <ben@morrow.me.uk>
Re: bareword question <skye.shaw@gmail.com>
Re: Being more restrictive when using blessed hash ref sln@netherlands.com
Re: Being more restrictive when using blessed hash ref sln@netherlands.com
Re: Being more restrictive when using blessed hash ref <Alexander.Farber@gmail.com>
Re: Being more restrictive when using blessed hash ref <skye.shaw@gmail.com>
Re: Calling SQL Server Stored Procedures: no results fr <skye.shaw@gmail.com>
Re: godaddy & perl <cherryplankton@gmail.com>
Re: Help using PAR, installed not able to use it <Ansher.M@gmail.com>
Interpreting terminal codes in Perl <m@rtij.nl.invlalid>
Re: Interpreting terminal codes in Perl <ben@morrow.me.uk>
Re: Interpreting terminal codes in Perl <m@rtij.nl.invlalid>
Re: Net::SSH::Perl Help <vendion@charter.net>
Re: Net::SSH::Perl Help <tadmc@seesig.invalid>
Re: Net::SSH::Perl Help <ben@morrow.me.uk>
new CPAN modules on Tue Mar 31 2009 (Randal Schwartz)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 30 Mar 2009 21:48:19 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: bareword question
Message-Id: <jpn7a6-oj2.ln1@osiris.mauzo.dyndns.org>
Quoth DaLoverhino <DaLoveRhino@hotmail.com>:
> Hello.
>
> I have a function that takes an array of quoted words:
>
> use strict;
> use warnings;
> my_function( "hello", "world!");
>
> I can do this:
>
> my_function qq(hello world!);
I think you mean qw().
> is there anyway to tell perl, that any barewords after my_function
> (and my_function alone) should be treated as quoted words? So that I
> can just simply do this:
>
> my_function(hello world!);
Not easily, and it's not at all a good idea. Bareword parsing in Perl is
insane enough already without making it worse.
What are you actually trying to achieve?
Ben
------------------------------
Date: Tue, 31 Mar 2009 01:33:47 -0700 (PDT)
From: "Skye Shaw!@#$" <skye.shaw@gmail.com>
Subject: Re: bareword question
Message-Id: <47f619d4-cf01-48f1-b4c1-f8825dbfdcd4@j9g2000prh.googlegroups.com>
On Mar 30, 9:39=A0am, DaLoverhino <DaLoveRh...@hotmail.com> wrote:
> I have a function that takes an array of quoted words:
>
> use strict;
> use warnings;
> my_function( "hello", "world!");
>
> I can do this:
>
> my_function qq(hello world!);
>
> is there anyway to tell perl, that any barewords after my_function
> (and my_function alone) should be treated as quoted words? =A0
No. Apples cannot be treated as oranges.
Plus, strict and warnings and your barewords themselves will only
pester you into using quotes.
If you feel the need to use barewords, yet are still compelled to be
warned about other bad coding decisions, then just turn off these
modules at the "right" time:
{
no warnings 'syntax';
no strict 'subs';
my_function(bare, it, all)
}
but... if you say:
{
no warnings 'syntax';
no strict 'subs';
my_function(bare, it, all, girl!)
}
then you'll run into problems anyways.
-Skye
------------------------------
Date: Mon, 30 Mar 2009 20:26:10 GMT
From: sln@netherlands.com
Subject: Re: Being more restrictive when using blessed hash ref for OOP
Message-Id: <n872t4p25mgm5r8vbar1222ofvb1oh281s@4ax.com>
On Mon, 30 Mar 2009 05:55:50 -0700 (PDT), "A. Farber" <Alexander.Farber@gmail.com> wrote:
>Hello,
>
>I define and use several classes in my Perl application,
>and I use blessed hash refs to store the data members.
>
>Often I wonder, if there is a possibility for being
>more restrictive - for example I'd prefer to get
>a warning, when I reference or vivificate a
>$href->{PLAYER} instead of $href->{PLAYERS} by mistake
>
>Any suggestions please? Example of my code below...
>
>Regards
>Alex
>
Blessing an array reference instead will give you a bareword error if the wrong constant is used
when acessing it (as in the blow code). Still has the same form though: $g->[] instead of $g->{}
Anyway, something to think about.
-sln
----------------------------
## gtest1.pl
##
use strict;
use warnings;
use Game;
my @Grefs = ();
# start 11 games
Game->new() for (1 .. 11);
for my $key (sort {$a <=> $b} keys %Game::Games)
{
my $g = $Game::Games{$key};
printf "\nGame #: %d\n------------------------\n", $$g[GID];
printf " (%2d) phase - %s\n", PHASE, $$g[ PHASE ];
printf " (%2d) players - %s\n", PLAYERS, join ' ', @{$$g[ PLAYERS ]};
printf " (%2d) deck - %s\n", DECK, join ' ', @{$$g[ DECK ]}[0..10]; # just print out 10 elements
printf " (%2d) bbcode - %s\n", BBCODE, $$g[ BBCODE ];
$g->test();
print " $g->[HVARS]{misc_1}\n";
print " $g->[HVARS]{misc_2}\n";
}
print "\n\nTotal current games: $Game::Num\n\n";
-------------------------------------------------------------------
# or ...
## gtest2.pl
##
use strict;
use warnings;
use Game;
my @Grefs = ();
# start 5 games
for (1 .. 5)
{
my $g = Game->new();
push @Grefs, $g;
printf "\nCreating game #: %d\n------------------------\n", $$g[GID];
printf " (%2d) phase - %s\n", PHASE, $$g[ PHASE ];
printf " (%2d) players - %s\n", PLAYERS, join ' ', @{$$g[ PLAYERS ]};
printf " (%2d) deck - %s\n", DECK, join ' ', @{$$g[ DECK ]}[0..10]; # just print out 10 elements
printf " (%2d) bbcode - %s\n", BBCODE, $$g[ BBCODE ];
$g->test();
}
print "\n\nTotal current games: $Game::Num\n\n";
----------------------------
## Game.pm
##
package Game;
use strict;
use warnings;
use Exporter qw( import );
our @ISA = qw();
# Export any bareword constants needed by caller
# (be carefull of caller namespace pollution)
our @EXPORT = qw( GID PHASE PLAYERS DECK BBCODE HVARS );
our (%Games, $Num, $Sth_create_topic, $Sth_create_reply);
use constant {
GID => 0,
PHASE => 1,
PLAYERS => 2,
KIBITZERS => 3,
INFO => 4,
DECK => 5,
TABLE => 6,
NTABLE => 7,
START => 8,
TURN => 9,
NPASSED => 10,
HOLDER => 11,
WHISTER1 => 12,
WHISTER2 => 13,
ACTIVE => 14,
PASSIVE => 15,
SHOW => 16,
LATER => 17,
BEFORE => 18,
TRUMP => 19,
SUIT1 => 20,
TOPIC => 21,
WINNER => 22,
ROUND => 23,
BBCODE => 24,
SUBJ => 25,
BODY => 26,
HVARS => 27
};
sub new {
my $pkg = shift;
my @chars = ('a'..'z', 'A'..'Z');
my @game = ();
$game[ GID ] = ++$Num;
$game[ PHASE ] = 'CHATTING';
$game[ PLAYERS ] = [];
$game[ KIBITZERS ] = [];
$game[ INFO ] = undef;
$game[ DECK ] = [ 0 .. 31 ];
$game[ TABLE ] = undef;
$game[ NTABLE ] = undef;
$game[ START ] = undef;
$game[ TURN ] = undef;
$game[ NPASSED ] = undef;
$game[ HOLDER ] = undef;
$game[ WHISTER1 ] = undef;
$game[ WHISTER2 ] = undef;
$game[ ACTIVE ] = undef;
$game[ PASSIVE ] = undef;
$game[ SHOW ] = undef;
$game[ LATER ] = undef;
$game[ BEFORE ] = undef;
$game[ TRUMP ] = undef;
$game[ SUIT1 ] = undef;
$game[ TOPIC ] = undef;
$game[ WINNER ] = undef;
$game[ ROUND ] = 0;
$game[ BBCODE ] = '';
$game[ SUBJ ] = '';
$game[ BODY ] = '';
$game[ HVARS ] = ();
# generate 8 random characters used for posts in phpBB
$game[ BBCODE ] .= $chars[rand @chars] while length $game [ BBCODE ] < 8;
# add ficticous players
my @players = qw( Fred Jane Sam Karen Jill George Ed Mary Cathy Bill);
my %hseen;
while ( @{$game[ PLAYERS ]} < 4 ) {
my $rval = int rand( 10 );
if (++$hseen{ $rval } == 1) {
push @{$game[ PLAYERS ]}, $players[ $rval ];
}
}
# add some hvars
$game[ HVARS ]{misc_1} = 'Misc hvar1';
$game[ HVARS ]{misc_2} = 'Misc hvar2';
$Games{$Num} = \@game;
bless(\@game, $pkg);
}
sub test {
my $self = shift;
print " Game::test -> this is game number $self->[GID]\n";
}
1;
__END__
output:
Game #: 1
------------------------
( 1) phase - CHATTING
( 2) players - Jill Jane Karen Mary
( 5) deck - 0 1 2 3 4 5 6 7 8 9 10
(24) bbcode - uliextQX
Game::test -> this is game number 1
Misc hvar1
Misc hvar2
Game #: 2
------------------------
( 1) phase - CHATTING
( 2) players - Cathy Ed Sam George
( 5) deck - 0 1 2 3 4 5 6 7 8 9 10
(24) bbcode - RjDVIJfS
Game::test -> this is game number 2
Misc hvar1
Misc hvar2
Game #: 3
------------------------
( 1) phase - CHATTING
( 2) players - Cathy Mary Ed Sam
( 5) deck - 0 1 2 3 4 5 6 7 8 9 10
(24) bbcode - FuCekHEK
Game::test -> this is game number 3
Misc hvar1
Misc hvar2
Game #: 4
------------------------
( 1) phase - CHATTING
( 2) players - Fred Ed George Mary
( 5) deck - 0 1 2 3 4 5 6 7 8 9 10
(24) bbcode - TDrZeoFg
Game::test -> this is game number 4
Misc hvar1
Misc hvar2
Game #: 5
------------------------
( 1) phase - CHATTING
( 2) players - George Mary Karen Ed
( 5) deck - 0 1 2 3 4 5 6 7 8 9 10
(24) bbcode - SFRQSpwb
Game::test -> this is game number 5
Misc hvar1
Misc hvar2
Game #: 6
------------------------
( 1) phase - CHATTING
( 2) players - George Ed Sam Jane
( 5) deck - 0 1 2 3 4 5 6 7 8 9 10
(24) bbcode - ciOaDodl
Game::test -> this is game number 6
Misc hvar1
Misc hvar2
Game #: 7
------------------------
( 1) phase - CHATTING
( 2) players - Ed Bill George Mary
( 5) deck - 0 1 2 3 4 5 6 7 8 9 10
(24) bbcode - IkwvnETT
Game::test -> this is game number 7
Misc hvar1
Misc hvar2
Game #: 8
------------------------
( 1) phase - CHATTING
( 2) players - Ed Fred George Bill
( 5) deck - 0 1 2 3 4 5 6 7 8 9 10
(24) bbcode - jYpluPkl
Game::test -> this is game number 8
Misc hvar1
Misc hvar2
Game #: 9
------------------------
( 1) phase - CHATTING
( 2) players - Karen Sam Mary Fred
( 5) deck - 0 1 2 3 4 5 6 7 8 9 10
(24) bbcode - MgWhsqVw
Game::test -> this is game number 9
Misc hvar1
Misc hvar2
Game #: 10
------------------------
( 1) phase - CHATTING
( 2) players - Jill George Sam Karen
( 5) deck - 0 1 2 3 4 5 6 7 8 9 10
(24) bbcode - ukpyRwfX
Game::test -> this is game number 10
Misc hvar1
Misc hvar2
Game #: 11
------------------------
( 1) phase - CHATTING
( 2) players - Ed Jill Karen Sam
( 5) deck - 0 1 2 3 4 5 6 7 8 9 10
(24) bbcode - NbCTbivT
Game::test -> this is game number 11
Misc hvar1
Misc hvar2
Total current games: 11
------------------------------
Date: Mon, 30 Mar 2009 20:39:55 GMT
From: sln@netherlands.com
Subject: Re: Being more restrictive when using blessed hash ref for OOP
Message-Id: <isa2t4dn8iqratsmemg28irervq3qp2mtv@4ax.com>
On Mon, 30 Mar 2009 20:26:10 GMT, sln@netherlands.com wrote:
>On Mon, 30 Mar 2009 05:55:50 -0700 (PDT), "A. Farber" <Alexander.Farber@gmail.com> wrote:
>
>>Hello,
>>
>>I define and use several classes in my Perl application,
>>and I use blessed hash refs to store the data members.
>>
>>Often I wonder, if there is a possibility for being
>>more restrictive - for example I'd prefer to get
>>a warning, when I reference or vivificate a
>>$href->{PLAYER} instead of $href->{PLAYERS} by mistake
>>
>>Any suggestions please? Example of my code below...
>>
>>Regards
>>Alex
>>
>
>Blessing an array reference instead will give you a bareword error if the wrong constant is used
>when acessing it (as in the blow code). Still has the same form though: $g->[] instead of $g->{}
>
>Anyway, something to think about.
>
> my @game = ();
>
Using constants you would never have to declare unambigous elements,
so this initialization could be reduced to:
$game[ GID ] = ++$Num;
$game[ PHASE ] = 'CHATTING';
$game[ PLAYERS ] = [];
$game[ KIBITZERS ] = [];
$game[ DECK ] = [ 0 .. 31 ];
$game[ ROUND ] = 0;
$game[ BBCODE ] = '';
$game[ SUBJ ] = '';
$game[ BODY ] = '';
$game[ HVARS ] = ();
Of course this wont provide locking, but it obscures the array index and
forces the user or within the module to use named constants as indexes,
whose values can change without need to change user code.
User harcoded numeric index's could break in future pm versions and is not
reliable.
-sln
------------------------------
Date: Tue, 31 Mar 2009 00:17:13 -0700 (PDT)
From: "A. Farber" <Alexander.Farber@gmail.com>
Subject: Re: Being more restrictive when using blessed hash ref for OOP
Message-Id: <c2757814-8297-489a-b7db-dca2103c3846@j8g2000yql.googlegroups.com>
On Mar 30, 10:39=A0pm, s...@netherlands.com wrote:
> >Blessing an array reference instead will give you a bareword error if th=
e wrong constant is used
> >when acessing it (as in the blow code). Still has the same form though: =
=A0$g->[] instead of $g->{}
Thank you for the idea!
------------------------------
Date: Tue, 31 Mar 2009 02:03:04 -0700 (PDT)
From: "Skye Shaw!@#$" <skye.shaw@gmail.com>
Subject: Re: Being more restrictive when using blessed hash ref for OOP
Message-Id: <41abeb6f-886b-4447-ba8c-23a769840701@r31g2000prh.googlegroups.com>
On Mar 30, 5:55=A0am, "A. Farber" <Alexander.Far...@gmail.com> wrote:
> Hello,
>
> I define and use several classes in my Perl application
> and I use blessed hash refs to store the data members.
>
> Often I wonder, if there is a possibility for being
> more restrictive
Yes, a strongly statically typed language.
> for example I'd prefer to get
> a warning, when I reference or vivificate a
> $href->{PLAYER} instead of $href->{PLAYERS} by mistake
As someone has pointed out, these should be accessors, but I wonder,
what is you primary concern?
Someone misusing your package, coding errors, or both?
------------------------------
Date: Tue, 31 Mar 2009 02:11:02 -0700 (PDT)
From: "Skye Shaw!@#$" <skye.shaw@gmail.com>
Subject: Re: Calling SQL Server Stored Procedures: no results from SELECT following INSERT
Message-Id: <3db4e7be-cb52-451a-8b59-eb32229fc559@w35g2000prg.googlegroups.com>
On Mar 30, 3:52=A0am, bella...@gmail.com wrote:
> The question is - why nothing can be received by the caller from
> SELECTS that follow INSERT?
> Is it possible that only one dataset may come back from SP, and that
> INSERT results in an
> empty dataset, in that way blocking results from following SELECTs?
What driver are you using?
Can you post your sp code?
------------------------------
Date: Mon, 30 Mar 2009 18:44:22 -0500
From: cherryplankton <cherryplankton@gmail.com>
Subject: Re: godaddy & perl
Message-Id: <611750540260149379.866868cherryplankton-gmail.com@news.giganews.com>
<grouchy.oldgit@googlemail.com> wrote:
> I've just started learning perl and am trying to run the script below
> entitled p1.pl on godaddy in folder /cgi
>
> #!/usr/bin/perl
> print "hello world";
>
> It keeps returning 500 Internal Sever Error
>
> Is there some problem in my program? Or am I not using godaddy's perl
> implementation correctly?
godaddy perl ;)
--
signed
------------------------------
Date: Tue, 31 Mar 2009 02:36:30 -0700 (PDT)
From: perl Newbie <Ansher.M@gmail.com>
Subject: Re: Help using PAR, installed not able to use it
Message-Id: <d9008995-561a-4185-8796-123f576661fe@z15g2000yqm.googlegroups.com>
On Mar 30, 10:13=A0pm, genom...@gmail.com wrote:
> On 30 mar, 19:04, perl Newbie <Anshe...@gmail.com> wrote:
>
>
>
>
>
> > On Mar 30, 8:54=A0pm, genom...@gmail.com wrote:
>
> > > On 30 mar, 17:37, perl Newbie <Anshe...@gmail.com> wrote:
>
> > > > On Mar 30, 8:35=A0pm, genom...@gmail.com wrote:
>
> > > > > On 30 mar, 17:33, perl Newbie <Anshe...@gmail.com> wrote:
>
> > > > > > > You have two choices :
> > > > > > > 1) use C:/Perl/site/bin/pp
> > > > > > > eg : C:\Test\test>C:/Perl/site/bin/pp =A0-o test.exe test.pl
>
> > > > > > > 2) Add C:/Perl/site/bin/pp in your PATH and then
> > > > > > > C:\Test\test>pp -o test.exe test.pl- Hide quoted text -
>
> > > > > > > - Show quoted text -
>
> > > > > > I checked the folder C:/Perl/site/bin/, there is empty folder.
>
> > > > > > I also checked C:\Perl\bin, there too no file as pp.
>
> > > > > You have to install PAR::Packer before.
>
> > > > How to install PAR::Packer ?
>
> > > ppm install PAR::Packer- Hide quoted text -
>
> > > - Show quoted text -
>
> > Thanks for you help, but I am still unable to install
>
> > C:\Perl>ppm install Par
> > Downloading ActiveState Package Repository packlist...not modified
> > No missing packages to install
>
> =3D> normal because you have alredy install it
>
> > C:\Perl>ppm install PAR::Packer
> > Downloading ActiveState Package Repository packlist...not modified
> > ppm install failed: Can't find any package that provides PAR::Packer
>
> > C:\Perl>ppm install Par-Packer
> > Downloading ActiveState Package Repository packlist...not modified
> > ppm install failed: Can't find any package that provides Par-Packer
>
> You don't seem to have repository on your computer wich have this
> module.
>
> ppm installhttp://www.bribes.org/perl/ppm/PAR-Packer.ppd
>
> Nevertheless I recommand you to install 3 Perl repositories on your
> computer
>
> ppm> rep add bribeshttp://www.bribes.org/perl/ppm
> ppm> rep add theoryxhttp://theoryx5.uwinnipeg.ca/ppms
> ppm> rep add Trouchellehttp://trouchelle.com/ppm/
>
> NB : If you speak french, you can read this good documentation about
> ppm and modules installationhttp://djibril.developpez.com/tutoriels/perl/=
installation-modules/- Hide quoted text -
>
> - Show quoted text -
Thanks for your help, finally managed to install.
I created exe using command pp -o test.exe test.pl
but surprisingly when i run the exe it stops and in the command line
window it reads call perl. I am trying to make exe so that those who
do not have perl in their PC can use it as well.
ActivePerl-PPM
The Perl Package Manager
Version: 4.3
Released: 2008-08-29
Author: ActiveState <support@activestate.com>
Is there something I am missing here?
------------------------------
Date: Mon, 30 Mar 2009 23:57:11 +0200
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Interpreting terminal codes in Perl
Message-Id: <pan.2009.03.30.21.57.11@rtij.nl.invlalid>
Hi,
I googled, but came up with nothing.
What I want to do is translate terminal codes to readable text. So for an
xterm, "\e[2A" should translate to something like "<UP 2 LINES>".
Obviously there are a lot of terminals out there, any reasonable subset
will do.
Is there any perl module that will help me with this? Or would there be a
way to "reverse" the termcap information? Or do I have to program this
myself for any and all terminals out there? (I started on xterm, it's
doable, but a lot of work, I don't want to repeat that for all and every
terminal out there.)
TIA,
M4
------------------------------
Date: Mon, 30 Mar 2009 23:32:33 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Interpreting terminal codes in Perl
Message-Id: <1tt7a6-l3m.ln1@osiris.mauzo.dyndns.org>
Quoth Martijn Lievaart <m@rtij.nl.invlalid>:
>
> What I want to do is translate terminal codes to readable text. So for an
> xterm, "\e[2A" should translate to something like "<UP 2 LINES>".
> Obviously there are a lot of terminals out there, any reasonable subset
> will do.
>
> Is there any perl module that will help me with this? Or would there be a
> way to "reverse" the termcap information? Or do I have to program this
> myself for any and all terminals out there? (I started on xterm, it's
> doable, but a lot of work, I don't want to repeat that for all and every
> terminal out there.)
I don't know of anything that will do this. However, it shouldn't be too
hard to extract a list of valid capability names from your termcap(5) or
terminfo(5) and then call Term::Cap->Tgets on each to build up a hash
from control string to name for the current terminal. OTOH, you may find
it easier to work directly from the terminfo master file at
http://www.catb.org/terminfo/termtypes.master.gz. It doesn't look too
hard to write a parser for.
Ben
------------------------------
Date: Tue, 31 Mar 2009 08:07:39 +0200
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: Interpreting terminal codes in Perl
Message-Id: <pan.2009.03.31.06.07.39@rtij.nl.invlalid>
On Mon, 30 Mar 2009 23:32:33 +0100, Ben Morrow wrote:
> I don't know of anything that will do this. However, it shouldn't be too
> hard to extract a list of valid capability names from your termcap(5) or
> terminfo(5) and then call Term::Cap->Tgets on each to build up a hash
> from control string to name for the current terminal. OTOH, you may find
> it easier to work directly from the terminfo master file at
> http://www.catb.org/terminfo/termtypes.master.gz. It doesn't look too
> hard to write a parser for.
Thanks!
M4
------------------------------
Date: Mon, 30 Mar 2009 11:13:47 -0700 (PDT)
From: vendion <vendion@charter.net>
Subject: Re: Net::SSH::Perl Help
Message-Id: <778f3663-4fce-4c27-a388-50533f058ddc@q16g2000yqg.googlegroups.com>
On Mar 28, 7:48=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:
>
> Please post a *short* *complete* script we can all run, the output you
> expected to see and the output you actually got. 'Permission denied' is
> not a message produced by perl itself, so we have no way of knowing what
> you've done to provoke it unless you show us your code.
>
> Ben
Sure here the code:
#!/usr/bin/perl
#upgrader.pl This is the server side of a two part perl script that
uses ssh to
#get into the lab PCs and have them run the upgrade.
use warnings;
use strict;
use Net::SSH::Perl;
for my $computer ( '01' .. '26' ) { #loop once for each computer,
total 26 times
print "Making connection to E-307-$computer\n";
my $ssh =3D Net::SSH::Perl->new("10.18.1.1$computer");
$ssh->login('user', 'password');
my ($stout, $sterr, $exit) =3D $ssh->cmd('upgrade.pl');
}
exit 0
and here is the output I get with this code:
e-307-20@E-307-20:~> upgrader.pl
Making connection to E-307-01
Permission denied at /home/e-307-20/bin/upgrader.pl line 11
The only thing is different is the line that it errors on because of
the change in the loop, also change the command upgrade.pl to date
gives the same permission error.
------------------------------
Date: Mon, 30 Mar 2009 16:50:29 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Net::SSH::Perl Help
Message-Id: <slrngt2fl5.84n.tadmc@tadmc30.sbcglobal.net>
vendion <vendion@charter.net> wrote:
> #upgrader.pl This is the server side of a two part perl script that
> uses ssh to
Is that one line or two lines?
> for my $computer ( '01' .. '26' ) { #loop once for each computer,
> total 26 times
Is that one line or two lines?
> Permission denied at /home/e-307-20/bin/upgrader.pl line 11
Should we be looking at the 11th line or the 13th line of what
you posted?
Please either:
Disable word wrap when posting long lines
or, better, do not *have* any long lines in your code
#upgrader.pl This is the server side of a two part perl script
# that uses ssh to
for my $computer ( '01' .. '26' ) { #loop once for each computer,
# total 26 times
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Mon, 30 Mar 2009 22:49:21 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Net::SSH::Perl Help
Message-Id: <1cr7a6-hs2.ln1@osiris.mauzo.dyndns.org>
Quoth vendion <vendion@charter.net>:
>
> Sure here the code:
>
> #!/usr/bin/perl
> #upgrader.pl This is the server side of a two part perl script that
> uses ssh to
> #get into the lab PCs and have them run the upgrade.
> use warnings;
> use strict;
> use Net::SSH::Perl;
>
> for my $computer ( '01' .. '26' ) { #loop once for each computer,
> total 26 times
> print "Making connection to E-307-$computer\n";
> my $ssh = Net::SSH::Perl->new("10.18.1.1$computer");
> $ssh->login('user', 'password');
> my ($stout, $sterr, $exit) = $ssh->cmd('upgrade.pl');
> }
> exit 0
>
> and here is the output I get with this code:
>
> e-307-20@E-307-20:~> upgrader.pl
> Making connection to E-307-01
> Permission denied at /home/e-307-20/bin/upgrader.pl line 11
>
> The only thing is different is the line that it errors on because of
> the change in the loop, also change the command upgrade.pl to date
> gives the same permission error.
It looks to me as though this is the message you get if authentication
fails. Check that you can ssh to the host concerned with ssh(1).
Ben
------------------------------
Date: Tue, 31 Mar 2009 04:42:26 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Tue Mar 31 2009
Message-Id: <KHCt2q.yBM@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
Apache2-WURFLFilter-1.52
http://search.cpan.org/~ifuschini/Apache2-WURFLFilter-1.52/
is a Apache Mobile Filter that manage content (text & image) to the correct mobile device
----
Async-MergePoint-0.01
http://search.cpan.org/~pevans/Async-MergePoint-0.01/
resynchronise diverged control flow
----
B-Foreach-Iterator-0.01
http://search.cpan.org/~gfuji/B-Foreach-Iterator-0.01/
Increases foreach iterators
----
CPANPLUS-0.85_07
http://search.cpan.org/~kane/CPANPLUS-0.85_07/
API & CLI access to the CPAN mirrors
----
CPANPLUS-Dist-Build-0.18
http://search.cpan.org/~bingos/CPANPLUS-Dist-Build-0.18/
CPANPLUS plugin to install packages that use Build.PL
----
CPANPLUS-YACSmoke-0.33_01
http://search.cpan.org/~bingos/CPANPLUS-YACSmoke-0.33_01/
Yet Another CPANPLUS Smoke Tester
----
Class-C3-XS-0.11
http://search.cpan.org/~flora/Class-C3-XS-0.11/
XS speedups for Class::C3
----
Database-CheckConnectivity-0.01
http://search.cpan.org/~sunnavy/Database-CheckConnectivity-0.01/
util to check database's connectivity
----
Devel-BindPP-0.03_03
http://search.cpan.org/~tokuhirom/Devel-BindPP-0.03_03/
bind c++ to perl
----
Module-Build-Smolder-0.01
http://search.cpan.org/~wonko/Module-Build-Smolder-0.01/
Extra build targets for sending smoke tests to a Smolder server
----
Module-Build-TAPArchive-0.02
http://search.cpan.org/~wonko/Module-Build-TAPArchive-0.02/
Extra build targets for creating TAP archives
----
MooseX-InstanceTracking-0.03
http://search.cpan.org/~sartak/MooseX-InstanceTracking-0.03/
Trait for tracking all instances of a class
----
OAuth-Lite-1.15
http://search.cpan.org/~lyokato/OAuth-Lite-1.15/
OAuth framework
----
Rose-DBx-Object-Renderer-0.43
http://search.cpan.org/~danny/Rose-DBx-Object-Renderer-0.43/
Web UI Rendering for Rose::DB::Object
----
Rose-DBx-Object-Renderer-0.44
http://search.cpan.org/~danny/Rose-DBx-Object-Renderer-0.44/
Web UI Rendering for Rose::DB::Object
----
SOAP-Simple-0.00_03
http://search.cpan.org/~berle/SOAP-Simple-0.00_03/
To the extent that SOAP can be simple
----
Smolder-1.30
http://search.cpan.org/~wonko/Smolder-1.30/
Web-based smoke test aggregator
----
Smolder-1.31
http://search.cpan.org/~wonko/Smolder-1.31/
Web-based smoke test aggregator
----
Test-LeakTrace-0.09
http://search.cpan.org/~gfuji/Test-LeakTrace-0.09/
Traces memory leaks
----
UNIVERSAL-require-0.12
http://search.cpan.org/~mschwern/UNIVERSAL-require-0.12/
require() modules from a variable
----
URI-cpan-1.000
http://search.cpan.org/~rjbs/URI-cpan-1.000/
URLs that refer to things on the CPAN
----
URI-cpan-1.001
http://search.cpan.org/~rjbs/URI-cpan-1.001/
URLs that refer to things on the CPAN
----
WWW-Scraper-ISBN-LibUniverIt-Driver-0.1
http://search.cpan.org/~marcog/WWW-Scraper-ISBN-LibUniverIt-Driver-0.1/
----
randpass-1.07
http://search.cpan.org/~nkuitse/randpass-1.07/
generate random passwords and passphrases
----
randpass-1.08
http://search.cpan.org/~nkuitse/randpass-1.08/
generate random passwords and passphrases
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
------------------------------
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 2308
***************************************