Re: I need scoping help

2009-03-04 Thread sf
On Mar 4, 11:47 am, stufor...@gmail.com (Sf) wrote: > this is my problem: variable theParent never updates - it always stays > "1" > > if ($ARGV[0] eq ""){ >         print STDOUT "Enter the filename and path you wish to use:"; >         $nameoffile=; >         }} > > $theHL = 1; > $theParent = "1";

Re: connecting to multiple hosts using Net::SSH2

2009-03-04 Thread Gunnar Hjalmarsson
monnappa appaiah wrote: This the error i'm getting Net::SSH2::connect: failed to connect to 10.10.10.1:22: Unknown error at connect.pl line 21 the line 21 is shown below $ssh2->connect($_) or warn "Unable to connect host $_\n" and next; It's apparent that the fatal error happens inside Net:

Re: Printing directory sizes

2009-03-04 Thread Jim Gibson
On 3/4/09 Wed Mar 4, 2009 10:26 AM, "Lauri Nikkinen" scribbled: > Ok, thanks, I wrote this based on your suggestions, and it seems to do what > I want. One further question, if you don't mind, how to format this so that > it prints sizes in megabytes, not in bits? How about dividing the result

Re: connecting to multiple hosts using Net::SSH2

2009-03-04 Thread monnappa appaiah
Hi Dermot, This the error i'm getting Net::SSH2::connect: failed to connect to 10.10.10.1:22: Unknown error at connect.pl line 21 the line 21 is shown below $ssh2->connect($_) or warn "Unable to connect host $_\n" and next; Thanks, Monnappa On Wed, Mar 4, 2009 at 5:44 PM, D

Re: I need scoping help

2009-03-04 Thread John W. Krahn
sf wrote: this is my problem: variable theParent never updates - it always stays "1" if ($ARGV[0] eq ""){ if ( @ARGV != 1 ) { print STDOUT "Enter the filename and path you wish to use:"; $nameoffile=; chomp $nameoffile; } } You have a } there without

Re: I need scoping help

