Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Accessing perl/Tk

by hsfrey (Beadle)
on Nov 26, 2011 at 23:55 UTC ( [id://940226]=perlquestion: print w/replies, xml ) Need Help??

hsfrey has asked for the wisdom of the Perl Monks concerning the following question:

I downloaded perl/Tk and got a folder named Tk-804.028 I put it in both my ActivePerl and Strawberry perl lib folders.

When I try to run the hello.pl script it fails because it "can't find Tkx.pm" in @INC, which includes the strawberry lib folder.

And indeed, that file isn't present in the downloaded folder!

But there IS a Tk.pm there. How come the download is incompatible with itself, and what can I do about it?

And, does this work only with the Strawberry perl, since that address seems built-in. ActivePerl comes with a Tkx folder, but that is incompatible with Tk.

Replies are listed 'Best First'.
Re: Accessing perl/Tk
by Marshall (Canon) on Nov 27, 2011 at 00:52 UTC
    Copying Tk into folders isn't going to work. With Active State, use the ppm package installer to install Tk. Type "ppm" at a command prompt to start the GUI version.

    Active State does a lot of work to make Tk have the Windows look and feel. And there are .dlls that go with this that your simple "copy approach" would have missed. Using the installer will solve all of these path problems.

      I tried 'ppm' in the perl folder. It hung. No error message. Had to close the command window to get out.

      I tried 'ppm Tk' and 'ppm Tkx', they both hung.

      I did a search on 'ppm' and there were over 50 files with ppm in the name.

      One named 'ppm.bat' in the bin folder looked promising, so I thought I'd look at it to get an idea of how to use it. It had over 2000 lines, none of them explaining how to call it.

      So, now I have to debug ppm?

      I found a winword file from 2000 purporting to explain how PPM works. It says it uses a PPD file which can be somewhere on the internet, but gives not the slightest hint of where.

      How can I find out if ppm is even properly installed?

        in both my ActivePerl and Strawberry perl lib folders

        Attempting to run two different version of Perl (ActiveState and Strawberry) or even two different release levels of the same "flavor of Perl" on the same Windows machine is not for inexperienced! This is a really bad idea unless you have some clearly articulated reason for doing so.

        Ok, yes it is possible, but there is gonna be a lot of pain involved.

        Please follow directions exactly! I tried 'ppm Tk' and 'ppm Tkx', they both hung. I said to type ppm at the command line. That means to type "ppm<hit enter>". I did not say to type "ppm Tk". This program takes a while to start. Give it some minutes before you give up and type something like "CTL-C".

        If the above fails, then it sounds like you have a confused set-up and probably some path variables that are "hosed". I would back out of all that you have so far. That means use Windows software management (Add or Remove Programs) to uninstall all of the Perl's that you have. Then delete all of the Perl stuff from your path variable. Do a Windoews help search on "setting environment variables". Tell me if you are on WinXP and I can help more.

        To see your current environment variables, type "env<carriage return>" or "set<carriage return>" from a command prompt.

        I have used ActiveState Perl for years and it does work and Tk does work also. Starting with 5.10, you have to install it. The ppm utility does work.

        Update: How can I find out if ppm is even properly installed? Follow the directions and report back.

        The ActiveState repositories work with .ppd files. You need not worry about finding these or fiddling with them. The ppm utility knows how to find them! These are already pre-compiled files that do not require a C compiler or "make" on your machine! This is actually very easy and painless. DO NOT try to install cpan modules on an ActiveState system directly.

        Using CPAN is possible with ActiveState, but it is more complicated to do than we need to get to for your current problem.

        Oh, if you are using Win 7, 64 bit, use the ActiveState Perl 32 bit version. Tk is not available for the 64 bit version to the best of my knowledge at this time.

        Install your modules using CPAN.pm. It works a lot better with Strawberry Perl (It works with ActivePerl also, but Activestate like ppm better.).
        --perl.j
Re: Accessing perl/Tk
by sundialsvc4 (Abbot) on Nov 30, 2011 at 03:51 UTC

    Active State, vs. Strawberry, is .. underneath the hood .. really a very different project from “ordinary ... e.g. Unix ... Perl.”   And you have just stumbled-upon one of those fundamental differences.   The AS designers took as their goal to make Perl very friendly to what they took to be their intended audience, which is IMHO a “mostly Windows(-only) aware” user community.   To accomplish this, they worked some magic, then rather buried that magic, and one of the places where they buried a lot of that magic is ppm.   So if you are told in-effect to “use that tool and don’t ask questions” ... :-D ... use that tool and don’t ask questions.   In particular, kindly forget entirely that cpan exists.   This is one of those situations where a very clever and resourceful design team cordially begs you to “ignore the little man behind that curtain over there.”   If you want to be using cpan you probably ought to be using Strawberry, because that’s more the philosophy that that project is intending to take.

    IMHO, the Active State team and the Strawberry team looked at the same problem ... “how to bring Perl painlessly to Windows” ... and each team selected fundamentally different approaches to the same problem.   Both approaches are valid, but IMHO you will quickly sail down the wrong stream if you mix the two.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://940226]
Approved by Marshall
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-20 15:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found