Re: automate ssh login with Expect.pm

2007-09-11 Thread Chas Owens
On 9/11/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: snip > I modified the telnet script found at > http://search.cpan.org/~rgiersig/Expect-1.21/Expect.pod#The_examples_... > by replacing "Telnet" with "SSH". > > > This is a perl script to automate ssh login with Expect.pm, I try to > ssh to a

Re: automate ssh login with Expect.pm

2007-09-11 Thread wong_powah
On Sep 11, 3:47 pm, [EMAIL PROTECTED] (Chas Owens) wrote: > On 9/11/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > How to automate ssh login with Expect.pm? > > > I found an example to automate telnet login at > >http://search.cpan.org/~rgiersig/Expect-1.21/Expect.pod#The_examples_... >

Re: Avoiding $a and $b (was: array index)

2007-09-11 Thread Rob Dixon
Tom Phoenix wrote: On 9/11/07, Jeff Pang <[EMAIL PROTECTED]> wrote: Please don't use $a and $b as variable names,they are built-in variables used by `sort` function.see `perldoc -f sort`. It is true that $a and $b are special during sort. But when there's no sorting going on, can using them

Avoiding $a and $b (was: array index)

2007-09-11 Thread Tom Phoenix
On 9/11/07, Jeff Pang <[EMAIL PROTECTED]> wrote: > Please don't use $a and $b as variable names,they are built-in > variables used by `sort` function.see `perldoc -f sort`. It is true that $a and $b are special during sort. But when there's no sorting going on, can using them cause the programmer

Re: replace existing text within multiple text files: How?

