how to get parameters from another form

2007-09-03 Thread Praveena Vittal
Hi All, I have a checkbox in a form named form.And one submit button in one form named form1 and another submit button in another form form 2. Is there any value to access the check box name in one form to another form? Regards, Praveena -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: how to get parameters from another form

2007-09-03 Thread Jeff Pang
2007/9/3, Praveena Vittal [EMAIL PROTECTED]: Hi All, I have a checkbox in a form named form.And one submit button in one form named form1 and another submit button in another form form 2. Is there any value to access the check box name in one form to another form? You can't submit two

Re: how to get parameters from another form

2007-09-03 Thread Praveena Vittal
Jeff Pang wrote, On 09/03/2007 12:50 PM: 2007/9/3, Praveena Vittal [EMAIL PROTECTED]: Hi All, I have a checkbox in a form named form.And one submit button in one form named form1 and another submit button in another form form 2. Is there any value to access the check box name in one form

RE: how to get parameters from another form

2007-09-03 Thread Andrew Curry
Whilst using strict perl you cant, you can via java script and pass those values. Its tricky to do but its possible -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 03 September 2007 09:15 To: beginners@perl.org Subject: Re: how to get parameters from another

Use tk

2007-09-03 Thread Somu
When we use tk, there is always the black DOS window. How can we make it disappear? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: how to get parameters from another form

2007-09-03 Thread Jeff Pang
2007/9/3, Praveena Vittal [EMAIL PROTECTED]: Jeff Pang wrote, On 09/03/2007 12:50 PM: 2007/9/3, Praveena Vittal [EMAIL PROTECTED]: Hi All, I have a checkbox in a form named form.And one submit button in one form named form1 and another submit button in another form form 2. Is

Passing variables to subroutine

2007-09-03 Thread sivasakthi
Hi All, I have tested the following script for reading the log files and write in to the file, #!/usr/bin/perl use strict; use warnings; use File::Tail; my $file=File::Tail-new(/log/path); while (defined(my $line=$file-read)) { my ($time,$lport,$ip,$stats,$rport)=split ,$line; writedata; sub

Re: Use tk

2007-09-03 Thread Chas Owens
On 9/3/07, Somu [EMAIL PROTECTED] wrote: When we use tk, there is always the black DOS window. How can we make it disappear? If you are also using Par::Packer you can pass --gui (or -g) to pp when you build the app. http://search.cpan.org/~smueller/PAR-Packer-0.976/lib/pp.pm -- To

Re: Passing variables to subroutine

2007-09-03 Thread Jeff Pang
2007/9/3, sivasakthi [EMAIL PROTECTED]: Hi All, I have tested the following script for reading the log files and write in to the file, #!/usr/bin/perl use strict; use warnings; use File::Tail; my $file=File::Tail-new(/log/path); while (defined(my $line=$file-read)) { my

RE: Use tk

2007-09-03 Thread Thomas Bätzler
Somu [EMAIL PROTECTED] asked: When we use tk, there is always the black DOS window. How can we make it disappear? If you're using ActiveState's Win32 port, you can use the wperl.exe binary instead of plain old perl.exe. HTH, Thomas -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

how to remove ^M character from every line

2007-09-03 Thread divya
Hi , A file generated on Windows machine is used on linux m/c while scripting. A sample line from the file is as shown: //---^M File name : project_name^M . Now in the perl script how can I remove ^M without running the command dos2unix.

RE: how to remove ^M character from every line

