Re: foreach loop current index

2005-05-20 Thread Peter Rabbitson
On Sat, May 21, 2005 at 12:11:42AM -0400, Chris Devers wrote: > On Fri, 20 May 2005, Peter Rabbitson wrote: > > > my @lsit = qw(a b c d); > > my %indexes; > > > > my $current_index = 0; > > > > foreach my $element (@list) { > > $indexes{$element} = $current_index; > > ++ $current_index; >

Re: foreach loop current index

2005-05-20 Thread Chris Devers
On Fri, 20 May 2005, Peter Rabbitson wrote: > my @lsit = qw(a b c d); > my %indexes; > > my $current_index = 0; > > foreach my $element (@list) { > $indexes{$element} = $current_index; > ++ $current_index; > } Ah. Maybe this? for (0 .. $#list) { $indexes{$list[$_]} = $_;

Re: foreach loop current index

2005-05-20 Thread Peter Rabbitson
> When perl executes a foreach loop, it creates some kind of array of all the > iterators and then goes over them one by one. Is the current index pointer > accessible from inside the loop? I was unable to find anything related in > perlvar. I think I should clarify myself a little. Here is an

Re: foreach loop current index

2005-05-20 Thread Chris Devers
On Fri, 20 May 2005, Peter Rabbitson wrote: > >foreach $item ( @list ) { > > sub( $item ); > >} > > > > Are you sure this is not a typo? Sorry, I didn't mean that literally, I was just trying to stub in an indicator for "do something useful with $item". In hindsight, foreach $i

Re: foreach loop current index

2005-05-20 Thread Peter Rabbitson
>foreach $item ( @list ) { > sub( $item ); >} > Are you sure this is not a typo? I've never seen a sub statement taking a list argument... Besides this is what I get if I run it anyway: [EMAIL PROTECTED]:~$ cat 123 @list = qw(a bc c); foreach $item ( @list ) { sub( $item );

Re: foreach loop current index

2005-05-20 Thread Chris Devers
On Fri, 20 May 2005, Peter Rabbitson wrote: > When perl executes a foreach loop, it creates some kind of array > of all the iterators and then goes over them one by one. Is the > current index pointer accessible from inside the loop? I was > unable to find anything related in perlvar. I think you

foreach loop current index

2005-05-20 Thread Peter Rabbitson
Hello, When perl executes a foreach loop, it creates some kind of array of all the iterators and then goes over them one by one. Is the current index pointer accessible from inside the loop? I was unable to find anything related in perlvar. Thanks for the input Peter P.S. I know it is trivi

undefined...

2005-05-20 Thread Ley, Chung
Hi, I have a piece of code which generates array of arrays which then is used to call the GD::Graph::Boxplot... For some reasons, I would have elements that is defined but has not value. I have been going thru the code to see if I had accidentally assigned null values or if I had accidentally

Errors on running Perl CGI scripts on Tomcat

2005-05-20 Thread Robert Kerry
I know this has been asked for millions of time, but I searched google for the entire day but did not get an answer, instead I found millions of ppl who have the same problem as I am. The problem is simple: 1. The same code runs well on command line 2. When Running on Tomcat, the html file gives su

Re: p. 561 in camel book.

2005-05-20 Thread John Doe
Am Freitag, 20. Mai 2005 02.52 schrieb Randal L. Schwartz: > > "Charles" == Charles K Clarkson <[EMAIL PROTECTED]> writes: > > Charles> So what should be written there? How does the OP untaint data > properly? > There is never a general answer to that question. "data" doesn't have > an "

Re: p. 561 in camel book.

2005-05-20 Thread John Doe
Am Freitag, 20. Mai 2005 01.24 schrieb Randal L. Schwartz: > > "John" == John Doe <[EMAIL PROTECTED]> writes: > > John> Imagine the above tainted() without the '#' in the evaled string, and > $data John> contains 'system ("rm -rf;")': > > John> 1. $nada would be executed > John> 2. the quotes a

Creating status bar

2005-05-20 Thread John Pretti
All, It has been some time since I posted, mainly because I do not have many Perl projects, but as always I am turning to you all for your infinite wisdom. I have written a web-based script that will promote files from a source server to a destination server utilizing rsync. I would like to add

FW: PERL/Apache

2005-05-20 Thread Nilay Puri, Noida
> Hi All, > > What are the necessary settings required in httpd.conf to use perl cgi > file thru Apache. > > > Thanks in advance > > > > Disclaimer: This message and any attachment(s) contained here are information that is confidential,proprietary to HCL Technologies and its customers

Re: PERL/Apache

2005-05-20 Thread Wiggins d'Anconia
Nilay Puri, Noida wrote: > Hi All, > > What are the necessary settings required in httpd.conf to use perl cgi file > thru Apache. > > > Thanks in advance > This is really more an Apache question than a Perl question since CGI can be written in any language, but you can look here: http://http

PERL/Apache

2005-05-20 Thread Nilay Puri, Noida
Hi All, What are the necessary settings required in httpd.conf to use perl cgi file thru Apache. Thanks in advance Disclaimer: This message and any attachment(s) contained here are information that is confidential,proprietary to HCL Technologies and its customers, privileged or otherwise

Re: Emulate "tail -f" on file

2005-05-20 Thread Wiggins d'Anconia
"Because it's up-side down. Why is that? It makes replies harder to read. Why not? Please don't top-post." - Sherm Pendley, Mac OS X list Tielman Koekemoer (TNE) wrote: > > Thanks all for your input. The File::Tail package works although it > seems to stop working once I restart the application

RE: on warning die

2005-05-20 Thread Peter Scott
On Fri, 20 May 2005 14:37:35 +0530, Ankur Gupta wrote: >> Hello beginners@perl.org, >> >> it is possible to setup somewhere, I want my script dies, if >> warning occurs. > > BEGIN { > $SIG{__WARN__} = sub{ print STDERR @_; exit 1}; > } > > warn "I am going to die\n"; The more modern (la

Re: win32 - *.lnk files

2005-05-20 Thread Ing. Branislav Gerzo
Ing. Branislav Gerzo [IBG], on Friday, May 20, 2005 at 09:24 (+0200) thinks about: IBG> I'd like to create over 10.000 *.lnk files. I didn't find any module IBG> for this, could someone help me ? (it could be also commandline IBG> utility ofcourse). IBG> Also anyone knows, if it is possible to cre

Re: on warning die

2005-05-20 Thread Ing. Branislav Gerzo
Ankur Gupta [AG], on Friday, May 20, 2005 at 14:37 (+0530) wrote the following: AG> BEGIN { AG> $SIG{__WARN__} = sub{ print STDERR @_; exit 1}; AG> } AG> warn "I am going to die\n"; AG> I hope you are looking for something like this. thanks a lot, this is exactly what I wanted. -- How d

RE: on warning die

2005-05-20 Thread Ankur Gupta
> Hello beginners@perl.org, > > it is possible to setup somewhere, I want my script dies, if > warning occurs. BEGIN { $SIG{__WARN__} = sub{ print STDERR @_; exit 1}; } warn "I am going to die\n"; I hope you are looking for something like this. --Ankur -- To unsubscribe, e-mail:

RE: Emulate "tail -f" on file

2005-05-20 Thread Tielman Koekemoer \(TNE\)
Thanks all for your input. The File::Tail package works although it seems to stop working once I restart the application writing to the logfile. I've played around with the settings but I'll have to take it up with the author. Thanks again! -Original Message- From: Chris Knipe [mailto:[

on warning die

2005-05-20 Thread Ing. Branislav Gerzo
Hello beginners@perl.org, it is possible to setup somewhere, I want my script dies, if warning occurs. Thanks -- --. ,-- ,- ICQ: 7552083 \|||/`//EB: www.2ge.us ,--' | - |--IRC: [2ge](. .),\\SN: 2ge!2ge_us `+==+=+===~ ~=-o00-(_)-00o-==

Re: Question about writing to excel file

2005-05-20 Thread Alok Bhatt
Hi All, I think I found the answer (checking at previous posts), I think I am going to use Spreadsheet::WriteExcel. Thanks, Alok --- Alok Bhatt <[EMAIL PROTECTED]> wrote: > Hi All, > > I am writing a script (needless to mention that it > is > in perl :)), that would read an excel file and sav

Question about writing to excel file

2005-05-20 Thread Alok Bhatt
Hi All, I am writing a script (needless to mention that it is in perl :)), that would read an excel file and save a copy of one of the sheet as another excel file and do processing on it. (Adding formats..etc). Can u please tell me which would be the best module to handle this. I have searched th

win32 - *.lnk files

2005-05-20 Thread Ing. Branislav Gerzo
Hi beginners@perl.org, I'd like to create over 10.000 *.lnk files. I didn't find any module for this, could someone help me ? (it could be also commandline utility ofcourse). Also anyone knows, if it is possible to create *.lnk files relative to original file? ("../../abc/orig.exe") Thanks for an