Re: substitution from line in context to matched line

2008-08-14 Thread tony
On Aug 14, 5:48 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > - isn't an implicit array. Where did you read that? It's a read > operattion on the STDIN file handle. > Does this program help? > > Rob I was unclear, sorry about that. You're correct I meant there is an implicit 'loop' (not array!) wit

CPAN installation problem

2008-08-14 Thread cc96ai
I try to install some CPAN module, always get this error in command >Cpan -install Alert: While trying to 'parse' YAML file 'C:\Perl\cpan\FTPstats.yml' with 'YAML::XS' the following error was encountered: Usage: YAML::XS::LibYAML::Load(yaml_str) at C:\Perl\lib/YAML/XS.pm line 70. any id

why is empty hashref true?

2008-08-14 Thread Ryan Perry
my %hash=(test=>{}); print "true\n" if $hash{test}; # prints true How can I tell if it's empty? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: search and replace command with output

2008-08-14 Thread samrya
Xavier, Thanks for the tip but can you help me by pasting the code too? It might take 2 mins for you but I will have to fiddle with it longer :( Regards. On Aug 14, 6:02 am, [EMAIL PROTECTED] (Xavier Mas) wrote: > El Wednesday 13 August 2008 22:44:11 [EMAIL PROTECTED] va escriure: > > > Hi, > >

Re: Not able to open a file.

2008-08-14 Thread jis
On Aug 14, 1:30 pm, [EMAIL PROTECTED] (Rob Dixon) wrote: > jis wrote: > > On Aug 13, 7:46 pm, [EMAIL PROTECTED] (John W. Krahn) wrote: > >> jis wrote: > > >>> I simply could not open a file which is in the same path as my script > >>> is. > >>> i could open the file if i explicitly mention the path

Re: Wrong while{} loop, maybe!? I need help, please.

2008-08-14 Thread Nayab
On Aug 14, 2:15 pm, [EMAIL PROTECTED] wrote: > #!/usr/bin/perl -w > use strict; > use Authen::Simple::POP3; > > print "Enter POP3 server hostname: "; > chomp( my $host = ); > > my $pop3 = Authen::Simple::POP3->new( >     host => $host > ); > > my $pwdlst = "pass.txt"; > open( INPASS, $pwdlst ) ||

Re: Wrong while{} loop, maybe!? I need help, please.

2008-08-14 Thread Nayab
On Aug 14, 2:15 pm, [EMAIL PROTECTED] wrote: > #!/usr/bin/perl -w > use strict; > use Authen::Simple::POP3; > > print "Enter POP3 server hostname: "; > chomp( my $host = ); > > my $pop3 = Authen::Simple::POP3->new( >     host => $host > ); > > my $pwdlst = "pass.txt"; > open( INPASS, $pwdlst ) ||

Re: Not able to open a file.

2008-08-14 Thread Mr. Shawn H. Corey
On Thu, 2008-08-14 at 15:02 +0100, Jishnupraveen gira wrote: > > the error code is > > "Couldnt open C:/Program Files/Perl Express/Debug/pdef.txt - No such > file or directory" > > But my script is in the path: > C:\perl123 > > and the file pdef.txt is in the same path.. Try adding the foll

Re: substitution from line in context to matched line

2008-08-14 Thread John W. Krahn
tony wrote: Hello, Hello, gnu grep -C allows for output in context to the matched line is there an updated way to do this in perl using $. == $linenumber + context? I looked into the other thread that mentioned it, but none of the scripts worked. I tried the -00 switch and regex backreferenc

Re: Wrong while{} loop, maybe!? I need help, please.

2008-08-14 Thread Dr.Ruud
Rob Dixon schreef: > [EMAIL PROTECTED] wrote: >> close(INUSER); >> close(INPASS); > > There is no need to close open file handles at the end of the > program. If your program is written well there is never a need to > close them. While that is generally true for file handles that you only read fr

Re: Extracting data from log and reformating

2008-08-14 Thread Kashif Salman
On Wed, Aug 13, 2008 at 10:05 AM, John W. Krahn <[EMAIL PROTECTED]> wrote: > Kashif Salman wrote: > >> Greetings, >> > > Hello, > > I have a log file like so, and I am trying to get the date on the next >> line >> after "Start..." line. So for the log below I'd like to get the output >> >> 04/06/

Using MIME::Lite to send via SMTP

2008-08-14 Thread Mike Blezien
Hello, we've been trying to setup MIME::Lite to send email via SMTP but keep getting the following error: - SMTP auth() command failed: Incorrect authentication data - we have verified that the SMTP information, smtp host,

Re: Oraperl and DBI !

2008-08-14 Thread Rob Dixon
Amit Saxena wrote: > > I have read somewhere in web that Oraperl is a wrapper around DBI. > > To the best of my knowledge, I think that's not true because of following > reasons :- > > 1. Oraperl was much older compared to DBI > > 2. Not all DBI functions are available with Oraperl ! > > Please

RE: Oraperl and DBI !

2008-08-14 Thread Thomas Bätzler
Amit Saxena <[EMAIL PROTECTED]> wrote: > I have read somewhere in web that Oraperl is a wrapper around DBI. [...] > Please confirm. http://www.google.com/search?q=dbi+oraperl+history HTH, Thomas -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http:

Oraperl and DBI !

2008-08-14 Thread Amit Saxena
I have read somewhere in web that Oraperl is a wrapper around DBI. To the best of my knowledge, I think that's not true because of following reasons :- 1. Oraperl was much older compared to DBI 2. Not all DBI functions are available with Oraperl ! Please confirm. Thanks & Regards, Amit Saxena

RE: Execute the Linux command on remote machine

2008-08-14 Thread Irfan J Sayed (isayed)
Thanks Rob. I have downloaded all the files and now copying to the right directory. I will let you know once done. Regards Irfan. -Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED] Sent: Thursday, August 14, 2008 6:23 PM To: Perl Beginners Subject: Re: Execute the Linux comma

