which modules to use?

2004-09-06 Thread Ing. Branislav Gerzo
Hi all, I am really new to CGI, my 1st question is, which Perl modules should I use for creating XHTML documents ? Write me, which one are good, where I can read more about this... Thanks. /Brano -=x=- Skontrolované antivírovým programom NOD32 -- To unsubscribe, e-mail: [EMAIL PROTECTED]

CGI.pm : Handling Carriage Returns from textarea()

2004-09-06 Thread Robert Page IV
I am trying to write a simple weekly entry CGI script and I am trying to capture a the string returned from a textarea, assign the value to either a variable or array and output it to a web page with print or printf or sprintf/print. When I do this, apparently carriage returns are either not

Re: CGI.pm : Handling Carriage Returns from textarea()

2004-09-06 Thread Sean Davis
White space (including carriage returns) is ignored by HTML, generally. Try surrounding your text output by the pre tag (preformatted text). Does this do what you want? Sean On 9/6/04 20:10, Robert Page IV [EMAIL PROTECTED] wrote: I am trying to write a simple weekly entry CGI script and I

Constructing form for SQL query dynamically

2004-09-06 Thread Sean Davis
I have a database of values, each of which belongs to one of several categories. I want to allow the user to choose one to several category/value pairs. In other words, I would like to be able to do stuff like A23, B5, and C7. I can do this with three list-boxes and corresponding text boxes,

Re: CGI.pm : Handling Carriage Returns from textarea()

2004-09-06 Thread Gunnar Hjalmarsson
Robert Page IV wrote: I am trying to write a simple weekly entry CGI script and I am trying to capture a the string returned from a textarea, assign the value to either a variable or array and output it to a web page with print or printf or sprintf/print. When I do this, apparently carriage

Re: which modules to use?

2004-09-06 Thread Chris Devers
On Mon, 6 Sep 2004, Ing. Branislav Gerzo wrote: I am really new to CGI, my 1st question is, which Perl modules should I use for creating XHTML documents ? Write me, which one are good, where I can read more about this... I believe that recent versions of CGI.pm should emit valid XHTML, which is

RE: which modules to use?

2004-09-06 Thread Charles K. Clarkson
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: : I am really new to CGI, my 1st question is, which : Perl modules should I use for creating XHTML : documents? Write me, which one are good, where I : can read more about this... CGI.pm is a good starting point. Some of us later abandon it for a

RE: CGI.pm : Handling Carriage Returns from textarea()

2004-09-06 Thread Charles K. Clarkson
Robert Page IV [EMAIL PROTECTED] wrote: : I am trying to write a simple weekly entry CGI script : and I am trying to capture a the string returned from : a textarea, assign the value to either a variable or : array and output it to a web page with print or printf : or sprintf/print. : : When I

A regex problem.

2004-09-06 Thread Denham Eva
Hello Gurus, In a script I have a piece of code as such:- * snip** my $filedate =~ s/(\d+)//g; * snip end *** The data I am parsing looks as such :- ** DATA C:/directory/MSISExport_20040814.csv

RE: A regex problem.

2004-09-06 Thread Jaffer Shaik
Hi, Try in this way. Just remove my, you will get it. $filedate = C:/directory/MSISExport_20040814.csv; ($filedate) =~ s/(\_\d+)//g; print $filedate\n; Thank you jaffer -Original Message- From: Denham Eva [mailto:[EMAIL PROTECTED] Sent: Monday, September 06, 2004 6:11 PM To: [EMAIL

Re: A regex problem.

2004-09-06 Thread Flemming Greve Skovengaard
Denham Eva wrote: Hello Gurus, In a script I have a piece of code as such:- * snip** my $filedate =~ s/(\d+)//g; Try this instead: my $filedate; if( $var_with_file_name =~ m/(\d+)\.csv$/ ) { $filedate = $1; } print $filename\n; * snip end ***

Splicing Hash problem

