Windows Vista

first lines of TCL script for Windows

Hello,
I am trying to write an Expect script but I do not know the first lines that are needed in the TCL script.
I tried the following script but it fails in the
'package require Expect'.
What are the correct first lines for Windows?
Thank you.

My script:

#!"c:\Program Files\tcl\bin\wish85.exe"
# \
exec tclsh "$0" ${1+"$@"}
package require Expect

spawn telnet 192.168.1.52
 
expect "y/n"
send "\r"
 
expect "login:"
send "user\r"
 
expect "password:"
send "user\r"
<code>

sorting by an attribute of an object in a list

I have a number of individuals in a population.

class individual:
    def __init__(self,chrom,ftnss):
        self.chrome = chrom
        self.fitness = ftnss

class population(list):
    def __init__ (self):
        pass

I want to sort the population list by the individual.fitness attribute.
I tried this in the class population definition:

keeping variables local to a function

I'm trying to reduce a list of lists to a single list.

def flatten(x):
for i in x:
if isinstance(i , list):
flatten(i)
else:
result.append(i)
return result

I get this error message:

NameError: global name 'result' is not defined

I want the variables to stay local to the function.

Thanks, Gowan

Wrapped Tcl EXE crashes when loading byte compiled Tcl

I have the latest TclDevKit 8.5 and have wrapped a Tcl script and base-tk8.5-thread-win32-ix86.exe. When run, my wrapped script attempts to source unwrapped Tcl files. If those are clear text it works fine. But when they are byte compiled the application crashes. Any idea?
I'm compiling using tclcompiler.exe. And why is there a tclcompiler84.exe in the bin directory as well? Same problem occurs with that version too.

And I see the tbcload package is versioned 1.7. Yet the byte compiled code requires 1.6. Here's a sample:

if {[catch {package require tbcload 1.6} err] == 1} {

perlXS

I'm following the perlxstut...

C:\>h2xs -A -n Mytest
Defaulting to backwards compatibility with perl 5.10.0
If you intend this module to be compatible with earlier perl versions, please
specify a minimum perl version with the -b option.

Writing Mytest/ppport.h
Writing Mytest/lib/Mytest.pm
Writing Mytest/Mytest.xs
Writing Mytest/Makefile.PL
Writing Mytest/README
Writing Mytest/t/Mytest.t
Writing Mytest/Changes
Writing Mytest/MANIFEST
C:\>cd Mytest

And wtf is that ?

C:\Mytest>nmake

Microsoft (R) Program Maintenance Utility   Version 1.50

Custom Install of Activeperl

I am very new to ActiveState Perl. I am actually using both ActiveState Perl/ Python for development on Windows based platforms. I would like to role out some of my tools to a group of users. Is there a way to automate or push out the ActiveState Perl install? I would like everything to be automated from a users perspective, just one click everything is taken care of. Does anyone have experience with this, and/ or could you point me to some good documentation?

Thanks.

readdir stopped working

Has anybody had any problems with readdir. My code which worked fine until a couple of weeks ago no longer reads the directory. I just get . (full-stop) e.g.

opendir DIR, "$root" || die "Can't open dir $!";
my @entries = readdir(DIR) || print "Failed to read $!\n"; # select out ordinary files
closedir DIR || print "Failed to read $!\n";
print $root,"\n",@entries,"\n\n";

Output

D:/SD/
.

Hit key when ready

but there are 84 files in SD not apparently read-only or hidden.

PerlNET: giving the assembly a strong name

Hi all,

I have been scouring the net for an answer as to how I sign a PerlNET assembly, eg. giving it a strong name etc.

how do I go about this?

help is greatly appreciated.
thank you,

Regards
jeremy

PerlNET: Illegal scoping, object is not a container

Hi all,

I cannot seem to compile a perlNET library. I get this confusing error:
"Illegal scoping, object is not a container"

what does this mean, and what should I look for to fix this.

Regards,

jeremy.

TDK XRef is not using Komodo

Last week I installed the TDK on my Vista 64 bit system, mostly to help and understand a Tcl package that was handed to me. I read that the Cross reference tool would use Komodo if it was installed, so I downloaded and intalled Komodo, but the TDK still uses its internal, non-syntax highlighting editor to display the text.

How do I fix that? Do I need to reinstall the TDK?

Thanks.