RE: Negative-indexed arrays?

2002-12-22 Thread Bill Royds -Perl
Fortran can use any indices you want by declaring it as real foo(-10:10) and has been able to do that for years. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Lee Goddard Sent: Sun December 22 2002 18:08 To: Carl Jolley Cc: Burak Gürsoy; ActiveState's

RE: Negative-indexed arrays?

2002-12-22 Thread Bill Royds -Perl
When doing something like this, the easiest way to do it is to create an indexing function negind as in following example #!perl -w my @array=(-3,-2,-1,0,1,2,3); sub negind ($\@) { my $offset=shift; my @negarr=@{+shift}; my $indoff=$offset + int (scalar @negarr)/2- 0.5;

RE: Re: Counting regex occurrences

2002-12-14 Thread Bill Royds -Perl
The key is $count = () = $string =~ /a/g; Which creates a list context for return of match operator $string =~/regex/g Then the $count= is asking for a scalar context return of a list, which we all know returns the count of elements in list. The expression $count = (@temp) = $string =~ /a/g;

RE: :Telnet on Win2K

2002-11-27 Thread Bill Royds -Perl
The "gibberish" is ANSI escape sequences for moving the cursor around on the screen that the telnet server believes it is connected to. You need to turn it of with the ANSI sequence by ensuring that Console mode is no. >From the Net::Telnet POD. Connecting to a Remote Win32 Machine By default,