Re: Passing a hash from a form field?

2007-05-01 Thread aneely
Bill Stephenson wrote: Take a look at the example scripts and docs... http://search.cpan.org/src/LDS/CGI.pm-3.29/examples/index.html http://search.cpan.org/src/LDS/CGI.pm-3.29/cgi_docs.html I'm pretty sure you'll find the syntax you need in those documents. Kindest Regards, -- Bill

Re: Passing a hash from a form field?

2007-05-01 Thread Mumia W.
On 04/30/2007 11:03 PM, [EMAIL PROTECTED] wrote: I actually have the book as well ('Official Guide to Programming with CGI.pm') and have practically torn it apart trying to find a way to do what I want. I've tracked down and read a number of articles and forum postings as well. I have a

Help downloading a file

2007-05-01 Thread Moon, John
Below is code I presently use to download to clients and the generated html. One client objects to the generated html - the Content-Disposition ... Does any one have another method to download AND display the pdf with perl. sub Display_PDF { my ($pdf, $pdf_size) = @_; $|=0; print

Re: Help downloading a file

2007-05-01 Thread Greg Jetter
On Tuesday May 1 2007 6:56 am, Moon, John wrote: Below is code I presently use to download to clients and the generated html. One client objects to the generated html - the Content-Disposition ... Does any one have another method to download AND display the pdf with perl. sub Display_PDF {

Re: Help downloading a file

2007-05-01 Thread Greg Jetter
On Tuesday May 1 2007 6:56 am, Moon, John wrote: Below is code I presently use to download to clients and the generated html. One client objects to the generated html - the Content-Disposition ... Does any one have another method to download AND display the pdf with perl. sub Display_PDF {

RE: Help downloading a file

2007-05-01 Thread Hellman, Matthew
The original intent was to generate a save-as dialog box instead of displaying the PDF inline? I believe the problem with this is that it can cause blank browser windows to open, which some people don't like. This is a browser issue and I'm not aware of an alternative. Removing the

Re: Passing a hash from a form field?

2007-05-01 Thread aneely
Mumia W. wrote: On 04/30/2007 11:03 PM, [EMAIL PROTECTED] wrote: I actually have the book as well ('Official Guide to Programming with CGI.pm') and have practically torn it apart trying to find a way to do what I want. I've tracked down and read a number of articles and forum postings as

Odd select box behaviour

2007-05-01 Thread aneely
This one has me stumped, and it shouldn't. I'm trying to validate data from a simple select box: select size=1 name=country option selected value='United States'United States/option option value='Canada'Canada/option /select When I do: foreach my $Item (param()) { my

Binary search

2007-05-01 Thread yaron
Hi all, Is there a perl built in function that search a value in sorted array? Although I found such an algorithm in the cpan (Search::Binary), I wonder if there is an efficient solution within the core perl. Thanks in advanced, Yaron Kahanovitch -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: Binary search

2007-05-01 Thread Jeff Pang
2007/5/1, [EMAIL PROTECTED] [EMAIL PROTECTED]: Hi all, Is there a perl built in function that search a value in sorted array? Although I found such an algorithm in the cpan (Search::Binary), I wonder if there is an efficient solution within the core perl. For large array which was sorted

perl and postgres

2007-05-01 Thread Maphin Philip
I am using postgres8.2 in netbsd OS 1.How to install perl here? 2.Can we use perl programs for manipulating data in postgres database Thanks

Re: perl and postgres

2007-05-01 Thread Jeff Pang
2007/5/1, Maphin Philip [EMAIL PROTECTED]: 1.How to install perl here? 2.Can we use perl programs for manipulating data in postgres database Hello, 1. Google it with keyword how to install perl on netbsd. 2. Surely you can.Please check the modules on CPAN like DBI. -- Chinese Practical

Re: unit messages

2007-05-01 Thread oryann9
#!/usr/bin/perl use strict; use warnings; my @a = qw(abc def ghi); for my $s (@a) { $s =~ /(b)|(e)|(h)/; print 1 = [$1] 2 = [$2] 3 = [$3]\n; } Thank you for the kind replies. I understand now and have modified the code to: use strict; use warnings; my $jfsFile =

Re: unit messages

2007-05-01 Thread Chas Owens
On 5/1/07, oryann9 [EMAIL PROTECTED] wrote: snip my $regexp = qr/(host:\w+)/is; my $regexp1 = qr/(onlinejfs.*)/is; my $regexp2 = qr/(jfs\sversion.*)/is; snip Why are you creating these regexes so far from where they are used? If you are going to do this at least give them meaningful names.

Re: perl and postgres

2007-05-01 Thread Francisco Valladolid H.
Hi, I'm a NetBSD user. Maphin Philip [EMAIL PROTECTED] wrote: I am using postgres8.2 in netbsd OS 1.How to install perl here? Maybe it be a OT but it ca do here: You can ask in private mail ok and can mail all info need for run perl wit postgresql. 2.Can we use perl

Re: perl and postgres

2007-05-01 Thread Rodrick Brown
On 5/1/07, Maphin Philip [EMAIL PROTECTED] wrote: I am using postgres8.2 in netbsd OS 1.How to install perl here? Look at your netbsd ports collection documentation on how to install software on your system using the facility. 2.Can we use perl programs for manipulating data in

Re: unit messages

2007-05-01 Thread oryann9
Why are you creating these regexes so far from where they are used? If you are going to do this at least give them meaningful names. I dont have a good reason Chas other than I like the ability to easily change the variable in one spot in case of future use. If this is not a good

Regexp problem

2007-05-01 Thread Somu
Hi, i have a matching problem. I get input from the user as a 3-5 character long string consisting of characters from 'l' to 't', and the chars are always sorted for example, the user enters: 'lrqo'. It becomes: 'loqr'. But i have to match the modified string to any of the following: lmn, lpt,

Re: Regexp problem

2007-05-01 Thread Jeff Pang
2007/5/2, Somu [EMAIL PROTECTED]: Hi, i have a matching problem. I get input from the user as a 3-5 character long string consisting of characters from 'l' to 't', and the chars are always sorted for example, the user enters: 'lrqo'. It becomes: 'loqr'. But i have to match the modified string

Re: Regexp problem

2007-05-01 Thread Tom Phoenix
On 5/1/07, Somu [EMAIL PROTECTED] wrote: Hi, i have a matching problem. I get input from the user as a 3-5 character long string consisting of characters from 'l' to 't', and the chars are always sorted for example, the user enters: 'lrqo'. It becomes: 'loqr'. But i have to match the modified

Illegal use of undefined subroutine..

2007-05-01 Thread Somu
my $s = ; my $t = ; conc ( $s , $t ); sub conc { my $str = $_[0].$_[1]; print $str; } Why? It works allright only after add an extra line at the top, that is sub conc; its become just like C -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Illegal use of undefined subroutine..

2007-05-01 Thread Tom Phoenix
On 5/1/07, Somu [EMAIL PROTECTED] wrote: my $s = ; my $t = ; conc ( $s , $t ); sub conc { my $str = $_[0].$_[1]; print $str; } Why? Why not? It works allright only after add an extra line at the top, that is sub conc; its become just like C Are you asking a question? Perhaps

Re: Regexp problem

2007-05-01 Thread Howard Sherman
#!/usr/bin/perl use strict; my @Strings = qw(lmn lpt lor mps npr nqt opq rst); chomp(my $Input = STDIN); my $SortedChars = join , sort (split //, $Input); foreach (@Strings) { if ($SortedChars =~ /$_/) { print Got a match for $Input with $_\n;

Re: Illegal use of undefined subroutine..

2007-05-01 Thread Chas Owens
On 5/1/07, Chas Owens [EMAIL PROTECTED] wrote: On 5/1/07, Somu [EMAIL PROTECTED] wrote: my $s = ; my $t = ; conc ( $s , $t ); sub conc { my $str = $_[0].$_[1]; print $str; } Why? It works allright only after add an extra line at the top, that is sub conc; its become just

Re: Illegal use of undefined subroutine..

2007-05-01 Thread Chas Owens
On 5/1/07, Somu [EMAIL PROTECTED] wrote: my $s = ; my $t = ; conc ( $s , $t ); sub conc { my $str = $_[0].$_[1]; print $str; } Why? It works allright only after add an extra line at the top, that is sub conc; its become just like C Your code works just fine for me (no errors).

Re: Illegal use of undefined subroutine..

2007-05-01 Thread Somu
Actually, that was just an example to explain my problem. I am facing this problem when i use Tk. Any subroutine associated with the -command option of a button widget. use Tk; my $mw = MainWindow-new; my $b = $mw-Button(-text='hello',-command=sub { welcome })-pack; my $l =

Re: Illegal use of undefined subroutine..

2007-05-01 Thread Somu
Because if define it, it says 'Global variable $l needs...' what do i do? Actually, i am not happy nor sad that the subroutine needed a declaration before use.. I'm using ActivePerl 5.8.8 on Windows XP -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: Regexp problem

2007-05-01 Thread Somu
Thats where the problem arises my $input = 'loqr'; if ( $input =~ m!lor!i ) {print 'match'} how will that match? i want them to match. Thats what i want to do. by the way, can i get some url where i can get lots of problems and solutions on regexp. I'm very weak in it.. -- To unsubscribe,

Re: perl and postgres

2007-05-01 Thread Francisco Valladolid H.
Hi, I'm using NetBSD in both, test and production enviroment. there are many resources for setup perl, and PgPP, DBI, DBD::Pg and Pg module. This is a OT, but if you sendme a private mail, maybe can help you. the http://wiki.netbsd.se have many tutorials for setting a

Re: Illegal use of undefined subroutine..

2007-05-01 Thread John W. Krahn
Somu wrote: Actually, that was just an example to explain my problem. I am facing this problem when i use Tk. Any subroutine associated with the -command option of a button widget. use Tk; my $mw = MainWindow-new; my $b = $mw-Button(-text='hello',-command=sub { welcome })-pack; my $l =

Re: Regexp problem

2007-05-01 Thread Tom Phoenix
On 5/1/07, Somu [EMAIL PROTECTED] wrote: my $input = 'loqr'; if ( $input =~ m!lor!i ) {print 'match'} how will that match? i want them to match. Thats what i want to do. You can add the 'q' to the pattern. Is this what you want? if ( $input =~ /loqr/i ) { print 'match' } Or you can

Capturing an external program return code

2007-05-01 Thread Vladimir Lemberg
Hi All, My script is executing external program, which returns code i.e 0, -1, -2, -3 etc In case of error, I need to create log file according to error code. For example code -3 means missing input file use strict; use warnings; use Win32; system ( $program -f $program.cfg ); if ($? ==

Re: Illegal use of undefined subroutine..

2007-05-01 Thread Chas Owens
On 5/1/07, Somu [EMAIL PROTECTED] wrote: Actually, that was just an example to explain my problem. I am facing this problem when i use Tk. Any subroutine associated with the -command option of a button widget. use Tk; my $mw = MainWindow-new; my $b = $mw-Button(-text='hello',-command=sub {

Re: Capturing an external program return code

2007-05-01 Thread Chas Owens
On 5/1/07, Vladimir Lemberg [EMAIL PROTECTED] wrote: snip This is not working. Nothing is printing to the log file when I'm simulating -3 code. If I print $?, it shown 65280. snip from perldoc -f system: if ($? == -1) { print failed to execute: $!\n; } elsif ($? 127) {

Re: Capturing an external program return code

2007-05-01 Thread Tom Phoenix
On 5/1/07, Vladimir Lemberg [EMAIL PROTECTED] wrote: My script is executing external program, which returns code i.e 0, -1, -2, -3 etc if ($? == -3) { This is not working. Nothing is printing to the log file when I'm simulating -3 code. If I print $?, it shown 65280. The value in $? is

Re: Capturing an external program return code

2007-05-01 Thread Vladimir Lemberg
Hi Tom, That was very helpful. Thanks a lot, Vladimir - Original Message - From: Tom Phoenix [EMAIL PROTECTED] To: Vladimir Lemberg [EMAIL PROTECTED] Cc: beginners@perl.org Sent: Tuesday, May 01, 2007 5:36 PM Subject: Re: Capturing an external program return code On 5/1/07,

Re: Capturing an external program return code

2007-05-01 Thread Mumia W.
On 05/01/2007 07:09 PM, Vladimir Lemberg wrote: [...] system ( $program -f $program.cfg ); if ($? == -3) { [...] You're facing two problems: the return value for system() needs to be shifted right by eight bits; and that value is provided in unsigned form, so you have to massage it: my