Re: Execute the Linux command on remote machine

2008-08-14 Thread Rob Dixon
Irfan J Sayed (isayed) wrote: > > Thanks for reply. > > I have Perl.pm installed in following path > [EMAIL PROTECTED] scripts]$ ls -l /tmp/Net/SSH/ > total 32 > -rwxr--r-- 1 cgadgil cgadgil 32724 Aug 13 06:42 Perl.pm > [EMAIL PROTECTED] scripts]$ > > And perl script I modified as follows > #! /u

Re: substitution from line in context to matched line

2008-08-14 Thread Rob Dixon
tony wrote: > > gnu grep -C allows for output in context to the matched line is there an > updated way to do this in perl using $. == $linenumber + context? I looked > into the other thread that mentioned it, but none of the scripts worked. > > I tried the -00 switch and regex backreferences with

Re: Not able to open a file.

2008-08-14 Thread Rob Dixon
jis wrote: > On Aug 13, 7:46 pm, [EMAIL PROTECTED] (John W. Krahn) wrote: >> jis wrote: >> >>> I simply could not open a file which is in the same path as my script >>> is. >>> i could open the file if i explicitly mention the path. but i dont >>> want that.. >>> my script is.. >>> use strict; >>>

Re: Wrong while{} loop, maybe!? I need help, please.

2008-08-14 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > > #!/usr/bin/perl -w > use strict; It is better to get into the habit of doing use warnings; instead of the -w swicth. > use Authen::Simple::POP3; > > print "Enter POP3 server hostname: "; > chomp( my $host = ); > > my $pop3 = Authen::Simple::POP3->new( > hos

Re: Not able to open a file.

2008-08-14 Thread Mr. Shawn H. Corey
On Thu, 2008-08-14 at 03:42 -0700, jis wrote: > > It did not make any difference. > it says there is no such file in the $Bin path.. > Ofcourse there is no such file in that path. i want to look in the > path iam executing the code. > > Any one can hep me! What is the error message? Please copy

Re: Wrong while{} loop, maybe!? I need help, please.

2008-08-14 Thread Mr. Shawn H. Corey
On Thu, 2008-08-14 at 02:15 -0700, [EMAIL PROTECTED] wrote: > # It's supposed to read first username from user.txt > # and try it against all the passwords from pass.txt, > # and then to move to the next username and run that > # against all the passwords, too, and so on...but it > # does not work

Re: perl to excel

2008-08-14 Thread Rob Dixon
DeeDee Messersmith wrote: > > Sorry guys and gals. I'm new and didn't reply to all. > > I tried this and I got a message that it could not find this repository. I > can't cut and paste the errors but when I start my PPM (windows XP) it says: > Downloading tcool packlistfailed 411 length requi