2007-09-11 Thread Xavier Noria
On Sep 11, 2007, at 10:05 PM, Gerald Wheeler wrote: Correct That can be done with a one-liner: perl -0777 -pi.bak -e '$_ = q{new text goes here}' *.txt The options -p, -i, and -e are documented in perlrun. The flag -0777 has the side-effect of slurping the whole file into $_ (one file at

Re: perl script to scrape the job sites

2007-09-11 Thread Chas Owens
On 9/11/07, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > On 11 Sep 2007 at 15:15, Srinivas wrote: > > I want to write a perl script that scrapes various job sites like > > monster, dice, career builders etc. > > > > Given the job id and web site name it should scrape the information > > and store in

Re: replace existing text within multiple text files: How?

2007-09-11 Thread Chas Owens
On 9/11/07, Gerald Wheeler <[EMAIL PROTECTED]> wrote: > I have about 400 text files I need to replace the contents. All files > are in the current directory as the perl script runs out of snip What you need to do depends heavily on what you mean by "replace the contents". In general you can get a

Re: replace existing text within multiple text files: How?

2007-09-11 Thread Xavier Noria
On Sep 11, 2007, at 9:43 PM, Gerald Wheeler wrote: I have about 400 text files I need to replace the contents. All files are in the current directory as the perl script runs out of my $newText = "This is my new text.. anybody's text goes here"; open(INFILE, $plants) while (<>) { print $ne

Re: automate ssh login with Expect.pm

2007-09-11 Thread Chas Owens
On 9/11/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > How to automate ssh login with Expect.pm? > > I found an example to automate telnet login at > http://search.cpan.org/~rgiersig/Expect-1.21/Expect.pod#The_examples_in_the_tutorial_don > > I had done > yum install perl-Expect > yum install p

replace existing text within multiple text files: How?

2007-09-11 Thread Gerald Wheeler
I have about 400 text files I need to replace the contents. All files are in the current directory as the perl script runs out of my $newText = "This is my new text.. anybody's text goes here"; open(INFILE, $plants) while (<>) { print $newText; } I need help.. Thanks -- To unsubscribe,

Re: array index

2007-09-11 Thread Chas Owens
On 9/11/07, Jenda Krynicky <[EMAIL PROTECTED]> wrote: snip > OH MY ! > > Yet another reason to stay away from Perl6. > > After reading that part of S09 I can't keep from thinking that Perl6 > was designed specifically for golf and obfu. Well *. snip Heh. Perl 6 is going to meet a lot of resistanc

automate ssh login with Expect.pm

2007-09-11 Thread wong_powah
How to automate ssh login with Expect.pm? I found an example to automate telnet login at http://search.cpan.org/~rgiersig/Expect-1.21/Expect.pod#The_examples_in_the_tutorial_don I had done yum install perl-Expect yum install perl-Net-SSH My perl script is: #!/usr/bin/perl # use Expect; use Net::

Re: array index

2007-09-11 Thread Jenda Krynicky
On 11 Sep 2007 at 13:04, Chas Owens wrote: > Negative indexing has been around at least since Perl 5 (and I think > it goes back much farther than that). As for compatibility with > future versions of Perl, you should have no problem with the Perl 5 > line (e.g. 5.10, the next and possibly last Pe

Re: perl script to scrape the job sites

2007-09-11 Thread Jenda Krynicky
On 11 Sep 2007 at 15:15, Srinivas wrote: > I want to write a perl script that scrapes various job sites like > monster, dice, career builders etc. > > Given the job id and web site name it should scrape the information > and store in a mySQL database. And are you sure they won't mind? I don't wor

RE: POD question

2007-09-11 Thread Moon, John
Thank you... -Original Message- From: Chas Owens [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 11, 2007 1:53 PM To: Moon, John Cc: beginners@perl.org Subject: Re: POD question On 9/11/07, Moon, John <[EMAIL PROTECTED]> wrote: > I'm trying to single space lines in a POD but without s

Re: POD question

2007-09-11 Thread Chas Owens
On 9/11/07, Moon, John <[EMAIL PROTECTED]> wrote: > I'm trying to single space lines in a POD but without success... > Removing the blank lines yields one line of text. Any help will be > appreciated. snip Add a space (or spaces) before the lines =item d. The file looks like: =back =back =pod

POD question

2007-09-11 Thread Moon, John
I'm trying to single space lines in a POD but without success... Removing the blank lines yields one line of text. Any help will be appreciated. =item d. The file looks like:$ $ =back$ $ =back$ $ =pod$ $ 200708_200709101429$ $ 10-09-07 14:29$ $ L1$ $ =cut$ gives d. The file looks like:

Re: array index

2007-09-11 Thread Chas Owens
On 9/10/07, Pavanvithal Torvi <[EMAIL PROTECTED]> wrote: snip > If I make use of this feature will it cause compatibility issues with the > later versions of perl. snip Negative indexing has been around at least since Perl 5 (and I think it goes back much farther than that). As for compatibility

Re: Text::Aspell

2007-09-11 Thread Chas Owens
On 9/11/07, Beginner <[EMAIL PROTECTED]> wrote: snip > My version of Aspell is 0.60.5. My version of Text::Aspell is 0.08. > > I believe I am doing everything that the docs ask and you have > suggested. I think my installation might be broken some how. Would > you agree? snip At this point, yes, t

Re: Text::Aspell

2007-09-11 Thread Beginner
On 11 Sep 2007 at 10:04, Chas Owens wrote: > On 9/11/07, Beginner <[EMAIL PROTECTED]> wrote: > snip > Please do not type error messages. Copy and paste them instead. > Actually the rule should be, "don't type anything but your > commentary". > > snip > mkdir temp > cd temp > echo Aberystwyth >

Re: array index

2007-09-11 Thread Jeff Pang
2007/9/11, Pavanvithal Torvi <[EMAIL PROTECTED]>: > > > I wanted to ask others if this is expected behaviour. Yes. > If I make use of this feature will it cause compatibility issues with the > later versions of perl. > Please don't use $a and $b as variable names,they are built-in variables used

RE: array index

2007-09-11 Thread Thomas Bätzler
Pavanvithal Torvi <[EMAIL PROTECTED]> asked: > While debugging a script I came across a scenario where array > access was happening with a negative index. > (because of a corner case that was not properly handled). > This resulted in accessing the array in a reverse order. [...] > I wanted to ask

Re: Text::Aspell

2007-09-11 Thread Chas Owens
On 9/11/07, Beginner <[EMAIL PROTECTED]> wrote: snip > 1) That was a typo in the mail but I redid it to be sure snip Please do not type error messages. Copy and paste them instead. Actually the rule should be, "don't type anything but your commentary". snip > 2) I believe I have followed what y

array index

2007-09-11 Thread Pavanvithal Torvi
Hi, I am using perl on the linux platform (v5.8.0 built for i386-linux-thread-multi). While debugging a script I came across a scenario where array access was happening with a negative index. (because of a corner case that was not properly handled). This resulted in accessing the array in a rever

Re: Help with data returned by regex match

2007-09-11 Thread Chas Owens
On 9/11/07, kapil.V <[EMAIL PROTECTED]> wrote: > Hi, > > #!/usr/bin/perl -w > my $path = shift; > my $machine = shift; > my (undef,$country, $property) = split /\//,$path; > my $xmlData = qx!./pindown. php $machine!; > my @contacts = $xmlData =~ /property name=\"$property\ " > country=\"$country\ "

Re: Text::Aspell

2007-09-11 Thread Beginner
On 11 Sep 2007 at 9:25, Chas Owens wrote: > On 9/11/07, Dermot Paikkos <[EMAIL PROTECTED]> wrote: > > On 10 Sep 2007 at 12:52, Chas Owens wrote: ..snip > Three things: > 1. You are building dict.local, but the error message says local.dict > 2. Did you try my example and did it work? > 3. You ar

Re: perl script to scrape the job sites

2007-09-11 Thread Peter Scott
On Tue, 11 Sep 2007 15:15:51 +0530, Srinivas wrote: > I want to write a perl script that scrapes various job sites like > monster, dice, career builders etc. > > Given the job id and web site name it should scrape the information and > store in a mySQL database. > > Can you please tell me how

Re: Text::Aspell

2007-09-11 Thread Chas Owens
On 9/11/07, Dermot Paikkos <[EMAIL PROTECTED]> wrote: > On 10 Sep 2007 at 12:52, Chas Owens wrote: > > > On 9/10/07, Beginner <[EMAIL PROTECTED]> wrote: > > snip > > > Does anyone have any ideas why this isn't working? Could this be > > due > > > to an environment variable? > > snip > > > > Are you

Re: Help with data returned by regex match

2007-09-11 Thread Beginner
On 11 Sep 2007 at 11:36, kapil.V wrote: > Hi, > > #!/usr/bin/perl -w > my $path = shift; > my $machine = shift; > my (undef,$country, $property) = split /\//,$path; > my $xmlData = qx!./pindown. php $machine!; > my @contacts = $xmlData =~ /property name=\"$property\ " > country=\"$country\ ">.+?

RE: Help with data returned by regex match

2007-09-11 Thread Andrew Curry
What exactly are you trying to do and what values are you using for your test? -Original Message- From: kapil.V [mailto:[EMAIL PROTECTED] Sent: 11 September 2007 07:06 To: beginners@perl.org Subject: Help with data returned by regex match Hi, #!/usr/bin/perl -w my $path = shift; my $mach

Help with data returned by regex match

2007-09-11 Thread kapil.V
Hi, #!/usr/bin/perl -w my $path = shift; my $machine = shift; my (undef,$country, $property) = split /\//,$path; my $xmlData = qx!./pindown. php $machine!; my @contacts = $xmlData =~ /property name=\"$property\ " country=\"$country\ ">.+?.+?<\/contact> /is; #print "$&\n"; print @contacts; This

Re: perl script to scrape the job sites

2007-09-11 Thread Jeff Pang
2007/9/11, Srinivas <[EMAIL PROTECTED]>: > Hi, > > I want to write a perl script that scrapes various job sites like > monster, dice, career builders etc. > > Given the job id and web site name it should scrape the information and > store in a mySQL database. > > Can you please tell me how to do th

perl script to scrape the job sites

2007-09-11 Thread Srinivas
Hi, I want to write a perl script that scrapes various job sites like monster, dice, career builders etc. Given the job id and web site name it should scrape the information and store in a mySQL database. Can you please tell me how to do this , or is there any such script which does this.

Re: Text::Aspell

2007-09-11 Thread Dermot Paikkos
On 10 Sep 2007 at 12:52, Chas Owens wrote: > On 9/10/07, Beginner <[EMAIL PROTECTED]> wrote: > snip > > Does anyone have any ideas why this isn't working? Could this be > due > > to an environment variable? > snip > Are you sure you create (or updated) your dictionary correctly? ..snip It seems