Re: Tk disabling menu entries

2008-02-12 Thread John W. Krahn
MK wrote: Amazingly, what worked in the end was simply adding -state=> 'disabled' into the actual $menu->command, hence avoiding the documented "entryconfigure" method or cget altogether but if anyone has any patience left could you explain: my $state = ($count++ & 1) ? 'normal' : 'disabled

Re: How can a simple loop be speed up faster than 1 second?

2008-02-12 Thread Chas. Owens
On Feb 12, 2008 11:37 PM, <[EMAIL PROTECTED]> wrote: > I hope this isn't some horribly difficult task... > > Can a perl while loop be sped up faster than 1 second intervals? > > I recall something about various modules that allow time to be keep in > finer granularity but can things like unlink o

Re: How can a simple loop be speed up faster than 1 second?

2008-02-12 Thread yitzle
What are you trying to do? $ time perl -e 'print "$_\n" for (1..100);' That takes about 5 milliseconds on my ultra-fast PC. 100 loops. 5 milliseconds. A second per loop? You can slow it down if you want to... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL P

How can a simple loop be speed up faster than 1 second?

2008-02-12 Thread reader
I hope this isn't some horribly difficult task... Can a perl while loop be sped up faster than 1 second intervals? I recall something about various modules that allow time to be keep in finer granularity but can things like unlink or whatever be made to run faster than one second intervals.

Re: Tk disabling menu entries

2008-02-12 Thread MK
Amazingly, what worked in the end was simply adding -state=> 'disabled' into the actual $menu->command, hence avoiding the documented "entryconfigure" method or cget altogether but if anyone has any patience left could you explain: my $state = ($count++ & 1) ? 'normal' : 'disabled'; to me,

Re: Tk disabling menu entries

2008-02-12 Thread MK
On 02/12/2008 12:49:30 PM, kens wrote: -> On Feb 12, 9:48 am, [EMAIL PROTECTED] (Mk) wrote: -> > sorry, zentara, but with my perl 5.8.8 this script first produces: -> > -> > Bareword "Mainloop" not allowed while "strict subs" in use at -> > ./Tkmenuentryconfigure.pl line 25 -> > -> > And even afte

Re: Tk disabling menu entries

2008-02-12 Thread kens
On Feb 12, 9:48 am, [EMAIL PROTECTED] (Mk) wrote: > sorry, zentara, but with my perl 5.8.8 this script first produces: > > Bareword "Mainloop" not allowed while "strict subs" in use at > ./Tkmenuentryconfigure.pl line 25 > > And even after i delete "use strict" i now get: > > Useless use of a const

Re: Tokenizing a string

2008-02-12 Thread David Moreno
On Feb 12, 2008 4:01 AM, Dr.Ruud <[EMAIL PROTECTED]> wrote: > "David Moreno" schreef: > > > rvtol+news: > > Stop top-posting. Stop inline posting :p > The question was about a string that looks very much like a path and > filename. > If it is about a path and filename, then there can be platfo

Re: cgi upload -> XMLin

2008-02-12 Thread Gunnar Hjalmarsson
Brent Clark wrote: I would like to upload a xml file, and would like the file to sent directly to XMLin(). Im trying to find a way of not have to create the file in /tmp, Then assign some other path to $CGITempFile::TMPDIRECTORY As Chas mentioned, you can pass $upload_filehandle to XMLin().

Re: lstat and its uses

2008-02-12 Thread Michael Barnes
Chas. Owens told me on 02/12/2008 12:30 PM: > On Feb 12, 2008 1:08 PM, Kashif Salman <[EMAIL PROTECTED]> wrote: >> On Feb 12, 2008 9:58 AM, Chas. Owens <[EMAIL PROTECTED]> wrote: >>> On Feb 12, 2008 12:38 PM, Michael Barnes <[EMAIL PROTECTED]> wrote: >>> snip I'm the new kid and this is a be

Re: Tk disabling menu entries