RE: Not able to open a file.

2008-08-14 Thread Stewart Anderson
> -Original Message- > From: Xavier Mas [mailto:[EMAIL PROTECTED] > Sent: 14 August 2008 12:00 > To: beginners@perl.org > Subject: Re: Not able to open a file. > > El Thursday 14 August 2008 12:42:15 jis va escriure: > > On Aug 13, 7:46 pm, [EMAIL PROTECTED] (John W. Krahn) wrote: > > > j

Re: perl to excel

2008-08-14 Thread Kevin Safford
Hello If you're using the GUI version of PPM, set the repository to this value: http://ppm.tcool.org/archives/See here for details:http://ppm.tcool.org/intro/register-- Kevin Safford -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.

RRD-Perl configuration on Windows!

2008-08-14 Thread Urvish Jain
Hi All, Scenario : I have perl script that works for Linux Performance monitoring to give graphs using RRD Tool. Problem: I have configured this perl script for windows platform, It creates rrd but the input file has some problem. Has anyone used rrd tool on windows through perl scrip

Re: Not able to open a file.

2008-08-14 Thread Xavier Mas
El Thursday 14 August 2008 12:42:15 jis va escriure: > On Aug 13, 7:46 pm, [EMAIL PROTECTED] (John W. Krahn) wrote: > > jis wrote: > > > Hi > > > > Hello, > > > > > I simply could not open a file which is in the same path as my script > > > is. > > > i could open the file if i explicitly mention th

Re: substitution from line in context to matched line

2008-08-14 Thread Xavier Mas
El Wednesday 13 August 2008 22:45:46 tony va escriure: > Hello, > > gnu grep -C allows for output in context to the matched line > is there an updated way to do this in perl using $. == $linenumber + > context? > I looked into the other thread that mentioned it, but none of the > scripts worked. >

Re: search and replace command with output

2008-08-14 Thread Xavier Mas
El Wednesday 13 August 2008 22:44:11 [EMAIL PROTECTED] va escriure: > Hi, > > I am trying to search & replace a string in a file using the below > perl command on unix. > > perl -pi -e 's/OLD/NEW/g' repltest.txt > > But I want the above command to display what lines were replaced. Is > it possible

Re: search and replace command with output

2008-08-14 Thread Mr. Shawn H. Corey
On Wed, 2008-08-13 at 13:44 -0700, [EMAIL PROTECTED] wrote: > Hi, > > I am trying to search & replace a string in a file using the below > perl command on unix. > > perl -pi -e 's/OLD/NEW/g' repltest.txt > > But I want the above command to display what lines were replaced. Is > it possible usin

Intermail perl

2008-08-14 Thread Pranaw Kumar
Hi , Does anybody know about the intermail perl. Regards, Pranaw Disclaimer: This message and the information contained herein is proprietary and confiden

Re: Not able to open a file.

2008-08-14 Thread jis
On Aug 13, 7:46 pm, [EMAIL PROTECTED] (John W. Krahn) wrote: > jis wrote: > > Hi > > Hello, > > > I simply could not open a file which is in the same path as my script > > is. > > i could open the file if i explicitly mention the path. but i dont > > want that.. > > > my script is.. > > >  use stri

Wrong while{} loop, maybe!? I need help, please.

2008-08-14 Thread shoneris
#!/usr/bin/perl -w use strict; use Authen::Simple::POP3; print "Enter POP3 server hostname: "; chomp( my $host = ); my $pop3 = Authen::Simple::POP3->new( host => $host ); my $pwdlst = "pass.txt"; open( INPASS, $pwdlst ) || die "\nERROR: Cannot open file \'$pwdlst\'! \n"; my $usrlst = "user

substitution from line in context to matched line

2008-08-14 Thread tony
Hello, gnu grep -C allows for output in context to the matched line is there an updated way to do this in perl using $. == $linenumber + context? I looked into the other thread that mentioned it, but none of the scripts worked. I tried the -00 switch and regex backreferences with $1, etc but thou

search and replace command with output

2008-08-14 Thread samrya
Hi, I am trying to search & replace a string in a file using the below perl command on unix. perl -pi -e 's/OLD/NEW/g' repltest.txt But I want the above command to display what lines were replaced. Is it possible using some switch options? If it is not possible using any of the switches, I don