user sessions

2009-03-04 Thread Stanisław T. Findeisen
Hello, how to make user sessions? Something like: * log in using password * maintain session state across several executions of several scripts forming the application * log out Do I have to do it manually or is there something ready that you can recommend? Thank you. STF

Re: how to require() a file?

2009-03-04 Thread Stanisław T. Findeisen
Gunnar Hjalmarsson wrote: Stanisław T. Findeisen wrote: I am trying to require() a file using its absolute name. In command line mode everything works fine, but not in Apache: [Fri Feb 27 17:45:07 2009] [error] Can't locate /home/stf/public_html/test/arcv/public_html/../common.pl in @INC

Re: user sessions

2009-03-04 Thread Gunnar Hjalmarsson
Stanisław T. Findeisen wrote: Hello, how to make user sessions? Something like: * log in using password * maintain session state across several executions of several scripts forming the application * log out Do I have to do it manually or is there something ready that you can recommend?

Re: user sessions

2009-03-04 Thread Greg Jetter
On Wednesday 04 March 2009 12:24:39 am Stanisław T. Findeisen wrote: Hello, how to make user sessions? Something like: * log in using password * maintain session state across several executions of several scripts forming the application * log out Do I have to do it manually or is there

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

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 Group

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, -ramesh

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

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, how can I

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

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

Re: finding modules via @INC

2009-03-04 Thread Dermot
2009/3/3 sys...@wowway.com: 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

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

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 I use

Re: connecting to multiple hosts using Net::SSH2

2009-03-04 Thread Dermot
2009/3/4 monnappa appaiah monnapp...@gmail.com: 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

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

Re: Printing directory sizes

2009-03-04 Thread Dermot
2009/3/3 Wagner, David --- Senior Programmer Analyst --- CFS david.wag...@freight.fedex.com: -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

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 paik...@googlemail.com wrote: 2009/3/4 monnappa appaiah monnapp...@gmail.com: Hi all, Hi Hi i'm able to connect

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 Dermot
2009/3/4 monnappa appaiah monnapp...@gmail.com: 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

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:

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

Re: How to set env variable

2009-03-04 Thread Dermot
2009/3/4 ramesh.marimu...@wipro.com: 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

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:

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:

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

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

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

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

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:18DIR . 04.03.2009 19:18DIR ..

Re: Printing directory sizes

2009-03-04 Thread Dermot
2009/3/4 Lauri Nikkinen lauri.nikki...@iki.fi: 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    DIR  

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=STDIN; } } $theHL = 1; $theParent = 1; open (FILENAME, $nameoffile) or die cant open file\n; open

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

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:;

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=STDIN; chomp $nameoffile; } } You have a } there without

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,

Re: Printing directory sizes

2009-03-04 Thread Jim Gibson
On 3/4/09 Wed Mar 4, 2009 10:26 AM, Lauri Nikkinen lauri.nikki...@iki.fi 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

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

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=STDIN;         }} $theHL = 1; $theParent = 1; open