2009-03-04 Thread Gunnar Hjalmarsson
sf wrote: this is my problem: variable theParent never updates - it always stays "1" You have bigger problems than that; for instance your program misses: use strict; use warnings; if ($ARGV[0] eq ""){ print STDOUT "Enter the filename and path you wish to use:"; $nam

Re: Printing directory sizes

2009-03-04 Thread Lauri Nikkinen
Ok, thanks, I wrote this based on your suggestions, and it seems to do what I want. One further question, if you don't mind, how to format this so that it prints sizes in megabytes, not in bits? ---code--- #!/bin/perl use warnings; use strict; use File::Find; my $dir = $ARGV[0]; die "You must su

I need scoping help

2009-03-04 Thread sf
this is my problem: variable theParent never updates - it always stays "1" if ($ARGV[0] eq ""){ print STDOUT "Enter the filename and path you wish to use:"; $nameoffile=; } } $theHL = 1; $theParent = "1"; open (FILENAME, "$nameoffile") or die "cant open file\n"; open (TOFI

Re: Printing directory sizes

2009-03-04 Thread Dermot
2009/3/4 Lauri Nikkinen : > Thank you for your post. That is quite there but not enough. See, I have > these directories and files in my C:\Perl\ folder > >  Volume in drive C has no label. >  Volume Serial Number is 248A-0894 > >  Directory of C:\Perl > > 04.03.2009  19:18      . > 04.03.2

Re: Printing directory sizes

2009-03-04 Thread Lauri Nikkinen
Thank you for your post. That is quite there but not enough. See, I have these directories and files in my C:\Perl\ folder Volume in drive C has no label. Volume Serial Number is 248A-0894 Directory of C:\Perl 04.03.2009 19:18 . 04.03.2009 19:18 .. 03.03.2009 21:4

MIME encoding and Mail::Sender (was: Sending email ...)

2009-03-04 Thread Gunnar Hjalmarsson
The discussion in this thread made me realize that I'd better update my own mail related module, CGI::ContactForm, as regards MIME encoding. An updated version has been uploaded to CPAN. http://search.cpan.org/dist/CGI-ContactForm/ On February 24, 2009 Octavian Râsnita wrote: Mail::Sender does

Re: finding modules via @INC

2009-03-04 Thread Gunnar Hjalmarsson
Jerald Sheets wrote: Gunnar Hjalmarsson wrote: Jerald Sheets wrote: In your code you can specify the directory location of the pm: use lib '/path/to/pm'; That makes no sense. It would cause Perl to look for /path/to/pm/XML/Handler/YAWriter.pm and the module would not be found. Note t

Re: finding modules via @INC

2009-03-04 Thread Jerald Sheets
Note that I took that example from a functioning program I have in the CNN environment. You say it doesn't work, I have six million viewers who say it does. enjoy. --j On Mar 4, 2009, at 7:38 AM, Gunnar Hjalmarsson wrote: Jerald Sheets wrote: In your code you can specify the directory

Re: connecting to multiple hosts using Net::SSH2

2009-03-04 Thread Jerald Sheets
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi there. My biggest comment isn't the answer to your question, but I will attempt to address that too. I really think you're doing yourself a disservice by just throwing your program commands on lines, not indenting according to best practic

Re: finding modules via @INC

2009-03-04 Thread Gunnar Hjalmarsson
Jerald Sheets wrote: In your code you can specify the directory location of the pm: use lib '/path/to/pm'; That makes no sense. It would cause Perl to look for /path/to/pm/XML/Handler/YAWriter.pm and the module would not be found. -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bi

Re: How to set env variable

2009-03-04 Thread Gunnar Hjalmarsson
ramesh.marimu...@wipro.com wrote: How to set env variable? I'm using PERL in WINDOWS. My question phrasing may be wrong. Actually my question is I need to run Perl from anywhere from my system. s/env variable/PATH/ Type help path -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/

Re: How to set env variable

2009-03-04 Thread Dermot
2009/3/4 : > Hi, > > How to set env variable? I'm using PERL in WINDOWS. > > My question phrasing may be wrong. > > Actually my question is I need to run Perl from anywhere from my system. Environment variables are stored in the %ENV hash. I don't want to tell you any more than that. I think, gi

Re: finding modules via @INC

2009-03-04 Thread Jerald Sheets
Keep in mind that perl only searches his known paths for perl modules. (/usr/lib in Linux, /Library/Perl in mac, etc.) In your code you can specify the directory location of the pm: use lib '/path/to/pm'; But then it'd need to be run from precisely the same place each and every time no mat

Re: finding modules via @INC

2009-03-04 Thread Gunnar Hjalmarsson
sys...@wowway.com wrote: I'm trying to use an XML pretty printer called xmlpretty ... http://groups.google.com/group/comp.lang.perl.misc/browse_thread/thread/5407c504591e0c4e Do not multi-post!! http://lipas.uwasa.fi/~ts/http/crospost.html -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi

Re: connecting to multiple hosts using Net::SSH2

2009-03-04 Thread Dermot
2009/3/4 monnappa appaiah : > Hi, > >    I tried that warn(and next) still its not logging into the next > host...Kindly help me with this It's a bit hard to help without seeing the errors. Do you see the warn message? Are you sure that it fails because the host is unreachable or coul

How to set env variable

2009-03-04 Thread ramesh.marimuthu
Hi, How to set env variable? I'm using PERL in WINDOWS. My question phrasing may be wrong. Actually my question is I need to run Perl from anywhere from my system. regards, -ramesh P Save a tree...please don't print this e-mail unless you really need to Please do not print this email unless

Re: connecting to multiple hosts using Net::SSH2

2009-03-04 Thread monnappa appaiah
Hi, I tried that warn(and next) still its not logging into the next host...Kindly help me with this Thanks, Monnappa On Wed, Mar 4, 2009 at 4:53 PM, Dermot wrote: > 2009/3/4 monnappa appaiah : > > Hi all, > Hi > > > Hi i'm able to connect to mulitple hosts now and it will log

Re: Printing directory sizes

2009-03-04 Thread Dermot
2009/3/3 Wagner, David --- Senior Programmer Analyst --- CFS : >> -Original Message- >> From: lauri.nikki...@gmail.com >> [mailto:lauri.nikki...@gmail.com] On Behalf Of Lauri Nikkinen >> Sent: Tuesday, March 03, 2009 11:38 >> To: Perl Beginners >> Subject: Printing directory sizes >> >> Hi,

RE: Printing directory sizes

2009-03-04 Thread Wagner, David --- Senior Programmer Analyst --- CFS
> -Original Message- > From: lauri.nikki...@gmail.com > [mailto:lauri.nikki...@gmail.com] On Behalf Of Lauri Nikkinen > Sent: Tuesday, March 03, 2009 11:38 > To: Perl Beginners > Subject: Printing directory sizes > > Hi, > > I'm trying to print directory sizes using script from > > http

Re: connecting to multiple hosts using Net::SSH2

2009-03-04 Thread Dermot
2009/3/4 monnappa appaiah : > Hi all, Hi > Hi i'm able to connect to mulitple hosts now and it will login to all the > hosts specified in the input file (input.txt) > > if there is a host which doesn't exist in input file (input.txt), the > program ends without going to the next host in the file

Re: calling a program from a perl script and redirecting to output to a file

2009-03-04 Thread rajgupta85
On Mar 2, 2:49 pm, teva...@gmail.com (Thomas Evangelidis) wrote: > Hi again, > > I'm digging out this thread cause it seems that my problem has been only > partially solved. Indeed "my @myout = `program file`;" can save the output > of my program to an array for parsing but this doesn't happen when

Re: connecting to multiple hosts using Net::SSH2

2009-03-04 Thread monnappa appaiah
Hi all, Hi i'm able to connect to mulitple hosts now and it will login to all the hosts specified in the input file (input.txt) if there is a host which doesn't exist in input file (input.txt), the program ends without going to the next host in the file for example: if the input.txt has three

Re: finding modules via @INC

2009-03-04 Thread Dermot
2009/3/3 : > I'm trying to use an XML pretty printer called xmlpretty on UNIX that > I downloaded from the net.  xmlpretty is a simple perl program that > uses a module called YAWriter.pm that came with the package.  So > xmlpretty has: > > use XML::Handler::YAWriter; > > However, with xmlpretty a

finding modules via @INC

2009-03-04 Thread sysdrk
I'm trying to use an XML pretty printer called xmlpretty on UNIX that I downloaded from the net. xmlpretty is a simple perl program that uses a module called YAWriter.pm that came with the package. So xmlpretty has: use XML::Handler::YAWriter; However, with xmlpretty and YAWriter.pm in the same

RE: Printing directory sizes

2009-03-04 Thread Wagner, David --- Senior Programmer Analyst --- CFS
From: lauri.nikki...@gmail.com [mailto:lauri.nikki...@gmail.com] On Behalf Of Lauri Nikkinen Sent: Tuesday, March 03, 2009 13:00 To: Chas. Owens Cc: Wagner, David --- Senior Programmer Analyst --- CFS; Perl Beginners Subje

RE: Printing directory sizes

2009-03-04 Thread Wagner, David --- Senior Programmer Analyst --- CFS
> -Original Message- > From: lauri.nikki...@gmail.com > [mailto:lauri.nikki...@gmail.com] On Behalf Of Lauri Nikkinen > Sent: Tuesday, March 03, 2009 12:10 > To: Wagner, David --- Senior Programmer Analyst --- CFS > Cc: Perl Beginners > Subject: Re: Printing directory sizes > > Thanks, ho

finding modules via @INC

2009-03-04 Thread sysdrk
I'm trying to use an XML pretty printer called xmlpretty on UNIX that I downloaded from the net. xmlpretty is a simple perl program that uses a module called YAWriter.pm that came with the package. So xmlpretty has: use XML::Handler::YAWriter; However, with xmlpretty and YAWriter.pm in the same

RE: Sleep

2009-03-04 Thread ramesh.marimuthu
Thank You. -Original Message- From: Taylor, Andrew (ASPIRE) [mailto:andrew.tayl...@hmrcaspire.com] Sent: Wednesday, March 04, 2009 3:51 PM To: beginners@perl.org Subject: RE: Sleep >Hi, > >How could I introduce a Sleep in Perl? Is there any specific function >for that? > >regards, >-ram

RE: Sleep

2009-03-04 Thread Taylor, Andrew (ASPIRE)
>Hi, > >How could I introduce a Sleep in Perl? Is there any specific function >for that? > >regards, >-ramesh Yes. It's called sleep sleep n - will sleep for n seconds (miss off the number and it'll sleep until interrupted) Capgemini is a trading name used by the Capgemini

Sleep

2009-03-04 Thread ramesh.marimuthu
Hi, How could I introduce a Sleep in Perl? Is there any specific function for that? regards, -ramesh P Save a tree...please don't print this e-mail unless you really need to Please do not print this email unless it is absolutely necessary. The information contained in this electronic message