Win32 console/curses app, how to?

2009-04-08 Thread C . R .
I'm making another rogue-like game with Perl on Win32 (WinXP in DOS box). Someone said that I should look at Term::ANSIScreen or WIN32::Console to do cursor positioning and screen management. Is there a website on how to use these 2 modules? Google simply returns 10,000 useless results and the

Tutorial on using Win32::Console?

2009-04-08 Thread C . R .
I'm making a rogue-like game on Win32 (WinXP in DOS box). No I will not release it, I just want practice doing this. What is the best thing to use for placing a character at various points on the screen? Win32::Console or Term::AnsiColor? Is there a tutorial on using Win32::Console? The perl do

Tutorial on using Win32::Console

2009-04-08 Thread C . R .
I don't think my previous message went through. I'm writing a rogue-like game on Win32 (WinXP in a DOS box). I won't be releasing it, I just want practice doing this. Is it better to use Term::AnsiColor or Win32::Console for placing characters in random places on the screen? Also, where can

split function

2004-09-14 Thread c r
Hi! Can the perl split function split a random 40 character string into five 8 character strings? With random I mean that there is no special pattern in the 40 character string that can be used as split markers. Yahoo! Mail - Gratis: 6 MB lagerplads, spamfilter og virusscan

the x operator

2004-09-17 Thread c r
Hi! Is it possible to avoid another loop by using the x operator? I.e. push(@list, rand(4)); gives me one element in @list. Can I somehow use the x operator to produce two different elements in the @list?

speed up string matching

2004-09-23 Thread c r
Hi! I need to match an expression and its reverse to a very long string. When a match occurs all matching should stop and the position of the match should be returned. Question1: can I match the forward and reverse expression to the string on the same time and thereby save half the time it no

Re: speed up string matching

2004-09-23 Thread c r
c r <[EMAIL PROTECTED]> wrote:Thanks for replying! Are you certain that using the module makes the simultaneous matching faster than a sequential and to what degree (roughly)? Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: C R wrote: > I need to match an expression and its re

RE: speed up string matching

2004-09-23 Thread c r
c r <[EMAIL PROTECTED]> wrote:Thanks for replying! Thomas Bätzler <[EMAIL PROTECTED]> wrote: Hi, c r asked: > I need to match an expression and its reverse to a very long string. > When a match occurs all matching should stop and the position > of the match should be

Re: speed up string matching

2004-09-23 Thread c r
Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: > Gunnar Hjalmarsson wrote: >> C R wrote: >>> Question2: is the "fork" function what I should use in order to >>> match a string with multiple expressions simultaneously? >> >> Maybe, if

Re: speed up string matching

2004-09-24 Thread c r
Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: C R wrote: > Gunnar Hjalmarsson wrote: >> C R wrote: >>> Are you certain that using the module makes the simultaneous >>> matching faster than a sequential and to what degree (roughly)? >> >> Certain? Cer

cancatenate lists

2004-10-22 Thread c r
Hi! How can I easily cancatenate two lists? i.e. @list1 = qw(1 2 3); @list2 = qw(4 5 6); do some thing easy. result: @list3 = qw(1 2 3 4 5 6); I preferrably want to avoid the sequence: foreach element in list...shift...push to another listand so on, because I ha

Re: cancatenate lists

2004-10-22 Thread c r
Don't answer!!! I found out myself. @list3 = (@list1,@list2) is the answer. c r <[EMAIL PROTECTED]> wrote: Hi! How can I easily cancatenate two lists? i.e. @list1 = qw(1 2 3); @list2 = qw(4 5 6); do some thing easy. result: @list3 = qw(1 2 3 4 5 6); I

Re: Find all matches in a string via regex