2004-09-06 Thread Edward WIJAYA
Hi, If I have this hash: %myhash = { '4 atc' = 'TGCGCatcGA', '5 ctg' = 'AGctgTGTTT', '3 NO MOTIF' = 'TCCGTGCGCT', '1 NO MOTIF' = 'ATGGTTAGGG', #need to splice this '2 caa' = 'GAAGcaaGGC' }; How can I take out/splice(?) the element of that

Re: Splicing Hash problem

2004-09-06 Thread Remo Sanges
On Sep 7, 2004, at 3:15 AM, Edward WIJAYA wrote: How can I take out/splice(?) the element of that hash that start with '1' and store it into another hash. So in the end I will have two hashes: %myNEWhash = { '1 NO MOTIF' = 'ATGGTTAGGG'}; and the current becomes: %myhash = { '4 atc' =

Re: Splicing Hash problem

2004-09-06 Thread Peter Scott
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Edward WIJAYA) writes: Hi, If I have this hash: %myhash = { '4 atc' = 'TGCGCatcGA', '5 ctg' = 'AGctgTGTTT', '3 NO MOTIF' = 'TCCGTGCGCT', '1 NO MOTIF' = 'ATGGTTAGGG', #need to splice this '2

RE: Splicing Hash problem

2004-09-06 Thread Thomas Bätzler
Edward WIJAYA [EMAIL PROTECTED] asked: How can I take out/splice(?) the element of that hash that start with '1' and store it into another hash. So in the end I will have two hashes: Off the top of my head, I'd say my @temp = grep /^1/, keys %myhash; my %myNEWhash; foreach my $k (@temp){

Re: A regex problem.

2004-09-06 Thread Gunnar Hjalmarsson
Jaffer Shaik wrote: Try in this way. Just remove my, you will get it. What kind of stupid advice is that? $filedate = C:/directory/MSISExport_20040814.csv; ($filedate) =~ s/(\_\d+)//g; Left aside that the parentheses are redundant, that does the opposite of what the OP asked for. -- Gunnar

Re: Splicing Hash problem - possible with map?

2004-09-06 Thread Edward WIJAYA
Hi, Thanks so much for the replies. If you literally mean starts with '1', i.e., you don't know any more about the key, Yes I literally mean 1 not 10, 100, etc. Just thought whether it is possible to do it with map function? Make it into one-liner? then first you must find the key, or use, say,

Re: Splicing Hash problem - possible with map?

2004-09-06 Thread Gunnar Hjalmarsson
Edward WIJAYA wrote: Just thought whether it is possible to do it with map function? Make it into one-liner? It is. my %myNEWhash = map { $_, delete $myhash{$_} } grep /^1\D/, keys %myhash; -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl -- To unsubscribe, e-mail:

Re: A regex problem.

2004-09-06 Thread Ing. Branislav Gerzo
Denham Eva [DE], on Monday, September 6, 2004 at 14:41 (+0200) typed: DE my $filedate =~ s/(\d+)//g; DE ** DATA DE C:/directory/MSISExport_20040814.csv DE C:/directory/MSISExport_20040813.csv DE Can someone help me with that regex? I am having a frustrating time of I hope

Re: Splicing Hash problem - possible with map?

2004-09-06 Thread John W. Krahn
Gunnar Hjalmarsson wrote: Edward WIJAYA wrote: Just thought whether it is possible to do it with map function? Make it into one-liner? It is. my %myNEWhash = map { $_, delete $myhash{$_} } grep /^1\D/, keys %myhash; Very good Gunnar! But the regexp may not work in all cases. my

Re: Splicing Hash problem - possible with map?

2004-09-06 Thread Jeff 'japhy' Pinyan
On Sep 6, John W. Krahn said: map { $_, delete $myhash{$_} } grep /^1\D/, keys %myhash; Very good Gunnar! But the regexp may not work in all cases. my %myNEWhash = map { $_, delete $myhash{$_} } grep /^1(?:\D|$)/, keys %myhash; That regex can also be written as /^1(?!\d)/, which reads

sub routine syntax

2004-09-06 Thread Mike Blezien
Hello All, We've been revamping alot of our older perl scripts and a question came up that I wasn't a 100% clear on. When calling sub routines, is there a significate difference in these formats: 1) some_subroutine(); 2) some_subroutine; 3) some_subroutine(); is one a more prefered or more

Re: sub routine syntax

2004-09-06 Thread Ing. Branislav Gerzo
Mike Blezien [MB], on Monday, September 06, 2004 at 15:40 (-0500) has on mind: MB 1) some_subroutine(); use this one. MB is one a more prefered or more effecient to use then the other(s)?? I think is a more prefered, about eficienty it is same. sub() is good only when it has the same name as

Re: sub routine syntax

2004-09-06 Thread Randy W. Sims
Mike Blezien wrote: Hello All, We've been revamping alot of our older perl scripts and a question came up that I wasn't a 100% clear on. When calling sub routines, is there a significate difference in these formats: 1) some_subroutine(); 2) some_subroutine; This syntax has the special property