2008-02-12 Thread Rob Dixon
MK wrote: > zentara wrote: >> [EMAIL PROTECTED] (MK) wrote: no matter where i use: $menu->entryconfigure(#,"disabled); i get: Can't locate object method "entryconfigure" via package "Tk::Menu::Cascade" unless i use it on a non-existent $menu, in which case i get: Can't call method "entry

Re: lstat and its uses

2008-02-12 Thread Chas. Owens
On Feb 12, 2008 1:08 PM, Kashif Salman <[EMAIL PROTECTED]> wrote: > > On Feb 12, 2008 9:58 AM, Chas. Owens <[EMAIL PROTECTED]> wrote: > > On Feb 12, 2008 12:38 PM, Michael Barnes <[EMAIL PROTECTED]> wrote: > > snip > > > I'm the new kid and this is a beginners forum, so I welcome all ideas > > > an

Re: lstat and its uses

2008-02-12 Thread Kashif Salman
On Feb 12, 2008 9:58 AM, Chas. Owens <[EMAIL PROTECTED]> wrote: > On Feb 12, 2008 12:38 PM, Michael Barnes <[EMAIL PROTECTED]> wrote: > snip > > I'm the new kid and this is a beginners forum, so I welcome all ideas > > and options. Forgiving my ignorance, would you mind giving an example > > of ho

Re: lstat and its uses

2008-02-12 Thread Chas. Owens
On Feb 12, 2008 12:38 PM, Michael Barnes <[EMAIL PROTECTED]> wrote: snip > I'm the new kid and this is a beginners forum, so I welcome all ideas > and options. Forgiving my ignorance, would you mind giving an example > of how I would do this with lsof? snip This only works on systems with lsof.

Re: lstat and its uses

2008-02-12 Thread Michael Barnes
Kashif Salman told me on 02/12/2008 09:31 AM: > On Feb 12, 2008 6:51 AM, Michael Barnes <[EMAIL PROTECTED]> wrote: >> >> John W. Krahn told me on 02/11/2008 03:47 PM: >>> Michael Barnes wrote: I thought about using lstat to get the size of a file for file comparisons. I see that lstat al

Re: hash usage

2008-02-12 Thread Chas. Owens
On Feb 12, 2008 10:19 AM, Johnson, Reginald (GTI) <[EMAIL PROTECTED]> wrote: snip > Thank you for the reply. I'm definitely still in the crawl before you > can walk stage with perl and hashes. > Can you help me understand why I would make the the file handle a scalar > $SUMMARY instead of just SUM

Re: lstat and its uses

2008-02-12 Thread Kashif Salman
On Feb 12, 2008 6:51 AM, Michael Barnes <[EMAIL PROTECTED]> wrote: > > > John W. Krahn told me on 02/11/2008 03:47 PM: > > Michael Barnes wrote: > >> I thought about using lstat to get the size of a file for file > >> comparisons. I see that lstat always returns a list of thirteen values. > >> Th

RE: hash usage

2008-02-12 Thread Johnson, Reginald (GTI)
-Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Monday, February 11, 2008 4:35 PM To: Perl Beginners Subject: Re: hash usage Johnson, Reginald (GTI) wrote: > I have two input files and I put each into a hash. If the key of one > hash matches the other then I output

Re: lstat and its uses

2008-02-12 Thread Michael Barnes
John W. Krahn told me on 02/11/2008 03:47 PM: > Michael Barnes wrote: >> I thought about using lstat to get the size of a file for file >> comparisons. I see that lstat always returns a list of thirteen values. >> The references I find appear to require assignment of those 13 values >> to varia

Re: Tk disabling menu entries

2008-02-12 Thread MK
sorry, zentara, but with my perl 5.8.8 this script first produces: Bareword "Mainloop" not allowed while "strict subs" in use at ./Tkmenuentryconfigure.pl line 25 And even after i delete "use strict" i now get: Useless use of a constant in void context at ./Tkmenuentryconfigure.pl line 25

Re: cgi upload -> XMLin

2008-02-12 Thread Chas. Owens
On Feb 12, 2008 8:43 AM, Brent Clark <[EMAIL PROTECTED]> wrote: > Hi > > Heres my silly Q for the day > > I would like to upload a xml file, and would like the file to sent directly > to XMLin(). > > Im trying to find a way of not have to create the file in /tmp, and heres my > working code. > >

cgi upload -> XMLin

2008-02-12 Thread Brent Clark
Hi Heres my silly Q for the day I would like to upload a xml file, and would like the file to sent directly to XMLin(). Im trying to find a way of not have to create the file in /tmp, and heres my working code. my $filename = $cgi->param("filename"); #my $filename =~ s/.*[\/\

Re: Strange Behaviour while string concatenation

2008-02-12 Thread Chas. Owens
On Feb 12, 2008 5:51 AM, Rajpreet <[EMAIL PROTECTED]> wrote: > Greetings, > > I am trying to append an alphabetical counter to a string. But > concatenation shows a very strange behaviour in this case. Can some > one please help? > > The piece of code looks like : > > $self->{"log"}->debug(" In Fun

Strange Behaviour while string concatenation

2008-02-12 Thread Rajpreet
Greetings, I am trying to append an alphabetical counter to a string. But concatenation shows a very strange behaviour in this case. Can some one please help? The piece of code looks like : $self->{"log"}->debug(" In Function _process_array_data. "); $self->{"log"}->debug(" temp 4,data[11],c

RE: Tokenizing a string

2008-02-12 Thread Allam Reddy, Thomas
Thanks Thomas for your help. It met my requirement -Original Message- From: Thomas Bätzler [mailto:[EMAIL PROTECTED] Sent: Monday, February 11, 2008 7:01 PM To: beginners@perl.org Cc: Allam Reddy, Thomas Subject: RE: Tokenizing a string Allam Reddy, Thomas <[EMAIL PROTECTED]> asked: > I

Re: Tokenizing a string

2008-02-12 Thread Dr.Ruud
"David Moreno" schreef: > rvtol+news: Stop top-posting. >> Or not code a regex at all, and use a module like >> File::Basename or File::Spec. > > But where's the fun then? :) The question was about a string that looks very much like a path and filename. If it is about a path and filename, then