2006-10-25 Thread C . R .
Well, that kinda worked. I had to change it to work on a scalar so this is what I wrote: $s=~s/(\d+ +cm)/$1/g; Input string: 144 cm Output string: 144 cm Why did I get duplicate and strings? Is the \G operator here and does v5.6.1 have it? Chuck -- To unsubscribe, e-mail: [EMAIL PROTECTE

ndbm error no 28

2006-10-27 Thread C . R .
Perl 5.6.1 on Solaris While storing a value to a dbm file (hash file) I get this error: "ndbm store returned -1, errno 28, key "11000-120" at excond.pl line 313, line 331." I think I may have reached the limit to the amount of data I can store in a record. What is this limit? 2K? I don't thin

Re: Find all matches in a string via regex

2006-10-27 Thread C . R .
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > C.R. am Mittwoch, 25. Oktober 2006 20:38: > > Well, that kinda worked. I had to change it to work on a scalar so this > > is what I wrote: > > $s=~s/(\d+ +cm)/$1/g; > > > > Input string: 144 cm > > Output string: 144 cm > > > > Why did I

Re: Can't access search.cpan.org

2006-10-28 Thread C . R .
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > Hi, > > As of 3:43:18 pm here in Manila, Philippines, I can't access > search.cpan.org.. Any idea why? > Either a computer between you and CPAN is down temporarily, or very busy, or perhaps your Domain Name Server is down or extremel

Re: Find all matches in a string via regex

2006-10-31 Thread C . R .
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > You need to show us your code Chuck. Perl doesn't do that, in any situation > that > I can think of. Try running this on its own: > > my $s = '144 cm'; > $s =~ s/(\d+ +cm)/$1/g; > print $s; > > I get > > 144 cm > > what do you get? >

Best book to update XML via Perl?

2006-11-06 Thread C . R .
Hi, I have Perl 5.6.0 on Solaris, and on DOS. We have an XML document that has many prices in it that need to be changed. They are keyed by part number, and each part has a price grade, each grade has a price. I know there are many tools that Perl can use to update XML. Which one is the most s

Trouble installing module

2006-11-06 Thread C . R .
Hi, I have a Solaris system. I'm having trouble installing a module via the command: perl -MCPAN -e shell 'install XML::Parser' This is the first time my perl 5.6.1 installation has used CPAN to install a module so I had to answer a bunch of questions for configuration. First, do I need the

Alternate to installing via CPAN?

2006-11-06 Thread C . R .
System: Solaris v5.9 My previous messages reflect that I am having trouble installing any module via the CPAN module in perl. So what are my options? I want to start using XML and have some modules in mind that I need. I have downloaded XML::Simple, XML::Parser, XML::XPath and XML::DOM. Do I

Re: Find all matches in a string via regex

2006-11-06 Thread C . R .
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > > > My first post in this thread shows example data as it is stored in a > > scalar variable. It also shows what the string SHOULD look like after > > the substitution. > > > > Or maybe, perl simply is not able to replace multiple in

Re: Where to Run Program?

2006-11-06 Thread C . R .
I also run Activestate Perl on Windows in a DOS box (on Win 2000). First, I open a DOS box. In the DOS box properties (right click on DOS box icon) I have it set up to go right to c:\perl. I have my programs stored in c:\perl\progs. And I have my path variable set to look in c: \perl for the pe

Installation troubles

2006-11-06 Thread C . R .
System: Solaris 5.9 In my previous posts I detail major problems installing modules via CPAN called via "perl -MCPAN -e shell". Perhaps LWP is my first problem. Here are some error messages. LWP not available Please check, if the URLs I found in your co

Re: Trouble installing module

2006-11-07 Thread C . R .
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > There should be a version of make in /usr/ccs/bin Giggidy! You're right! Thanks. > > I'm guessing I entered the wrong site name for the Perl CPAN module > > config. Can anyone help me? > > Well, here's your Dollars' worth of free ad

Re: Alternate to installing via CPAN?

2006-11-07 Thread C . R .
In article <4ce365ec0611061453u6907625exa49b87a7f21f4e93 @mail.gmail.com>, [EMAIL PROTECTED] says... > And there's the rub, of course: your issue with CPAN--or one of > them--is that you don't have make. CPAN modules aren't distributed as > compiled binaries (insofar as such a thing exists for Perl

Re: Trouble installing module

2006-11-07 Thread C . R .
When I do a "reload index" in CPAN this is what I get. cpan> reload index LWP not available Please check, if the URLs I found in your configuration file (http://141.217.1.55/cpan/ http://216.52.237.135 ftp://69.16.251.60/CPAN/) are valid. The urllist can b

Round to mult. of 5?

2006-11-08 Thread C . R .
Does anyone have a routine that will round an integer to a multiple of 5? For example: if number ends in 0 or 5, no rounding is done. If number ends in 1,2 the ones place rounds down to 0. If number ends in 3,4 the ones place rounds up to 5. If number ends in 6,7 the ones place rounds down to

Re: Best book to update XML via Perl?

2006-11-08 Thread C . R .
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > Hi, I have Perl 5.6.0 on Solaris, and on DOS. We have an XML document > that has many prices in it that need to be changed. They are keyed by > part number, and each part has a price grade, each grade has a price. > > I know there are

Re: Round to mult. of 5?

2006-11-08 Thread C . R .
In article <31086b240611080714m228f0808hfb07ccff550f33d6 @mail.gmail.com>, [EMAIL PROTECTED] says... > 1. Divide by five. > 2. Round to the nearest integer. > 3. Multiply by five. > 4. Profit! Now that's very clear, with no obscure Perlese code. Thanks! -- To unsubscribe, e-mail: [EMAIL

Problem with hash connected to file

2007-10-22 Thread C . R .
I have Solaris 5.9, and am using Perl 5.6.1. Today I started using a hash connected to a file, via these commands: dbmopen(%data,"price2007",0666); dbmclose(%data); I have been getting an error: "AnyDBM_File doesn't define an EXISTS method at extr.pl line 142". The lines in question are:

Writing DOS CRLF via Unix Perl

2007-11-08 Thread C . R .
I run a script on unix Perl to write a text file. By default, when Perl writes "\n" it writes a line ending sequence which is native to the current OS. How do I force this particular script to always write DOS CRLF line endings? Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additi