Loading ...
Sorry, an error occurred while loading the content.

Make-ing Perl Modules & CPAN

Expand Messages
  • Arga M. Nugraha
    # Writing new mail ... Yoohoo! Hello, all. First, I must confess that I m a newbie at Perl. I m sorry if my following questions has been answered before. I
    Message 1 of 6 , Nov 3, 2002
    • 0 Attachment
      # Writing new mail ...

      Yoohoo!

      Hello, all. First, I must confess that I'm a newbie at Perl. I'm sorry if my
      following questions has been answered before. I have tried to find their
      answers in the Perl distribution FAQs and several CGI & Perl books, but I
      failed to find any satisfactory results (if any). FYI, I'm currently running
      on Windows2000 Advanced Server with ActivePerl 521 (5.005_003) installed on
      IIS 5.0 (intranet only)..

      Here are my questions:
      1) I have obtained a Perl modul in the form of .tar.gz file and I tried to
      install them manualy (i.e. without CPAN). I succeeded doing "perl
      Makefile.pl", but got stumped in the second part: "make". Because I was told
      that Win2K doesn't have a "make" executable, I downloaded NMAKE15.EXE from
      ftp.microsoft.com. The problem is, everytime I do "nmake", it stops with
      this error "'cl.exe' is not recognized as an internal or external command,
      operable program or batch file.NMAKE : fatal error U1077:
      'C:\WINNT\system32\cmd.exe' : return code '0x1'
      Stop." Do I have to have cl.exe? Where can I find one?

      2) ActivePerl's CPAN-like module (PPM) has the ability to manipulate local
      packages. This way, I can download .zip Perl Module packages (without using
      PPM itself), and the have PPM process it offline. Can I do this kind of
      thing with Perl's CPAN module?

      3) Can "use" statement be used with variables so we can dynamically assign
      module uses? Perhaps like "use $module;" where "$module="CGI";"?

      4) Is it possible for a perl script to call another perl script based on a
      query string?

      5) Are there any source code repository for Perl scripts?

      That's all for now. :)
      I hope my questions don't bother any of you. Thankyou ver much in advance.

      Ave,
      Arga le Gardine
    • Jenda Krynicky
      From: Arga M. Nugraha ... cl.exe is the commandline version of the Visual C++ compiler. You d have to buy Visual Studio (older than
      Message 2 of 6 , Nov 3, 2002
      • 0 Attachment
        From: "Arga M. Nugraha" <gardine@...>
        > Hello, all. First, I must confess that I'm a newbie at Perl. I'm sorry
        > if my following questions has been answered before. I have tried to
        > find their answers in the Perl distribution FAQs and several CGI &
        > Perl books, but I failed to find any satisfactory results (if any).
        > FYI, I'm currently running on Windows2000 Advanced Server with
        > ActivePerl 521 (5.005_003) installed on IIS 5.0 (intranet only)..
        >
        > Here are my questions:
        > 1) I have obtained a Perl modul in the form of .tar.gz file and I
        > tried to install them manualy (i.e. without CPAN). I succeeded doing
        > "perl Makefile.pl", but got stumped in the second part: "make".
        > Because I was told that Win2K doesn't have a "make" executable, I
        > downloaded NMAKE15.EXE from ftp.microsoft.com. The problem is,
        > everytime I do "nmake", it stops with this error "'cl.exe' is not
        > recognized as an internal or external command, operable program or
        > batch file.NMAKE : fatal error U1077: 'C:\WINNT\system32\cmd.exe' :
        > return code '0x1' Stop." Do I have to have cl.exe? Where can I find
        > one?

        cl.exe is the commandline version of the Visual C++ compiler. You'd
        have to buy Visual Studio (older than .Net!) to get it.
        You may use a different compiler, some of them should be free.
        Sorry can't help you here, but if you look into the Perl-win32-FAQ
        (installed with ActivePerl) you should find a list with addresses.

        > 2) ActivePerl's CPAN-like module (PPM) has the ability to manipulate
        > local packages. This way, I can download .zip Perl Module packages
        > (without using PPM itself), and the have PPM process it offline. Can I
        > do this kind of thing with Perl's CPAN module?

        Afaik no. If you've downloaded it manualy you can install manualy
        too.

        > 3) Can "use" statement be used with variables so we can dynamically
        > assign module uses? Perhaps like "use $module;" where
        > "$module="CGI";"?

        eval "use $module;";

        > 4) Is it possible for a perl script to call another perl script based
        > on a query string?

        ???
        You can call anything with system(), ``, fork()+exec(), open(PIPE,
        '|...), open(PIPE, '...|', IPC::Open2, IPC::Open3, ...

        > 5) Are there any source code repository for Perl scripts?

        There are some scripts on CPAN other than that ... google.com is your
        friend.

        Jenda
        ===== Jenda@... === http://Jenda.Krynicky.cz =====
        When it comes to wine, women and song, wizards are allowed
        to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery
      • Arga M. Nugraha
        # Replying mail ... Yoohoo! Thanks to Jenda Krynicky & Vakeel Ahmad for answering. Unfortunately, all I have is another question. :) ... I take your ??? as a
        Message 3 of 6 , Nov 7, 2002
        • 0 Attachment
          # Replying mail ...

          Yoohoo!

          Thanks to Jenda Krynicky & Vakeel Ahmad for answering. Unfortunately, all I
          have is another question. :)

          > > 4) Is it possible for a perl script to call another perl script based
          > > on a query string?
          >
          > ???
          > You can call anything with system(), ``, fork()+exec(), open(PIPE,
          > '|...), open(PIPE, '...|', IPC::Open2, IPC::Open3, ...

          I take your '???' as a sign for my bad phrasing. :) Perhaps better if I use
          an example: can this_script.pl call that_script.pl when someone clicks on
          the link www.blahblah.com/cgi-bin/this_script.pl?that_script.pl ?

          Anyway, I read somewhere that the fork function doesn't work on Win32. Is
          this true? If it is, I can't use it on my code, as I'm trying to write a
          very portable application. Are there any other way around?

          Thanks in advance.

          Ave,
          Arga le Gardine
          http://www.gardine.or.id
        • Octavian Rasnita
          Oh yes, fork works on Windows. At least in Win 2k, NT and XP and I guess nobody uses Win 98 for a web server. But I don t know, ... maybe it also works on Win
          Message 4 of 6 , Nov 7, 2002
          • 0 Attachment
            Oh yes, fork works on Windows. At least in Win 2k, NT and XP and I guess
            nobody uses Win 98 for a web server. But I don't know, ... maybe it also
            works on Win 98.

            If you want to call another perl script from a perl script, you can use:

            1. If both scripts are on the same machine:

            require "/var/www/cgi-bin/script2.pl";
            or
            exec "perl script2.pl";
            or
            system "perl script2.pl";

            If the execution of the second perl script takes a long time, you can fork
            another process, and execute the second script in the background.

            2. If the second script is on the same machine, or on another one you can
            call the second script using the LWP module, or if you want, IO::Socket.
            In this case, you will call the script using its full address like:
            www.secondsite.com/cgi-bin/script2.pl.

            If you just want to run the second perl script as a final result, and if the
            second script will print the results on the page, you can use:

            print "Location: $script2\n\n";

            $script2 will contain the URI of your second perl script.




            Teddy,
            Teddy's Center: http://teddy.fcc.ro/
            Email: orasnita@...

            ----- Original Message -----
            From: "Arga M. Nugraha" <gardine@...>
            To: <perl-beginner@yahoogroups.com>
            Sent: Thursday, November 07, 2002 10:45 AM
            Subject: Re: [PBML] Make-ing Perl Modules & CPAN


            # Replying mail ...

            Yoohoo!

            Thanks to Jenda Krynicky & Vakeel Ahmad for answering. Unfortunately, all I
            have is another question. :)

            > > 4) Is it possible for a perl script to call another perl script based
            > > on a query string?
            >
            > ???
            > You can call anything with system(), ``, fork()+exec(), open(PIPE,
            > '|...), open(PIPE, '...|', IPC::Open2, IPC::Open3, ...

            I take your '???' as a sign for my bad phrasing. :) Perhaps better if I use
            an example: can this_script.pl call that_script.pl when someone clicks on
            the link www.blahblah.com/cgi-bin/this_script.pl?that_script.pl ?

            Anyway, I read somewhere that the fork function doesn't work on Win32. Is
            this true? If it is, I can't use it on my code, as I'm trying to write a
            very portable application. Are there any other way around?

            Thanks in advance.

            Ave,
            Arga le Gardine
            http://www.gardine.or.id


            Unsubscribing info is here:
            http://help.yahoo.com/help/us/groups/groups-32.html

            Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
          • Rich Pascual
            Perhaps better if I use an example: can this_script.pl call that_script.pl when someone clicks on the link
            Message 5 of 6 , Nov 7, 2002
            • 0 Attachment
              Perhaps better if I use an example: can this_script.pl call that_script.pl when someone clicks on the link www.blahblah.com/cgi-bin/this_script.pl?that_script.pl ?


              I have done this before. I put a link on a webpage that calls: this_script.pl while passing a parameter. For example

              <a href='this_script.pl?go=1>this_script</a>

              Within this_script.pl, I put a conditional statement:

              if (param('go')) {

              qx/$SCRIPT/;

              }

              Where $SCRIPT is just a variable containing a reference to that_script.pl (i.e., /path/to/that_script.pl) You can also use backtick notation instead of qx/ to make the system call that runs that_script.pl

              A warning: my biggest problem with getting this to work is understanding how programs are run through a webserver. You may be testing out that_script.pl as a certain user, but it may not work when you try to call it through a web page... that's because it is likely that the webserver, when executing the program will be using a generic user account (most likely "www" but it depends on how you configured your webserver). Keep this in mind.. it cost me hours of frustration to figure out.

              Good Luck,

              Rich



              ---------------------------------
              Do you Yahoo!?
              U2 on LAUNCH - Exclusive medley & videos from Greatest Hits CD

              [Non-text portions of this message have been removed]
            • Nathan.Jeffrey@dhs.vic.gov.au
              Well, technically it still doesn t (Win32 doesn t have a lot of POSIX), but the brilliant minds working in the background came up with a solution. Ever since
              Message 6 of 6 , Nov 7, 2002
              • 0 Attachment
                Well, technically it still doesn't (Win32 doesn't have a lot of POSIX),
                but the brilliant minds working in the background came up with a solution.
                Ever since perl 5.6.1, Win32 perl has been able to fork() by running a
                pseudo-process within itself. You can see them show up as negative
                process IDs.

                How stable it is, well, that's open to question, but I've used it a bit
                with no problems.

                Other than that, every system will support an open() or system() call to
                some extent, so you can rely on those being there.

                N





                "Arga M. Nugraha" <gardine@...>
                07/11/2002 07:45 PM
                Please respond to perl-beginner


                To: <perl-beginner@yahoogroups.com>
                cc:
                Subject: Re: [PBML] Make-ing Perl Modules & CPAN


                # Replying mail ...

                Yoohoo!

                Thanks to Jenda Krynicky & Vakeel Ahmad for answering. Unfortunately, all
                I
                have is another question. :)

                > > 4) Is it possible for a perl script to call another perl script based
                > > on a query string?
                >
                > ???
                > You can call anything with system(), ``, fork()+exec(), open(PIPE,
                > '|...), open(PIPE, '...|', IPC::Open2, IPC::Open3, ...

                I take your '???' as a sign for my bad phrasing. :) Perhaps better if I
                use
                an example: can this_script.pl call that_script.pl when someone clicks on
                the link www.blahblah.com/cgi-bin/this_script.pl?that_script.pl ?

                Anyway, I read somewhere that the fork function doesn't work on Win32. Is
                this true? If it is, I can't use it on my code, as I'm trying to write a
                very portable application. Are there any other way around?

                Thanks in advance.

                Ave,
                Arga le Gardine
                http://www.gardine.or.id


                Unsubscribing info is here:
                http://help.yahoo.com/help/us/groups/groups-32.html

                Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/







                _________________________________________________________________________________

                This email contains confidential information intended only for the person named above and may be subject to legal privilege. If you are not the intended recipient, any disclosure, copying or use of this information is prohibited. The Department provides no guarantee that this communication is free of virus or that it has not been intercepted or interfered with. If you have received this email in error or have any other concerns regarding its transmission, please notify Postmaster@...
                _________________________________________________________________________________
              Your message has been successfully submitted and would be delivered to recipients shortly.