Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Installation of perl

by prashanth_hsn (Initiate)
on Aug 08, 2008 at 19:53 UTC ( [id://703175] : perlquestion . print w/replies, xml ) Need Help??

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

Hi all, I'm developing a simple application using Tcl and perl. I had installed perl and Tcl on my Machine(runs on Windows 2000) with active perl and Tcl installation packages. Now I was looking for most simplest way to install TCL and perl on a new machine so that my application can be used on it. To do so i simply copied the folders perl and Tcl from my systems Root and pasted it on the new machine. Then created file type association for .pl,.pm as perl.exe and wish85.exe for .tcl using assoc and ftype in dos prompt. And finally updated the environment variable using AUTOEXEC.BAT. When tried running my application it was not performing as expected. So when debugged it I found that the argumnets which i was sending from Tcl (.tcl file) to perl(.pl file) were not getting passed. I used the below looking like code to do so.
open(my_perl, "|perl_file.pl $variable1 $variable2"); close(my_perl); #this was working fine in my machine where i had initially developed m +y application.
So my question is, Where did I go wrong. was it with the way I installed perl in new Machine or the Way i'm passing arguments to my perl file.

Replies are listed 'Best First'.
Re: Installation of perl
by tptass (Sexton) on Aug 08, 2008 at 21:15 UTC

    Coping and pasting your installation directories of Perl and TcL or most applications is never a great idea. You are using the ActiveState Perl and TcL packages, which means that there they are installed with an MSI. You can install them unattended, check out the following page: MSFN Unattended. It will give you some insight into installing an .MSI unattended. There are ways of creating answer files for .MSI. Another resource for .MSI installation is: Unattended

      Thanks for your kind suggestions. But i'm looking at developing an installation package which installs perl and tcl in a sigle go with zero user interference. So i was just checking the option of copying the directory tree of perl and tcl, which was suggested by my lead.

        Using msiexec, I believe you can invoke the installer with no gui interface. You than could run the two commands for tcl and Perl with a batch file, which would be a single click. Last time I used windows I used to install using msiexec with a /qn flag for no gui. You could give this a try for ActivePerl:

        msiexec /qn /i ActivePerl.msi PERL_PATH=Yes PERL_EXT=Yes

        Than you should be able to simply just copy/unzip the perl code to its necessary directory(ies).

Re: Installation of perl
by shmem (Chancellor) on Aug 08, 2008 at 21:01 UTC
    So when debugged it I found that the argumnets which i was sending from Tcl (.tcl file) to perl(.pl file) were not getting passed.

    How did you debug? Why did you stop chasing the bug? How did you find out the arguments are not passed? What are the error messages? Are you sure your arguments aren't empty? What does your Path environment variable look like? Are you sure copying a directory tree is all that is with an installation of either perl or tcl? Are you sure no registry changes are made by installing with an installer?

    These are the questions that immediately pop up reading your node. Take those as hints; you are providing too little information to solve your problem. See How (Not) To Ask A Question.

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
      Thanks for your reply. And sorry for providing too little information. I'm new to perl as well for SOPW so forgive my mistakes. Coming to the point. The error message which i get is an warning like "use of uninitialised value in some place..." So i concluded that the arguments were not passed. The path variables were "c:\perl\bin" and "c:\Tcl\bin" I was not pretty sure about copying directory tree, but my Lead told me that when perl is installed using active perl it too does the same thing except that it modifies the registry for file type association. Which i too did using Assoc and ftype commands in DOS cmd prompt.
Re: Installation of perl
by chromatic (Archbishop) on Aug 08, 2008 at 20:54 UTC

    I'm not sure anyone can give you a good answer based on the information you've provided. Do you get an error message? If so, what is the exact message? How does your Perl program expect to receive arguments? Can you show us the code? What arguments does it receive? What language is the snippet you've provided? (It looks like Perl to me, but I don't understand why you'd provide that in the context of your question. If it is Perl, where's your error checking?)

      1. The (error) messages i get are warnings, like "use of uninitialised variable at some place" 2. I except my .pl file to be called by the TCL file which is my GUI. So all the inputs from the user are collected by the .tcl file and then passed on to the perl file. To do that I created a perl environment in Tcl and used the open command to call my .pl file.
      if(open(my_perl,"|perl_file.pl $variable1 $variable2")) { #do some thing } else { #report the error or/and Log the Error in Error log }
      I provided this code snippet so as to confirm that the way with which I'm passing parameters from tcl to perl were correct.
        The (error) messages i get are warnings, like "use of uninitialised variable at some place"

        That's not the exact error message. Don't give a vague description of what it's like. Tell us exactly what it is. Then show the code around it.

        To do that I created a perl environment in Tcl and used the open command to call my .pl file.

        That sounds reasonable, except that the code that you've posted isn't (as far as I can tell) valid Tcl code. I expect something closer to:

        set my_perl [open "|perl perl_file.pl $variable1 $variable2"] ...
        I provided this code snippet so as to confirm that the way with which I'm passing parameters from tcl to perl were correct.

        We'd have to see a lot more code, including the Perl program -- at least how it expects to access incoming parameters.