changing action with appended key/value pairs in a POST

2005-08-24 Thread Scott R. Godin
I have a multi-stage cgi I'm currently working on, and as I progress thru the stages (the form uses POST not GET for reasons of data-size) I was hoping to be able to simply add ?step=confirm or ?step=finish to the form action ( -action=$htmlform{action}?step=confirm, ... ) However it's not

reading a client file

2005-08-24 Thread Adriano Allora
hi to all, I need to read a file selected by (and stored in the computer of) users. My first idea was on uploaded files: (all variables are sent correctly; $_ is the name of the file $file is a relative pathname) s/.*[\/\\](.*)/$1/; $file =

$ENV{'HTTP_REFERER'}

2005-08-24 Thread Denzil Kruse
Hi, I want to know the web site that someone came from, and so I was planning on reading $ENV{'HTTP_REFERER'} to figure it out. How reliable is that? Do browsers or other situations block it or obfuscate it? Is there another way to do it or any other issues involved? I'm using apache on red

Re: $ENV{'HTTP_REFERER'}

2005-08-24 Thread Wiggins d'Anconia
Denzil Kruse wrote: Hi, I want to know the web site that someone came from, and so I was planning on reading $ENV{'HTTP_REFERER'} to figure it out. How reliable is that? Do browsers or other situations block it or obfuscate it? Is there another way to do it or any other issues

Re: $ENV{'HTTP_REFERER'}

2005-08-24 Thread David Dorward
On Wed, Aug 24, 2005 at 02:12:56PM -0700, Denzil Kruse wrote: I want to know the web site that someone came from, and so I was planning on reading $ENV{'HTTP_REFERER'} to figure it out. How reliable is that? Reliable enough for general interest and for finding some sites with links to moved

how to run perl class?

2005-08-24 Thread praba har
Dear All, I try to run a sampleclass example program in perl. But I received error. How to avoid it? The code is below: Package Person; sub new { my($type) = $_[0]; my($self) = {}; $self-{'name'} = $_[1]; bless($self, $type); return($self); } sub

Re: how to run perl class?

