Re: which module is suitable for logging into cisco devices

2008-11-23 Thread Deviloper
There are some moduls I use under linux. Problem is that Cisco CLI may change prompt. Checkout Net::SSH and Perl Expect. (Also there is a Modul called Net::SSH::Expect, which I had not tried yet.) You may need to install Cygwin. This gives you a lot of linux utils. HaveFun, B.   monnappa appai

RE: help in redirecting output to file

2008-11-23 Thread Irfan.Sayed
Thanks but I need STD output and STD error in the same file. How should I do that. Regards Irfan. -Original Message- From: Nitin Kalra [mailto:[EMAIL PROTECTED] Sent: Thursday, November 20, 2008 10:03 PM To: Sayed, Irfan (Cognizant); beginners@perl.org Subject: Re: help in redirecting

Re: global and local confusion

2008-11-23 Thread Chas. Owens
On Sun, Nov 23, 2008 at 20:07, John W. Krahn <[EMAIL PROTECTED]> wrote: snip >> checkfile($flag); >> sub checkfile { >> use File::Find; >> use File::MMagic; >> use FileHandle; > > use() happens at compile time so there is no point, but no harm, to put > these inside a subroutine. snip This is n

Re: perl version for windows

2008-11-23 Thread Chas. Owens
On Sun, Nov 23, 2008 at 19:39, Rob Dixon <[EMAIL PROTECTED]> wrote: snip >> All Perl functionality works on UNIX. Some Perl functionality does >> not work on Windows. > > No, not all Perl functionality works on all Unix platforms. You are as likely > to > find a compatibility issue moving from one

Re: Greedy v non greedy regexps in lookahead.

2008-11-23 Thread Andrew
Thanks "Mr. Shawn H. Corey" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > How would it parse "XMLSchema" ? You need to write down the rules > before you try creating than regex for them. Try: > Ok - I am a typical customer - my stated requirement isn't quite my real requirement :-)

Re: global and local confusion

2008-11-23 Thread John W. Krahn
Mr. Shawn H. Corey wrote: On Sun, 2008-11-23 at 16:55 -0600, Harry Putnam wrote: The program I'll post below is really only a test of a subroutine I want to use in a larger program. Trying to get the subroutine ironed out in this test script below so there is a little extra bumping around to ge

Re: global and local confusion

2008-11-23 Thread John W. Krahn
Harry Putnam wrote: The program I'll post below is really only a test of a subroutine I want to use in a larger program. Trying to get the subroutine ironed out in this test script below so there is a little extra bumping around to get it executed as sub routine, but It fails with these errors:

Re: which module is suitable for logging into cisco devices

2008-11-23 Thread Chas. Owens
On Sun, Nov 23, 2008 at 16:17, monnappa appaiah <[EMAIL PROTECTED]> wrote: > i forgot to mention that, i'l be running the script from the windows machine > ..so pls let me know the module which can login to cisco devices > using ssh, execute certain commands and give me the output. > > Than

Re: Greedy v non greedy regexps in lookahead.

2008-11-23 Thread Dr.Ruud
Andrew schreef: > I am tying to expand some camel case with spaces - but I want multiple > captitals to remain as one word. So > I want "PerlNotesOnXML" -> "Perl Notes On XML" > > My attempt is to use [A-Z]+ in a lookahead. > > my $text = "PerlNotesOnXML" ; > $text =~ s/(?=[A-Z]+)/ /gx ; > p

Re: perl version for windows

2008-11-23 Thread Rob Dixon
Stealth wrote: > On Sunday 23 November 2008 12:58:06 pm David Ehresmann wrote: >> >> What is the difference between learning perl on windows vs. unix? > > Perl was originally developed on UNIX and was later made available > for Windows. Perl on UNIX is in its natural environment. perl on Unix is

Re: global and local confusion

2008-11-23 Thread Mr. Shawn H. Corey
On Sun, 2008-11-23 at 16:55 -0600, Harry Putnam wrote: > The program I'll post below is really only a test of a subroutine I > want to use in a larger program. Trying to get the subroutine ironed > out in this test script below so there is a little extra bumping > around to get it executed as sub

Re: global and local confusion

2008-11-23 Thread Chas. Owens
On Sun, Nov 23, 2008 at 17:55, Harry Putnam <[EMAIL PROTECTED]> wrote: > The program I'll post below is really only a test of a subroutine I > want to use in a larger program. Trying to get the subroutine ironed > out in this test script below so there is a little extra bumping > around to get it

global and local confusion

2008-11-23 Thread Harry Putnam
The program I'll post below is really only a test of a subroutine I want to use in a larger program. Trying to get the subroutine ironed out in this test script below so there is a little extra bumping around to get it executed as sub routine, but It fails with these errors: Variable "$rgx" wil

Re: which module is suitable for logging into cisco devices

2008-11-23 Thread monnappa appaiah
i forgot to mention that, i'l be running the script from the windows machine ..so pls let me know the module which can login to cisco devices using ssh, execute certain commands and give me the output. Thanks, Monnappa On Sun, Nov 23, 2008 at 11:51 PM, monnappa appaiah <[EMAIL PROTECTED]>

Re: perl version for windows

2008-11-23 Thread Octavian Rasnita
From: "David Ehresmann" <[EMAIL PROTECTED]> ActivePerl-5.10.0.1004-MSWin32-x86-287188 Is this the best path or choice to install perl on windows? It depends on what you want to do in perl, but generally ActivePerl is the best choice for Windows. What is the difference between learning perl

Re: perl version for windows

2008-11-23 Thread Stealth
On Sunday 23 November 2008 12:58:06 pm David Ehresmann wrote: > What is the difference between learning perl on windows vs. unix? Perl was originally developed on UNIX and was later made available for Windows. Perl on UNIX is in its natural environment. Perl on Windows is in a modified environme

Re: how to read file content into an array?

2008-11-23 Thread Chas. Owens
On Sun, Nov 23, 2008 at 08:29, loody <[EMAIL PROTECTED]> wrote: > 2008/11/23 Chas. Owens <[EMAIL PROTECTED]>: >> >> >> On Nov 23, 2008, at 2:52, loody <[EMAIL PROTECTED]> wrote: >> >>> Dear all: >>> The prototype of read is >>> read FILEHANDLE,SCALAR,LENGTH >>> ex: >>> read PATTERN, $line, 1920; >>

Re: perl version for windows

2008-11-23 Thread Chas. Owens
On Sun, Nov 23, 2008 at 12:58, David Ehresmann <[EMAIL PROTECTED]> wrote: snip > Is this the best path or choice to install perl on windows? snip I would suggest Strawberry Perl*. It comes with its own C compiler (so modules are easier to install). Of course, that is mostly because I have been r

Re: perl version for windows

2008-11-23 Thread Rob Coops
On Sun, Nov 23, 2008 at 7:31 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: > Rob Coops wrote: > >> > >> What is the difference between learning perl on windows vs. unix? > > > > The main difficulty you will run into is the fact that most examples and > so > > on you will find assume a windows machine >

Re: perl version for windows

2008-11-23 Thread Rob Dixon
venu javarappa wrote: > > I can ask my cousin if she wants old tv Yes, please would you? And can she collect from England? Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: perl version for windows

2008-11-23 Thread Rob Dixon
Rob Coops wrote: >> >> What is the difference between learning perl on windows vs. unix? > > The main difficulty you will run into is the fact that most examples and so > on you will find assume a windows machine No, most platform-dependent examples will assume a Unix machine. But there are a lot

Re: perl version for windows

2008-11-23 Thread Rob Dixon
David Ehresmann wrote: > > If I want to install perl for the computer described below: > > Windows Vista Home Premium > Service Pack 1 > Intel Pentium Dual CPU E2200 2.2GHz 2GB memory > 32-bit > > I would go to ActivePerl and download this: > > ActivePerl-5.10.0.1004-MSWin32-x86-287188 > > Is

Re: perl version for windows

2008-11-23 Thread venu javarappa
I can ask my cousin if she wants old tv -Original Message- From: "Rob Coops" <[EMAIL PROTECTED]> Date: Sun, 23 Nov 2008 19:22:04 To: David Ehresmann<[EMAIL PROTECTED]> Cc: Subject: Re: perl version for windows On Sun, Nov 23, 2008 at 6:58 PM, David Ehresmann <[EMAIL PROTECTED]>wrote:

Re: perl version for windows

2008-11-23 Thread Rob Coops
On Sun, Nov 23, 2008 at 6:58 PM, David Ehresmann <[EMAIL PROTECTED]>wrote: > If I want to install perl for the computer described below: > > > Windows Vista Home Premium > > Service Pack 1 > > Intel Pentium Dual CPU E2200 2.2GHz 2GB memory > > 32-bit > > > > I would go to ActivePerl and download

which module is suitable for logging into cisco devices

2008-11-23 Thread monnappa appaiah
Hi all, I'm looking for a module which can login to cisco devices using ssh, execute certain commands and give me the output.can somebody suggest me the module which is best suitable for loggin into cisco devices via ssh. Thanks, Monnappa

problem installing Net::SSH2

2008-11-23 Thread monnappa appaiah
Hi all I'm getting error while installing Net::SSH2 module on Kubuntu linux 8.10, I had installed the same module on in a different machine which was also running Kubuntu linux 8.10can somebody please help me with this, find the error below.

perl version for windows

2008-11-23 Thread David Ehresmann
If I want to install perl for the computer described below: Windows Vista Home Premium Service Pack 1 Intel Pentium Dual CPU E2200 2.2GHz 2GB memory 32-bit I would go to ActivePerl and download this: ActivePerl-5.10.0.1004-MSWin32-x86-287188 Is this the best path or choice to insta

Re: Greedy v non greedy regexps in lookahead.

2008-11-23 Thread Rob Dixon
Andrew wrote: > I am tying to expand some camel case with spaces - but I want multiple > captitals to remain as one word. So > I want "PerlNotesOnXML" -> "Perl Notes On XML" > > My attempt is to use [A-Z]+ in a lookahead. > > my $text = "PerlNotesOnXML" ; > $text =~ s/(?=[A-Z]+)/ /gx ; >

Re: how to read file content into an array?

2008-11-23 Thread John W. Krahn
Mr. Shawn H. Corey wrote: On Sun, 2008-11-23 at 05:47 -0800, John W. Krahn wrote: Mr. Shawn H. Corey wrote: On Sun, 2008-11-23 at 05:34 -0800, John W. Krahn wrote: You shouldn't "do something with $line" if $bytes_read is undefined: while ( my $bytes_read = read PATTERN, $line, 1920 ) {

Re: how to read file content into an array?

2008-11-23 Thread Mr. Shawn H. Corey
On Sun, 2008-11-23 at 05:47 -0800, John W. Krahn wrote: > Mr. Shawn H. Corey wrote: > > On Sun, 2008-11-23 at 05:34 -0800, John W. Krahn wrote: > >> You shouldn't "do something with $line" if $bytes_read is undefined: > >> > >> while ( my $bytes_read = read PATTERN, $line, 1920 ) { > >> unless

Re: how to read file content into an array?

2008-11-23 Thread John W. Krahn
Mr. Shawn H. Corey wrote: On Sun, 2008-11-23 at 05:34 -0800, John W. Krahn wrote: You shouldn't "do something with $line" if $bytes_read is undefined: while ( my $bytes_read = read PATTERN, $line, 1920 ) { unless ( defined $bytes_read ) { die "error reading $filename: $!";

Re: how to read file content into an array?

2008-11-23 Thread John W. Krahn
loody wrote: 2008/11/23 Chas. Owens <[EMAIL PROTECTED]>: On Nov 23, 2008, at 2:52, loody <[EMAIL PROTECTED]> wrote: The prototype of read is read FILEHANDLE,SCALAR,LENGTH ex: read PATTERN, $line, 1920; that means the $line will content 1920 bytes. if I want to modify the byte offset 720 of $

Re: how to read file content into an array?

2008-11-23 Thread Mr. Shawn H. Corey
On Sun, 2008-11-23 at 05:34 -0800, John W. Krahn wrote: > You shouldn't "do something with $line" if $bytes_read is undefined: > > while ( my $bytes_read = read PATTERN, $line, 1920 ) { > unless ( defined $bytes_read ) { > die "error reading $filename: $!"; > } > # do s

Re: how to read file content into an array?

2008-11-23 Thread John W. Krahn
Mr. Shawn H. Corey wrote: On Sun, 2008-11-23 at 15:52 +0800, loody wrote: The prototype of read is read FILEHANDLE,SCALAR,LENGTH ex: read PATTERN, $line, 1920; that means the $line will content 1920 bytes. It means it will attempt to read 1920 bytes. The actual number of bytes read is retur

Re: how to read file content into an array?

2008-11-23 Thread loody
2008/11/23 Chas. Owens <[EMAIL PROTECTED]>: > > > On Nov 23, 2008, at 2:52, loody <[EMAIL PROTECTED]> wrote: > >> Dear all: >> The prototype of read is >> read FILEHANDLE,SCALAR,LENGTH >> ex: >> read PATTERN, $line, 1920; >> >> that means the $line will content 1920 bytes. >> if I want to modify th

Re: Greedy v non greedy regexps in lookahead.

2008-11-23 Thread John W. Krahn
Andrew wrote: I am tying to expand some camel case with spaces - but I want multiple captitals to remain as one word. So I want "PerlNotesOnXML" -> "Perl Notes On XML" My attempt is to use [A-Z]+ in a lookahead. my $text = "PerlNotesOnXML" ; $text =~ s/(?=[A-Z]+)/ /gx ; print $text ; I

Re: Greedy v non greedy regexps in lookahead.

2008-11-23 Thread Mr. Shawn H. Corey
On Sun, 2008-11-23 at 11:52 +, Andrew wrote: > I am tying to expand some camel case with spaces - but I want multiple > captitals to remain as one word. So > I want "PerlNotesOnXML" -> "Perl Notes On XML" > > My attempt is to use [A-Z]+ in a lookahead. > > my $text = "PerlNotesOnXML" ; >

Re: how to read file content into an array?

2008-11-23 Thread Mr. Shawn H. Corey
On Sun, 2008-11-23 at 15:52 +0800, loody wrote: > Dear all: > The prototype of read is > read FILEHANDLE,SCALAR,LENGTH > ex: > read PATTERN, $line, 1920; > > that means the $line will content 1920 bytes. It means it will attempt to read 1920 bytes. The actual number of bytes read is returned. Y

Greedy v non greedy regexps in lookahead.

2008-11-23 Thread Andrew
I am tying to expand some camel case with spaces - but I want multiple captitals to remain as one word. So I want "PerlNotesOnXML" -> "Perl Notes On XML" My attempt is to use [A-Z]+ in a lookahead. my $text = "PerlNotesOnXML" ; $text =~ s/(?=[A-Z]+)/ /gx ; print $text ; I think I can se

Re: how to use perl compare 2 binary files?

2008-11-23 Thread John W. Krahn
loody wrote: Dear all: Hello, I try to use perl to compare 2 binary files, one is display content dump from Dram and another is display content calculated by my c-model code. I use open and binmode to open these 2 files, and use programs as below to do the comparison: $num_patter

Re: how to read file content into an array?

2008-11-23 Thread Chas. Owens
On Nov 23, 2008, at 2:52, loody <[EMAIL PROTECTED]> wrote: Dear all: The prototype of read is read FILEHANDLE,SCALAR,LENGTH ex: read PATTERN, $line, 1920; that means the $line will content 1920 bytes. if I want to modify the byte offset 720 of $line, it seems impossible, But happily it isn'