2007-09-03 Thread Andrew Curry
s/\r\n/\n/g If you want to replace it with a new lime ^M is \r\n -Original Message- From: divya [mailto:[EMAIL PROTECTED] Sent: 03 September 2007 12:57 To: beginners@perl.org Subject: how to remove ^M character from every line Hi , A file generated on Windows machine is used on linux

Re: how to remove ^M character from every line

2007-09-03 Thread Beginner
On 3 Sep 2007 at 17:26, divya wrote: A file generated on Windows machine is used on linux m/c while scripting. A sample line from the file is as shown: //---^M File name : project_name^M . Now in the perl script how can I remove

RE: how to remove ^M character from every line

2007-09-03 Thread Andrew Curry
That will just remove all space (\s+$) at the end of the file. \r \n are different -Original Message- From: Beginner [mailto:[EMAIL PROTECTED] Sent: 03 September 2007 12:57 To: beginners@perl.org Subject: Re: how to remove ^M character from every line On 3 Sep 2007 at 17:26, divya

Re: how to remove ^M character from every line

2007-09-03 Thread Rob Dixon
Andrew Curry wrote: From: Beginner [mailto:[EMAIL PROTECTED] On 3 Sep 2007 at 17:26, divya wrote: A file generated on Windows machine is used on linux m/c while scripting. A sample line from the file is as shown: //---^M File name :

Re: import CSV files in MYSQL

2007-09-03 Thread Ana
On 31 ago, 22:35, [EMAIL PROTECTED] (Jm) wrote: if you have access to the mysql client and server you don't need any modules, just use the load data sql command with all the requisite parameters. if you need to make a perl script for it, just use the standard dbd (or dbi, i forget currently

RE: how to remove ^M character from every line

2007-09-03 Thread Beginner
On 3 Sep 2007 at 13:38, Andrew Curry wrote: The problem is its unclear, its always better to be clear in code. It will also remove any formatting from the end of lines. If you wanted to be just as crude you can use chomp. I paritally agree that it could be un-clear. Perhaps s/\s+$//;

Shell qw(mysqldump) and localtime.

2007-09-03 Thread Shams Fantar
Hello, I want to give a date (the year, the day, the hour and the minute) to a file. So, I use localtime function. But I don't understand how to use localtime (after reading the documentation on this function). Can you help me with this function? Next, I want to use a shell command, so I

Re: how to remove ^M character from every line

2007-09-03 Thread Xavier Noria
Those ^Ms are \015s, which is \r practically everywhere. Note that line-oriented scripts almost work on CRLF text files on Unix because CRLF has a trailing \n by chance. I think this is unfortunate because instead of just breaking your program there's the annoying situation where you

Re: Shell qw(mysqldump) and localtime.

2007-09-03 Thread Jeff Pang
try the POSIX::strftime,this use the same datetime format as shell's date command. perl -e ' use POSIX qw/strftime/; print strftime(%y%m%d %H:%M,localtime); ' 070903 21:51 2007/9/3, Shams Fantar [EMAIL PROTECTED]: Hello, I want to give a date (the year, the day, the hour and the minute) to a

Re: Shell qw(mysqldump) and localtime.

2007-09-03 Thread Shams Fantar
Jeff Pang wrote: try the POSIX::strftime,this use the same datetime format as shell's date command. perl -e ' use POSIX qw/strftime/; print strftime(%y%m%d %H:%M,localtime); ' 070903 21:51 Okay. All right. use POSIX qw(strftime); my $date1 = strftime(%y/%m/%d %H:%M,localtime); my $FILE =

Re: Shell qw(mysqldump) and localtime.

2007-09-03 Thread Jeff Pang
2007/9/3, Shams Fantar [EMAIL PROTECTED]: Jeff Pang wrote: try the POSIX::strftime,this use the same datetime format as shell's date command. perl -e ' use POSIX qw/strftime/; print strftime(%y%m%d %H:%M,localtime); ' 070903 21:51 Okay. All right. use POSIX qw(strftime); my

Re: Shell qw(mysqldump) and localtime.

2007-09-03 Thread Shams Fantar
Jeff Pang wrote: 2007/9/3, Shams Fantar [EMAIL PROTECTED]: Jeff Pang wrote: try the POSIX::strftime,this use the same datetime format as shell's date command. perl -e ' use POSIX qw/strftime/; print strftime(%y%m%d %H:%M,localtime); ' 070903 21:51 Okay. All right. use POSIX

Regex help

2007-09-03 Thread Beginner
Hi, I am trying to come up with a regex to squash multiple commas into one. The line I am working on looks like this: SPEED OF LIGHT, , LIGHT SPEED,TRAVEL,TRAVELLING, , DANGER,DANGEROUS,PHYSICAL, , CONCEPT,CONCEPTS, , , , , , , , , , There are instances of /,\s{1,},/ and /,,/ The bit

Re: Random Image and Cache problem

2007-09-03 Thread Carl Miller
Thanks Gunnar and Mumia. I figured out that the problem is unique to Internet Explorer. The three other browsers I tried don't have this problem. But I can't get IE to not cache. I've tried these: print Cache-Control: no-cache\n; print Pragma: no-cache\n; # for HTTP/1.0 print

Re: Regex help

2007-09-03 Thread John W. Krahn
Beginner wrote: Hi, Hello, I am trying to come up with a regex to squash multiple commas into one. The line I am working on looks like this: SPEED OF LIGHT, , LIGHT SPEED,TRAVEL,TRAVELLING, , DANGER,DANGEROUS,PHYSICAL, , CONCEPT,CONCEPTS, , , , , , , , , , There are instances of

RE: Regex help

2007-09-03 Thread Andrew Curry
Christ That's certainly 1 way ;) -Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: 03 September 2007 16:11 To: Perl beginners Subject: Re: Regex help Beginner wrote: Hi, Hello, I am trying to come up with a regex to squash multiple commas into one. The line I

RE: Regex help

2007-09-03 Thread Andrew Curry
Think s/(\,+\s*)+/,/g; Should work It produces SPEED OF LIGHT,LIGHT SPEED,TRAVEL,TRAVELLING,DANGER,DANGEROUS,PHYSICAL,CONCEPT,CONCEPTS If that's what you want. -Original Message- From: Andrew Curry Sent: 03 September 2007 16:14 To: 'John W. Krahn'; Perl beginners Subject: RE: Regex

RE: Regex help

2007-09-03 Thread Beginner
On 3 Sep 2007 at 16:15, Andrew Curry wrote: Think s/(\,+\s*)+/,/g; Should work It produces SPEED OF LIGHT,LIGHT SPEED,TRAVEL,TRAVELLING,DANGER,DANGEROUS,PHYSICAL,CONCEPT,CONCEPTS If that's what you want. Exactly what I want. Thanx, Dp. -- To unsubscribe, e-mail: [EMAIL

Re: Random Image and Cache problem

2007-09-03 Thread Tom Phoenix
On 9/3/07, Carl Miller [EMAIL PROTECTED] wrote: I figured out that the problem is unique to Internet Explorer. The three other browsers I tried don't have this problem. But I can't get IE to not cache. Can anyone give some insight into where the problem might be? It's in Internet Explorer,

RE: Regex help

2007-09-03 Thread Beginner
On 3 Sep 2007 at 16:12, Andrew Curry wrote: $ perl -le' $_ = q[SPEED OF LIGHT, , LIGHT SPEED,TRAVEL,TRAVELLING, , DANGER,DANGEROUS,PHYSICAL, , CONCEPT,CONCEPTS, , , , , , , , , , ]; print; s/,\s*(?=,)//g; print; ' SPEED OF LIGHT, , LIGHT SPEED,TRAVEL,TRAVELLING, ,

Re: Regex help

2007-09-03 Thread John W. Krahn
Beginner wrote: On 3 Sep 2007 at 16:12, Andrew Curry wrote: Please do not attribute to Andrew Curry a post that was actually submitted by me (see my name at the end there.) TIA $ perl -le' $_ = q[SPEED OF LIGHT, , LIGHT SPEED,TRAVEL,TRAVELLING, , DANGER,DANGEROUS,PHYSICAL, ,

Re: Regex help

2007-09-03 Thread Rob Dixon
Beginner wrote: I am trying to come up with a regex to squash multiple commas into one. The line I am working on looks like this: SPEED OF LIGHT, , LIGHT SPEED,TRAVEL,TRAVELLING, , DANGER,DANGEROUS,PHYSICAL, , CONCEPT,CONCEPTS, , , , , , , , , , There are instances of /,\s{1,},/ and

Re: Regex help

2007-09-03 Thread John W. Krahn
Andrew Curry wrote: Think s/(\,+\s*)+/,/g; Commas are not special in a regular expression so there is no need to escape them. You are using capturing parentheses but are not using the string captured in $1, better to use non-capturing parentheses. s/(?:,+\s*)+/,/g; A modified pattern

Re: Regex help

2007-09-03 Thread John W. Krahn
[ Please do not top-post. TIA ] [EMAIL PROTECTED] wrote: Hi Hello, Unless Perl is the only tool available to you in your toolbox and if you're running Linux or similar consider the tr -s command in a shell. Perl also has that: tr/,//s; perldoc perlop However if you are strictly

Re: Random Image and Cache problem

2007-09-03 Thread Mumia W.
On 09/03/2007 10:06 AM, Carl Miller wrote: Thanks Gunnar and Mumia. I figured out that the problem is unique to Internet Explorer. The three other browsers I tried don't have this problem. But I can't get IE to not cache. I've tried these: print Cache-Control: no-cache\n; print

RE: Regex help

2007-09-03 Thread asmith9983
Hi Unless Perl is the only tool available to you in your toolbox and if you're running Linux or similar consider the tr -s command in a shell. However if you are strictly limited to Perl then this stand regex works:- echo ,|perl -ane 's/,*/,/;print' Try it by cutting and pasting it. No

Re: Shell qw(mysqldump) and localtime.

2007-09-03 Thread Adriano Ferreira
On 9/3/07, Shams Fantar [EMAIL PROTECTED] wrote: Hello, I want to give a date (the year, the day, the hour and the minute) to a file. So, I use localtime function. But I don't understand how to use localtime (after reading the documentation on this function). Can you help me with this

Re: Shell qw(mysqldump) and localtime.

2007-09-03 Thread Shams Fantar
Adriano Ferreira wrote: On 9/3/07, Shams Fantar [EMAIL PROTECTED] wrote: Hello, I want to give a date (the year, the day, the hour and the minute) to a file. So, I use localtime function. But I don't understand how to use localtime (after reading the documentation on this function). Can you

Re: how to remove ^M character from every line

2007-09-03 Thread Gunnar Hjalmarsson
divya wrote: A file generated on Windows machine is used on linux m/c while scripting. A sample line from the file is as shown: //---^M File name : project_name^M . Now in the perl script how can I remove ^M without running the command

Transform my algorithm in perl. Ideas?

2007-09-03 Thread Shams Fantar
Hi ! I have a problem at which I have no solution. Here is the algorithm : If there is a file in this directory which is old likewise of 10 days, to delete it or else, do nothing. Do you have ideas to say If there is a file which is old likewise of 10 days in perl? Best regards, --

Re: Transform my algorithm in perl. Ideas?

2007-09-03 Thread Tom Phoenix
On 9/3/07, Shams Fantar [EMAIL PROTECTED] wrote: Do you have ideas to say If there is a file which is old likewise of 10 days in perl? There are three timestamps that can mean the age of a file: the mtime, atime, and ctime. If you want to know how old the data in the file is, that's the mtime,

Re: Transform my algorithm in perl. Ideas?

2007-09-03 Thread Gunnar Hjalmarsson
Shams Fantar wrote: Here is the algorithm : If there is a file in this directory which is old likewise of 10 days, to delete it or else, do nothing. Do you have ideas to say If there is a file which is old likewise of 10 days in perl? opendir my $d, $dir or die $!; my @oldfiles =

Re: Transform my algorithm in perl. Ideas?

2007-09-03 Thread Ken Foskey
On Mon, 2007-09-03 at 21:56 +0200, Shams Fantar wrote: Hi ! I have a problem at which I have no solution. Here is the algorithm : If there is a file in this directory which is old likewise of 10 days, to delete it or else, do nothing. Do you have ideas to say If there is a file

Re: Transform my algorithm in perl. Ideas?

2007-09-03 Thread yitzle
On 9/3/07, Ken Foskey [EMAIL PROTECTED] wrote: On Mon, 2007-09-03 at 21:56 +0200, Shams Fantar wrote: Hi ! I have a problem at which I have no solution. Here is the algorithm : If there is a file in this directory which is old likewise of 10 days, to delete it or else, do nothing.

Re: Random Image and Cache problem

2007-09-03 Thread Dr.Ruud
Carl Miller schreef: The other website would call the perl script in an img tag, like so: img src=http://www.my_site.com/cgi-bin/random_banner.cgi; width=468 height=60 I've tried several perl scripts that basically work, but the problem is always the same with all of them: the browser

question about a routine

2007-09-03 Thread kenpeng
Hello,What're the meanings of this routine and why people need it?Thanks.sub make_accessor {my($package, $name) = @_;no strict qw(refs);my $code = EOT;*{$package\\::$name} = sub {my(\$self, \$value) = [EMAIL PROTECTED];if(defined \$value) {\$self-{$name} = \$value;}if(exists \$self-{$name})

Re: question about a routine (send again)

2007-09-03 Thread kenpeng
sorry send it again with plain text. sub make_accessor { my($package, $name) = @_; no strict qw(refs); my $code = EOT; *{$package\::$name} = sub { my($self, $value) = @_; if(defined $value) { $self-{$name} = $value; }

about variables destruction

2007-09-03 Thread lists user
When destructing a variable,one can say `$var = ''` or `$var = undef`,which way is good? like two cases follow, sub DESTROY { my $self = shift; $self-{array} = undef; } or sub DESTROY { my $self = shift; $self-{array} = ''; } Given $self-{array} is a large array's reference.

Re: about variables destruction

2007-09-03 Thread Randal L. Schwartz
lists == lists user [EMAIL PROTECTED] writes: lists When destructing a variable,one can say `$var = ''` or `$var = lists undef`,which way is good? lists like two cases follow, lists sub DESTROY lists { lists my $self = shift; lists $self-{array} = undef; lists } lists or lists sub