Re: Curses::UI: No definition found for '< Yes >'

2006-07-10 Thread Mumia W.
Mumia W. wrote: > I'm trying to learn to use Curses::UI, and I read the top of "perldoc > Curses::UI" and found some example code. [...] No, I mean I. "I found some example code." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Curses::UI: No definition found for '< Yes >'

2006-07-10 Thread Chasecreek Systemhouse
On 7/10/06, Mumia W. <[EMAIL PROTECTED]> wrote: I'm trying to learn to use Curses::UI, and I read the top of "perldoc Curses::UI" and found some example code. Unfortunately, it doesn't work. The Curses::UI refers you to a more appropriate example. The example's syntax: use FindBin; use lib "$F

Curses::UI: No definition found for '< Yes >'

2006-07-10 Thread Mumia W.
I'm trying to learn to use Curses::UI, and I read the top of "perldoc Curses::UI" and found some example code. Unfortunately, it doesn't work. This is my program: #!/usr/bin/perl use strict; use warnings; use Curses::UI; my $cui = new Curses::UI (-color_support => 1); my $my = $cui->dialog(

Re: write out filenames of files existing on a filesystem into afile

2006-07-10 Thread Rob Dixon
Mr. Shawn H. Corey wrote: > > After all, we don't want people frighten into learning that other language > that starts with P ;) Why? I like Pascal. :) R -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: How to use Perl for API testing