2005-08-24 Thread Muthukumar
On 8/24/05, praba har [EMAIL PROTECTED] wrote: Dear All, I try to run a sampleclass example program in perl. But I received error. How to avoid it? The code is below: Package Person; sub new { my($type) = $_[0]; my($self) = {}; $self-{'name'} = $_[1];

Re: how to run perl class?

2005-08-24 Thread Xavier Noria
On Aug 24, 2005, at 9:39, praba har wrote: Dear All, I try to run a sampleclass example program in perl. But I received error. How to avoid it? The code is below: Package Person; Perl is case-sensitive: package. Can't locate Person.pm in @INC (@INC contains: /Users/enmail/perl

String Length for password length testing?

2005-08-24 Thread Gavin Henry
Dear Guys, I am stuck at something really fundamental. I am coding a wee cgi page to change a OpenLDAP password, for Windows users on a Samba Server/LDAP backend. I haven't added any Net::LDAP stuff yet, just testing the basic password form. Would someone be so kind as to offer a simple reason

Re: String Length for password length testing?

2005-08-24 Thread Gavin Henry
Ok first of all, if you are working with numbers you use == = = !and since you want to check the length of the password, you are working with numbers. Another thing, you must get the lenght of the string, using length(); So you need to do it this way: if(length($newpasswd)6) { # do

Re: String Length for password length testing?

2005-08-24 Thread Paul Johnson
On Wed, Aug 24, 2005 at 11:49:14AM +0100, Gavin Henry wrote: Would someone be so kind as to offer a simple reason my test doesn't work? Should the le '6', I think so, but it never catches it? } elsif (length $newpasswd 6) { perldoc -f length perldoc perlop -- Paul Johnson - [EMAIL

Access denied

2005-08-24 Thread Kris Van Bruwaene
Can anyone help me with this, I've read FAQ7 but still can't figure out what's wrong here - I'm probably overlooking something very basic in linux permissions. The strange thing is, scripts are running merrily through an apache server on this machine, as long as they reside on a smb share (on

Reg ours,local,my declarations

2005-08-24 Thread praba har
Dear All, I am new perl. I want to know the difference between ours,local and my. I read lot of documentation regarding this. But still I cannot understand clearly. Kindly let me know with small example. regards Prabahar

Re: Reg ours,local,my declarations

2005-08-24 Thread Peter Scott
On Wed, 24 Aug 2005 13:16:54 +0100, Praba Har wrote: I am new perl. I want to know the difference between ours,local and my. I read lot of documentation regarding this. But still I cannot understand clearly. Kindly let me know with small example. Read

Re: Access denied

2005-08-24 Thread Kris Van Bruwaene
On 8/24/05, Raj, Raymond [EMAIL PROTECTED] wrote: give execute permission to your perl script I think it has! That's why I included: [~]# ls tst -l -rwxrwxr-x 1 kris users 39 2005-08-23 15:27 tst -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: String Length for password length testing?

2005-08-24 Thread Gavin Henry
quote who=Paul Johnson On Wed, Aug 24, 2005 at 11:49:14AM +0100, Gavin Henry wrote: Would someone be so kind as to offer a simple reason my test doesn't work? Should the le '6', I think so, but it never catches it? } elsif (length $newpasswd 6) { perldoc -f length perldoc perlop

Re: Access denied

2005-08-24 Thread Kris Van Bruwaene
On 8/24/05, David Van Ginneken [EMAIL PROTECTED] wrote: [~]# perl tst What happens? If that works. That works, it was included in my original posting. Try this: [~]# cat tst #!/usr/bin/perl -w print Hello world\n; Here goes: [~]# cat tst #!/usr/bin/perl -w print Hello world\n; [~]# ./tst

two way piped open

2005-08-24 Thread Bryan R Harris
I'd like to open 2-way pipe to a tool that we have here. It's called yprtool and once it's open, you give it 3 numbers to its STDIN and it spits out 3 numbers to its STDOUT. It stays open until you ctrl-c it. What's the correct syntax for opening something like this? This doesn't work:

Re: Perl examples

2005-08-24 Thread Randal L. Schwartz
Zentara == Zentara [EMAIL PROTECTED] writes: Zentara There are snippets galore at http://perlmonks.org And snippets with explanations (!) from my 240 magazine articles at http://www.stonehenge.com/merlyn/columns.html. You can use the google search box on any page there to search for code

Re: two way piped open

2005-08-24 Thread Wiggins d'Anconia
Bryan R Harris wrote: I'd like to open 2-way pipe to a tool that we have here. It's called yprtool and once it's open, you give it 3 numbers to its STDIN and it spits out 3 numbers to its STDOUT. It stays open until you ctrl-c it. What's the correct syntax for opening something like

Re: Packages for writing screen scrapers

2005-08-24 Thread Scott R. Godin
Siegfried Heintze wrote: [Siegfried Heintze] I've been using HTML::Parser with MySQL and I've had a lot of problems with (both RAM and disk) memory leaks and multi-threading. I was really disappointed, for example, discover that having multiple threads did not really speed things up at all. I

Re: two way piped open

2005-08-24 Thread Bryan R Harris
That does it, thanks, Wiggins! - B Bryan R Harris wrote: I'd like to open 2-way pipe to a tool that we have here. It's called yprtool and once it's open, you give it 3 numbers to its STDIN and it spits out 3 numbers to its STDOUT. It stays open until you ctrl-c it. What's the

Re: IO::Socket squirreliness

2005-08-24 Thread Mason Loring Bliss
On Tue, Aug 23, 2005 at 11:10:58AM -0400, Mason Loring Bliss wrote: Hi, all! I'm learning about dealing with sockets in Perl, and I've got a question about some unexpected behaviour exhibited by the following test script. In the case where I open a connection and then close it before

RE: IO::Socket squirreliness

2005-08-24 Thread Bob Showalter
Mason Loring Bliss wrote: On Tue, Aug 23, 2005 at 11:10:58AM -0400, Mason Loring Bliss wrote: Hi, all! I'm learning about dealing with sockets in Perl, and I've got a question about some unexpected behaviour exhibited by the following test script. In the case where I open a connection

RE: IO::Socket squirreliness

2005-08-24 Thread Bob Showalter
Bob Showalter wrote: I don't think there's any problem with IO::Socket. Even if accept returns a socket, you should receive an EOF on that socket when you try to read from it, which tells you that the peer has closed the connection. I think you just need to check for both situations: an error

Re: two way piped open

2005-08-24 Thread Bryan R Harris
And a follow-on question: Any idea why I have to send the yprtool two \ns instead of one to make it work? With just one it hangs... On the command line, it definitely works with just one. ** ($y,$p,$r) = (split(' ', $lines[15]))[11..13]; use IPC::Open2;

RE: two way piped open

2005-08-24 Thread Timothy Johnson
Just a thought, but this behavior might be caused by Perl buffering your output. Try selecting your file handle and then setting $| to 1. That way Perl should send your output immediately. -Original Message- From: Bryan R Harris [mailto:[EMAIL PROTECTED] Sent: Wednesday, August

odd benchmark result, map vs foreach

2005-08-24 Thread Scott R. Godin
Interesting .. I would have thought that map would be faster, but it appears that foreach is, in this instance. curious.. :) 4:52pm {193} localhost:/home/webadmin/$ perl bench.pl Benchmark: running Foreach, Map for at least 5 CPU seconds... Foreach: 9 wallclock secs ( 5.24 usr +

Re: two way piped open

2005-08-24 Thread Bryan R Harris
Makes sense, but that's not it, unfortunately. I tried it and it still hangs... Also, strangely, with the two \ns, the next time I try to write to the filehandle it says the pipe is broken. Here's sample output from the tool: ** ralph 2104% yprtool -l 90 0

Re: odd benchmark result, map vs foreach

2005-08-24 Thread Wiggins d'Anconia
Scott R. Godin wrote: Interesting .. I would have thought that map would be faster, but it appears that foreach is, in this instance. curious.. :) 4:52pm {193} localhost:/home/webadmin/$ perl bench.pl Benchmark: running Foreach, Map for at least 5 CPU seconds... Foreach: 9 wallclock

Re: odd benchmark result, map vs foreach

2005-08-24 Thread Wijnand Wiersma
And don't run the two test too soon after eachother, your operating system will cache some data. Also run all the tests multiple times. Wijnand -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: two way piped open

2005-08-24 Thread Bryan R Harris
Figured it out, Timothy had the right idea. The tool was buffering its output! - B Makes sense, but that's not it, unfortunately. I tried it and it still hangs... Also, strangely, with the two \ns, the next time I try to write to the filehandle it says the pipe is broken. Here's

using system to run ssh $host command

2005-08-24 Thread grover mitchell
Hi, I am trying to use system to run a command on a remote machine. system ssh, $remote_host[0], sudo, -u, nobody, /usr/bin/remote_command, --arg1, $arg1, --arg2, $arg2; The problem I run into is that perl will ssh into the remote host and give me a shell there, instead of running the remote

Re: odd benchmark result, map vs foreach

2005-08-24 Thread John W. Krahn
Scott R. Godin wrote: Interesting .. I would have thought that map would be faster, but it appears that foreach is, in this instance. curious.. :) 4:52pm {193} localhost:/home/webadmin/$ perl bench.pl Benchmark: running Foreach, Map for at least 5 CPU seconds... Foreach: 9 wallclock

Re: Perl examples

2005-08-24 Thread Gerard Robin
On Tue, Aug 23, 2005 at 02:14:25PM -0700 anu p wrote: It would be great if any one can suggest me some nice websites which have good practical perl examples. http://www.sthomas.net/oldpages/roberts-perl-tutorial.htm http://www.netcat.co.uk/rob/perl/win32perltut.html

dereferencing

2005-08-24 Thread Christopher Spears
I'm trying to brush up on my Perl by learning object oriented Perl! This may not be the best way to brush up on this subject, but I am sure that I will learn a lot! Here is a script: #!/usr/bin/perl -w use strict; my @array = [1, 2, ['a','b','c','d']]; my $arrayref = [EMAIL PROTECTED]; my

Re: dereferencing

2005-08-24 Thread John W. Krahn
Christopher Spears wrote: I'm trying to brush up on my Perl by learning object oriented Perl! This may not be the best way to brush up on this subject, but I am sure that I will learn a lot! Here is a script: #!/usr/bin/perl -w use strict; my @array = [1, 2, ['a','b','c','d']]; You

Re: dereferencing

2005-08-24 Thread Edward WIJAYA
On Thu, 25 Aug 2005 10:31:18 +0800, Christopher Spears [EMAIL PROTECTED] wrote: I'm trying to brush up on my Perl by learning object oriented Perl! This may not be the best way to brush up on this subject, but I am sure that I will learn a lot! Here is a script: #!/usr/bin/perl -w use

Re: using system to run ssh $host command

2005-08-24 Thread Wiggins d'Anconia
grover mitchell wrote: Hi, I am trying to use system to run a command on a remote machine. system ssh, $remote_host[0], sudo, -u, nobody, /usr/bin/remote_command, --arg1, $arg1, --arg2, $arg2; The problem I run into is that perl will ssh into the remote host and give me a shell there,

RE: using system to run ssh $host command

2005-08-24 Thread Dhanashri Bhate
- grover mitchell wrote: - Hi, - - I am trying to use system to run a command on a remote machine. - - system ssh, $remote_host[0], sudo, -u, nobody, - /usr/bin/remote_command, --arg1, $arg1, --arg2, $arg2; - - The problem I run into is that perl will ssh into the - remote host and -

Perl Interview Questions

2005-08-24 Thread praba har
Dear All, I am working as perl-cgi programmer in a small company. I got a call from the big company for Perl developer post. So I need perl related interview point of view questions. Kindly help me for this interview. regards Prabahar

Reg Closure in Perl

2005-08-24 Thread praba har
Dear All, Kindly let me know what is closure and why we need it. regards Prabahar Send a rakhi to your brother, buy gifts and win attractive prizes. Log on to

Re: Reg Closure in Perl

2005-08-24 Thread John W. Krahn
praba har wrote: Dear All, Hello, Kindly let me know what is closure and why we need it. perldoc -q closure John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Reg Closure in Perl

2005-08-24 Thread Chris Devers
On Thu, 25 Aug 2005, praba har wrote: Kindly let me know what is closure and why we need it. Kindly learn how to use a search engine. http://www.google.com/search?q=perl+closure The first two hits EXACTLY answer your question. perl.com: Achieving Closure What's a closure, and

Re: Perl Interview Questions

2005-08-24 Thread Chris Devers
On Thu, 25 Aug 2005, praba har wrote: I am working as perl-cgi programmer in a small company. I got a call from the big company for Perl developer post. So I need perl related interview point of view questions. Kindly help me for this interview. Explain what a closure is and why

Re: Perl Interview Questions

2005-08-24 Thread Ken Perl
What the name of the big company? On 8/25/05, Chris Devers [EMAIL PROTECTED] wrote: On Thu, 25 Aug 2005, praba har wrote: I am working as perl-cgi programmer in a small company. I got a call from the big company for Perl developer post. So I need perl related interview point of

RE: Perl Interview Questions

2005-08-24 Thread Dhanashri Bhate
Hello, pls don't mis-understand. There are perl gurus in this list as well as pther beginners like me , and they will surely help, but first at least show that you have taken some effort to learn Perl! If you say that you want a new job and someone should help you with the interview