2006-07-10 Thread Jason Trebilcock
> -Original Message- > From: Suja Emmanuel [mailto:[EMAIL PROTECTED] > Sent: Sunday, July 09, 2006 10:16 PM > To: beginners@perl.org > Subject: How to use Perl for API testing > > > Hi, > > I want to use PERL for API testing, i.e., I want to call > different URLs through th

Re: write out filenames of files existing on a filesystem into afile

2006-07-10 Thread Chad Perrin
On Mon, Jul 10, 2006 at 06:34:48PM -0400, Mr. Shawn H. Corey wrote: > > I think he owes you an apology, regardless of whether he was right or > wrong, regardless of whether you were right or wrong. > > Not everyone who reads this mailing list posts to it. What impression > would his comments leav

Re: write out filenames of files existing on a filesystem into afile

2006-07-10 Thread Mr. Shawn H. Corey
Rob Dixon wrote: > Not much chance of that I'm afraid Shawn. I can do without the apology, > I just > wish he'd confirm that his original critique was wrong instead of > banging on > about filenames with three dots. I think leaving people with that > misinformation > uncorrected is a lot more impor

RE: How to use Perl for API testing

2006-07-10 Thread Timothy Johnson
Are you testing on IE? There is an Win32::IEAutomation module that should be able to handle what you want if IE is the browser you want to test. -Original Message- From: Suja Emmanuel [mailto:[EMAIL PROTECTED] Sent: Sunday, July 09, 2006 10:16 PM To: beginners@perl.org Subject: How to

Re: write out filenames of files existing on a filesystem into a file

2006-07-10 Thread Dr.Ruud
"Nishi Bhonsle" schreef: > Can you please tell me how to modify the above program to ignore the > "." and "..", so that they donot get printed in C:/filelist.txt ? Since you want only files, see "perldoc -f -f". -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROT

Re: efficiently keeping a short list

2006-07-10 Thread Mr. Shawn H. Corey
Jay Savage wrote: > foreach ('a'..'z') { > $recent{$_} = time; > sleep 1; > } Ouch. The OP did mention his limit was 200. So he must have more than 200 elements to scan. This algorithm will takes at least 3m20s, so it's hardly fast (which was one of the points of this exercise). Try

How to use Perl for API testing

2006-07-10 Thread Suja Emmanuel
Hi, I want to use PERL for API testing, i.e., I want to call different URLs through the browser. I am new to Perl. Can you help me to write a script to call many URLs through browser. Thanks in advance, Suja Emmanuel. The information contained in, or attached to, this e-ma

Re: Perl directory traversal and file operation

2006-07-10 Thread Mr. Shawn H. Corey
Ed wrote: > I'm having a difficult time finding a way to traverse a directory structure > and then perform some simple operations on files in the directories. > > I want to traverse a directory structure and then remove the oldest file in > each subdirectory. Something like this: > 8< snip > I've

Re: Perl directory traversal and file operation

2006-07-10 Thread John W. Krahn
Ed wrote: > I'm having a difficult time finding a way to traverse a directory structure > and then perform some simple operations on files in the directories. > > I want to traverse a directory structure and then remove the oldest file in > each subdirectory. Something like this: > > ## traverse

Re: efficiently keeping a short list

2006-07-10 Thread Jay Savage
On 7/10/06, Jay Savage <[EMAIL PROTECTED]> wrote: On 7/10/06, Charles K. Clarkson <[EMAIL PROTECTED]> wrote: > Mr. Shawn H. Corey wrote: > > We could do a unique check only when the array is accessed > instead of every time a value is added. Then we used the cached > result until another ele

Re: efficiently keeping a short list

2006-07-10 Thread Jay Savage
On 7/10/06, Charles K. Clarkson <[EMAIL PROTECTED]> wrote: Mr. Shawn H. Corey wrote: We could do a unique check only when the array is accessed instead of every time a value is added. Then we used the cached result until another element is added. I'd be inclined to to flip that around:

Re: write out filenames of files existing on a filesystem into afile

2006-07-10 Thread Rob Dixon
Mr. Shawn H. Corey wrote: > > Rob Dixon wrote: > >> Just because Randal has publications to his name doesn't make him any less >> prone to mistakes, as we have seen in his original post on this thread. That >> he is more aggressive and vociferous than most don't to me make him more >> worth readin

Re: write out filenames of files existing on a filesystem into afile

2006-07-10 Thread John W. Krahn
Jay Savage wrote: > On 7/10/06, Mumia W. <[EMAIL PROTECTED]> wrote: >> Randal L. Schwartz wrote: >> >> "Rob" == Rob Dixon <[EMAIL PROTECTED]> writes: >> > Just to (hopefully) put an end to this thread :-) the OP said: Nishi Bhonsle wrote: > > Can you please tell me how to modify the above pro

Re: efficiently keeping a short list

2006-07-10 Thread Mr. Shawn H. Corey
Charles K. Clarkson wrote: > Mr. Shawn H. Corey wrote: > > : OK, here's a solution that might be faster. The problem with > : it is as_array() which has to scan the list every time. There > : is not simpler way for it to work. > > We could do a unique check only when the array is accessed > i

Re: write out filenames of files existing on a filesystem into afile

2006-07-10 Thread Mr. Shawn H. Corey
Rob Dixon wrote: > Just because Randal has publications to his name doesn't make him any > less prone > to mistakes, as we have seen in his original post on this thread. That > he is > more aggressive and vociferous than most don't to me make him more worth > reading. To me he is just a regular guy

Re: regex and parsing config file directives..

2006-07-10 Thread Dr.Ruud
"Gregory Machin" schreef: > i'm using the follwing regex /(.+)[\s+\n](.+)/where $1 is the > directive and $2 is the option for the directive What is [\s+\n] supposed to mean? The \n is already in \s, so it is a characterset that holds everything \s holds, plus a plus sign. The construct sti

Perl directory traversal and file operation

2006-07-10 Thread Ed
I'm having a difficult time finding a way to traverse a directory structure and then perform some simple operations on files in the directories. I want to traverse a directory structure and then remove the oldest file in each subdirectory. Something like this: ## traverse the directories and in

Re: perl + ncurses turtorial ?

2006-07-10 Thread Jay Savage
On 7/6/06, Gregory Machin <[EMAIL PROTECTED]> wrote: Hi I'm looking for an perl ncuses tutorial so I can write a remote admin app to work via ssh .. Many Thanks -- Gregory Machin [EMAIL PROTECTED] www.linuxpro.co.za I haven't done much work with curses in a while, but I remember the Perl Coo

Re: write out filenames of files existing on a filesystem into afile

2006-07-10 Thread Rob Dixon
Ryan Frantz wrote: > >>Randal L. Schwartz wrote: >> "Rob" == Rob Dixon <[EMAIL PROTECTED]> writes: >>> >>> Rob>my @new = grep /[^.]/, readdir DIR; >>> >>> This is still the wrong regex. While it's narrow enough for >>> windows, it will *break* on Unix. No reason not to do the right t

Re: ... is a valid filename

2006-07-10 Thread Chasecreek Systemhouse
On 7/10/06, Aaron Priven <[EMAIL PROTECTED]> wrote: For what it's worth, "..." is indeed a valid filename. Back in FWIW the Linux command touch " " makes a valid 'space' for a filename; sorts on top of all other files when executing ls -l -- WC (Bill) Jones -- http://youve-reached-the.endofthe

Re: error message

2006-07-10 Thread Rob Dixon
Rob Dixon wrote: > > Don't forget that we can't see bold emphasis on the mailing list: the > posts are > converted to plain text by the server. But your errors must be on the lines > > > $pos1 = int($pos1); > > $dist1 = int($dist1*100)/100; > > and are because $pos1 and $dist1 are undefined,

Re: nohup using perl

2006-07-10 Thread John W. Krahn
Mahdi A Sbeih wrote: > Hi all, Hello, > I am porting a shell script written in korn shell to perl, and i want to > see what is the best way to port the "nohup" shell command in perl, > anyone knows? Basically the nohup program ignores the HUP signal so: $SIG{ HUP } = 'IGNORE'; is probably all

RE: backslash on windows

2006-07-10 Thread Timothy Johnson
-Original Message- From: Mr. Shawn H. Corey [mailto:[EMAIL PROTECTED] Sent: Monday, July 10, 2006 5:02 AM To: beginners@perl.org Subject: Re: backslash on windows >> >> myscript.pl -cfg D:\users\config.txt >> >> inside the script, when capturing the config file mentioned above, the >>

... is a valid filename

2006-07-10 Thread Aaron Priven
For what it's worth, "..." is indeed a valid filename. Back in Ancient Days of Yore, when I was a young undergrad at UC Santa Cruz playing on the open-access timeshare Unix system, we all had read access to each others' home directories, and it was somewhat common for people to put semi-sec

RE: efficiently keeping a short list

2006-07-10 Thread Charles K. Clarkson
Mr. Shawn H. Corey wrote: : OK, here's a solution that might be faster. The problem with : it is as_array() which has to scan the list every time. There : is not simpler way for it to work. We could do a unique check only when the array is accessed instead of every time a value is added. Then

Re: write out filenames of files existing on a filesystem into afile

2006-07-10 Thread Jay Savage
On 7/10/06, Mumia W. <[EMAIL PROTECTED]> wrote: Randal L. Schwartz wrote: >> "Rob" == Rob Dixon <[EMAIL PROTECTED]> writes: > > Rob>my @new = grep /[^.]/, readdir DIR; > > This is still the wrong regex. While it's narrow enough for windows, it will > *break* on Unix. No reason not to do

Re: perl + ncurses turtorial ?

2006-07-10 Thread Stuart Adams
Hi Greg, Curses::UI comes with a nice variety of example applications, as part of it's tutorial. I am writing a movie rental app, but I don't feel ready to have others scrutinize my work... If you do find a working perl app done with curses, please share it, I would love to take a look at how oth

RE: write out filenames of files existing on a filesystem into afile

2006-07-10 Thread Ryan Frantz
> -Original Message- > From: Mumia W. [mailto:[EMAIL PROTECTED] > Sent: Monday, July 10, 2006 11:55 AM > To: Beginners List > Subject: Re: write out filenames of files existing on a filesystem into > afile > > Randal L. Schwartz wrote: > >> "Rob" == Rob Dixon <[EMAIL PROTECTED]> writ

Re: write out filenames of files existing on a filesystem into afile

2006-07-10 Thread Mumia W.
Randal L. Schwartz wrote: "Rob" == Rob Dixon <[EMAIL PROTECTED]> writes: Rob>my @new = grep /[^.]/, readdir DIR; This is still the wrong regex. While it's narrow enough for windows, it will *break* on Unix. No reason not to do the right thing here: grep { $_ ne "." and $_ ne "..

Re: regex and parsing config file directives..

2006-07-10 Thread Mumia W.
Mumia W. wrote: [...] if (m/^([\w-]+)(?: +(.*))?$/) { $directive{$1} = $2 || $1; } This is much more readable: my ($key, $value) = split /\s+/, $_, 2; $directive{$key} = $value || $key; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: efficiently keeping a short list

2006-07-10 Thread Mr. Shawn H. Corey
Mr. Shawn H. Corey wrote: > Mr. Shawn H. Corey wrote: > >>Your solution will only work if $element is unique. Otherwise you will >>have multiple copies of $element on the list, and not the $maximum >>(unique) number of items. >> >>Try: >> >> @recent = grep { ! /^$element$/ } @recent; >> unshift

Re: efficiently keeping a short list

2006-07-10 Thread Mr. Shawn H. Corey
Mr. Shawn H. Corey wrote: > Your solution will only work if $element is unique. Otherwise you will > have multiple copies of $element on the list, and not the $maximum > (unique) number of items. > > Try: > > @recent = grep { ! /^$element$/ } @recent; > unshift @recent, $element; > $#recent

Re: write out filenames of files existing on a filesystem into afile

2006-07-10 Thread Randal L. Schwartz
> "Rob" == Rob Dixon <[EMAIL PROTECTED]> writes: Rob>my @new = grep /[^.]/, readdir DIR; This is still the wrong regex. While it's narrow enough for windows, it will *break* on Unix. No reason not to do the right thing here: grep { $_ ne "." and $_ ne ".." } readdir DIR; Rob,

Re: regex and parsing config file directives..

2006-07-10 Thread Mumia W.
Gregory Machin wrote: Hi I'm writing a script to pass a config file and put the values in a hash, with the key being the directive and the value bing the options, but some directives don't have options, so in that case i want to store the directive as the value so that for completeness.. i'm usi

excel conditional format

2006-07-10 Thread Ed Panni
Hi, This is my first post and I am not really a highly skilled programmer . I just hack some.. Anyway I have written a script in perl to use OLE and scan some performance log files that I created and place them into an excel spread sheet and do performance comparisons. I have gotten most of th

Re: regex and parsing config file directives..

2006-07-10 Thread Mr. Shawn H. Corey
Gregory Machin wrote: > Hi > I'm writing a script to pass a config file and put the values in a hash, > with the key being the directive and the value bing the options, > but some directives don't have options, so in that case i want to store the > directive as the value so that for completeness..

regex and parsing config file directives..

2006-07-10 Thread Gregory Machin
Hi I'm writing a script to pass a config file and put the values in a hash, with the key being the directive and the value bing the options, but some directives don't have options, so in that case i want to store the directive as the value so that for completeness.. i'm using the follwing regex /

Re: error message

2006-07-10 Thread Dr.Ruud
"Geetha Weerasooriya" schreef: > while() { > chop; You must hate DOS. > s/\s//g; That already removes any CR or LF, so no chomp (or chop) was necessary. -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: How to use Perl for API testing

2006-07-10 Thread Matt Johnson
You might want to consider Test::WWW::Mechanize http://search.cpan.org/author/PETDANCE/Test-WWW- Mechanize-1.12/Mechanize.pm or WWW-Mechanize http://search.cpan.org/~petdance/WWW-Mechanize-1.18/ lib/WWW/Mechanize.pm -- MattJ On Jul 9, 2006, at 10:13 PM, Suja Emmanuel wrote: Hi,

Re: nohup using perl

2006-07-10 Thread Prabu
Hello Mahdi, I Don't know whether this is your requirement.But you can run the nohup command using system() in perl. system("nohup YourCommand"); Sorry,if this is not what you expected. -- Prabu.M.A When I was born I was so surprised I didnt talk for a period and half

Re: backslash on windows

2006-07-10 Thread Mr. Shawn H. Corey
Mahdi A Sbeih wrote: > Hello all, > > I am testing a perl script on windows platforms, but i am facing an > issue with the path using "\" such as: > > myscript.pl -cfg D:\users\config.txt > > inside the script, when capturing the config file mentioned above, the > "\" is treated as escape charac

RE: How to use Perl for API testing

2006-07-10 Thread Jeff Peng
Have you took a look at CPAN?for example,LWP::UserAgent. I want to use PERL for API testing, i.e., I want to call different URLs through the browser. How much is possin -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: nohup using perl

2006-07-10 Thread Jeff Peng
Hello, It's so easy to simulate 'nohup' command in perl script.Usually you just fork a child,then parent die,go into child,call setsid to get child become the session leader,re-open the STDIN,STDOUT,STDERR to a null device (for example '/dev/null'),last call 'exec' or 'system' to do the things

nohup using perl

2006-07-10 Thread Mahdi A Sbeih
Hi all, I am porting a shell script written in korn shell to perl, and i want to see what is the best way to port the "nohup" shell command in perl, anyone knows? Thanks, Mahdi. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

backslash on windows

2006-07-10 Thread Mahdi A Sbeih
Hello all, I am testing a perl script on windows platforms, but i am facing an issue with the path using "\" such as: myscript.pl -cfg D:\users\config.txt inside the script, when capturing the config file mentioned above, the "\" is treated as escape character. How can i get around this p

How to use Perl for API testing

2006-07-10 Thread Suja Emmanuel
Hi, I want to use PERL for API testing, i.e., I want to call different URLs through the browser. How much is possin The information contained in, or attached to, this e-mail, contains confidential information and is intended solely for the use of the individual or entity to whom

Re: Which line?

2006-07-10 Thread John W. Krahn
Ryan Dillinger wrote: > Hello, Hello, > I have a script here, I have been going over and over. > Every time I run it I get several errors, and I have tried to fix them > to no avail. > Can someone tell me what line I missed, please? > Thanks for your help! > > #!usr/bin/perl > use warnings;

Re: error message

2006-07-10 Thread Rob Dixon
Geetha Weerasooriya wrote: > > In my perl code for MapMatching, I have following while loop. When I run > the program I get the following two error messages(for each data line in > the data file) > But the out put file is created. > > Use of uninitialized value in int at filename.pl lineNo, line

Re: write out filenames of files existing on a filesystem into afile

2006-07-10 Thread Rob Dixon
Alan_C wrote: > [ . . ] > > Hi, > > my @new = grep /[^.]/, readdir DIR; > > (on Linux I tried it) that eliminates . and .. from the catch. > > *But the next code prints all 8 lines of data it does not eliminate . and .. > from the catch, print* > > Isn't that a character class that says "not a dot

error message

2006-07-10 Thread Geetha Weerasooriya
Dear All, In my perl code for MapMatching, I have following while loop. When I run the program I get the following two error messages(for each data line in the data file) But the out put file is created. Use of uninitialized value in int at filename.pl lineNo, line .. Use of unititialized valu

Re: error message

2006-07-10 Thread Owen Cook
On Mon, 10 Jul 2006, Geetha Weerasooriya wrote: > > In my perl code for MapMatching, I have following while loop. When I run > the program I get the following two error messages(for each data line in > the data file) > But the out put file is created. > > Use of uninitialized value in int at f