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

RE: [perlguitest] Writing a cross platform Perl script

Expand Messages
  • Sonam Chauhan
    ... covered. The group owner said last month that module installation failure for Perl on Cygwin is both expected and unsupported.
    Message 1 of 10 , May 25, 2006
    • 0 Attachment
      Hi Peter:

      > That means you don't have the module properly installed in the @INC
      > directories (for details, try "perl -V")...
      >
      > Do try to read the Perl FAQs, where the topic above and the
      > problem involved in that error message are both comprehensively
      covered.

      The group owner said last month that module installation failure for
      Perl on Cygwin is both expected and unsupported.

      http://groups.yahoo.com/group/perlguitest/message/1326
      --------------------------------------------------------
      Cygwin isn't supported. GuiTest was developed using only Visual C++.
      Cygwin uses gcc as compiler. That's where the errors come from.
      --------------------------------------------------------

      > When you get that sorted, you might also look at some of the options
      > that are possible in using "BEGIN" and for that matter, in using
      "ifdef"

      Thanks.


      Sincerely,
      Sonam Chauhan
      --
      Corporate Express Australia Ltd.
      Phone: +61-2-9335-0725, Email: sonam.chauhan@...
    • Susruth Sudhakaran
      sonam, try including the conditional use statement inside a BEGIN block..That should work Susruth Sonam Chauhan wrote: ...
      Message 2 of 10 , May 25, 2006
      • 0 Attachment
        sonam,

        try including the conditional 'use' statement inside a BEGIN block..That should work


        Susruth

        Sonam Chauhan <sonam.chauhan@...,hu> wrote:
        Hi Peter:

        > That means you don't have the module properly installed in the @INC
        > directories (for details, try "perl -V")...
        >
        > Do try to read the Perl FAQs, where the topic above and the
        > problem involved in that error message are both comprehensively
        covered.

        The group owner said last month that module installation failure for
        Perl on Cygwin is both expected and unsupported.

        http://groups.yahoo.com/group/perlguitest/message/1326
        --------------------------------------------------------
        Cygwin isn't supported. GuiTest was developed using only Visual C++.
        Cygwin uses gcc as compiler. That's where the errors come from.
        --------------------------------------------------------

        > When you get that sorted, you might also look at some of the options
        > that are possible in using "BEGIN" and for that matter, in using
        "ifdef"

        Thanks.


        Sincerely,
        Sonam Chauhan
        --
        Corporate Express Australia Ltd.
        Phone: +61-2-9335-0725, Email: sonam.chauhan@...


        SPONSORED LINKS
        Basic programming language C programming language Computer programming languages The c programming language C++ programming language Software programming language

        ---------------------------------
        YAHOO! GROUPS LINKS


        Visit your group "perlguitest" on the web.

        To unsubscribe from this group, send an email to:
        perlguitest-unsubscribe@yahoogroups.com

        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


        ---------------------------------





        Susruth Sudhakaran

        You are not responsible for what happens to you in life but you are definitely responsible for how you respond to it
        -------Some great Man(Not Me)



        ---------------------------------
        Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2ยข/min or less.

        [Non-text portions of this message have been removed]
      • Clement Cherlin
        ... block..That should work Actually, it won t, since use is already a compile-time directive. Using it inside a BEGIN block is redundant. From perlmod in
        Message 3 of 10 , May 25, 2006
        • 0 Attachment
          --- In perlguitest@yahoogroups.com, Susruth Sudhakaran <sush_1205@...>
          wrote:
          >
          > sonam,
          >
          > try including the conditional 'use' statement inside a BEGIN
          block..That should work

          Actually, it won't, since "use" is already a compile-time directive.
          Using it inside a BEGIN block is redundant. From "perlmod" in the
          Perl docs:

          ] Perl modules are included into your program by saying
          ]
          ] use Module;
          ] or
          ] use Module LIST;
          ]
          ] This is exactly equivalent to
          ]
          ] BEGIN { require Module; import Module; }
          ] or
          ] BEGIN { require Module; import Module LIST; }

          What you really want is something like this:

          BEGIN {
          if ($^O =~ /MSWin/) {

          require Win32::GuiTest;

          }
          else {

          require Proc::ProcessTable;

          }
          }
        • Sonam Chauhan
          Thanks Clement - it was require as you said. Thanks to Susruth as well. . I think can do away with a BEGIN block: the following code gave expected ... perl
          Message 4 of 10 , May 25, 2006
          • 0 Attachment
            Thanks Clement - it was 'require' as you said. Thanks to Susruth as
            well. .



            I think can do away with a BEGIN block: the following code gave expected
            output under both Cygwin and Windows:

            ----

            perl -e "if ($^O eq 'cygwin') {require Proc::ProcessTable; print 'found
            cygwin'} elsif ($^O eq 'MSWin32') {require Win32::GuiTest; print 'found
            windows'}"

            ----



            Sincerely,

            Sonam Chauhan

            ________________________________

            From: perlguitest@yahoogroups.com [mailto:perlguitest@yahoogroups.com]
            On Behalf Of Clement Cherlin
            Sent: Friday, 26 May 2006 5:53 AM
            To: perlguitest@yahoogroups.com
            Subject: [perlguitest] Re: Writing a cross platform Perl script



            --- In perlguitest@yahoogroups.com, Susruth Sudhakaran <sush_1205@...>
            wrote:
            >
            > sonam,
            >
            > try including the conditional 'use' statement inside a BEGIN
            block..That should work

            Actually, it won't, since "use" is already a compile-time directive.
            Using it inside a BEGIN block is redundant. From "perlmod" in the
            Perl docs:

            ] Perl modules are included into your program by saying
            ]
            ] use Module;
            ] or
            ] use Module LIST;
            ]
            ] This is exactly equivalent to
            ]
            ] BEGIN { require Module; import Module; }
            ] or
            ] BEGIN { require Module; import Module LIST; }

            What you really want is something like this:

            BEGIN {
            if ($^O =~ /MSWin/) {

            require Win32::GuiTest;

            }
            else {

            require Proc::ProcessTable;

            }
            }






            SPONSORED LINKS

            Basic programming language
            <http://groups.yahoo.com/gads?t=ms&k=Basic+programming+language&w1=Basic
            +programming+language&w2=C+programming+language&w3=Computer+programming+
            languages&w4=The+c+programming+language&w5=C+++programming+language&w6=S
            oftware+programming+language&c=6&s=193&.sig=p2tsb9F38_BRtgYd-Lrx9w>

            C programming language
            <http://groups.yahoo.com/gads?t=ms&k=C+programming+language&w1=Basic+pro
            gramming+language&w2=C+programming+language&w3=Computer+programming+lang
            uages&w4=The+c+programming+language&w5=C+++programming+language&w6=Softw
            are+programming+language&c=6&s=193&.sig=s417rQDhIfEJWoylZxl7QQ>

            Computer programming languages
            <http://groups.yahoo.com/gads?t=ms&k=Computer+programming+languages&w1=B
            asic+programming+language&w2=C+programming+language&w3=Computer+programm
            ing+languages&w4=The+c+programming+language&w5=C+++programming+language&
            w6=Software+programming+language&c=6&s=193&.sig=QgdknWHEB-7BcpDElLJcYw>


            The c programming language
            <http://groups.yahoo.com/gads?t=ms&k=The+c+programming+language&w1=Basic
            +programming+language&w2=C+programming+language&w3=Computer+programming+
            languages&w4=The+c+programming+language&w5=C+++programming+language&w6=S
            oftware+programming+language&c=6&s=193&.sig=DSnZ2EFeZa_krjnfz_P5vQ>

            C++ programming language
            <http://groups.yahoo.com/gads?t=ms&k=C+++programming+language&w1=Basic+p
            rogramming+language&w2=C+programming+language&w3=Computer+programming+la
            nguages&w4=The+c+programming+language&w5=C+++programming+language&w6=Sof
            tware+programming+language&c=6&s=193&.sig=IvzvhTPnaj_LFsbqs2knAg>

            Software programming language
            <http://groups.yahoo.com/gads?t=ms&k=Software+programming+language&w1=Ba
            sic+programming+language&w2=C+programming+language&w3=Computer+programmi
            ng+languages&w4=The+c+programming+language&w5=C+++programming+language&w
            6=Software+programming+language&c=6&s=193&.sig=pUnPrY01tNTjZVkDEHkvYQ>



            ________________________________

            YAHOO! GROUPS LINKS



            * Visit your group "perlguitest
            <http://groups.yahoo.com/group/perlguitest> " on the web.

            * To unsubscribe from this group, send an email to:
            perlguitest-unsubscribe@yahoogroups.com
            <mailto:perlguitest-unsubscribe@yahoogroups.com?subject=Unsubscribe>

            * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
            Service <http://docs.yahoo.com/info/terms/> .



            ________________________________



            [Non-text portions of this message have been removed]
          • Sonam Chauhan
            Sorry Clement - you are exactly right - the require statements need to be within BEGIN blocks for subroutines in modules to be referenced properly at compile
            Message 5 of 10 , May 25, 2006
            • 0 Attachment
              Sorry Clement - you are exactly right - the 'require' statements need to
              be within BEGIN blocks for subroutines in modules to be referenced
              properly at compile time.



              As you said:



              BEGIN {
              if ($^O =~ /MSWin/) {
              require Win32::GuiTest;
              }
              else {
              require Proc::ProcessTable;
              }
              }




              Sincerely,

              Sonam Chauhan

              ________________________________

              From: Sonam Chauhan
              Sent: Friday, 26 May 2006 11:26 AM
              To: 'perlguitest@yahoogroups.com'
              Subject: RE: [perlguitest] Re: Writing a cross platform Perl script



              Thanks Clement - it was 'require' as you said. Thanks to Susruth as
              well. .



              I think can do away with a BEGIN block: the following code gave expected
              output under both Cygwin and Windows:

              ----

              perl -e "if ($^O eq 'cygwin') {require Proc::ProcessTable; print 'found
              cygwin'} elsif ($^O eq 'MSWin32') {require Win32::GuiTest; print 'found
              windows'}"

              ----



              Sincerely,

              Sonam Chauhan

              ________________________________

              From: perlguitest@yahoogroups.com [mailto:perlguitest@yahoogroups.com]
              On Behalf Of Clement Cherlin
              Sent: Friday, 26 May 2006 5:53 AM
              To: perlguitest@yahoogroups.com
              Subject: [perlguitest] Re: Writing a cross platform Perl script



              --- In perlguitest@yahoogroups.com, Susruth Sudhakaran <sush_1205@...>
              wrote:
              >
              > sonam,
              >
              > try including the conditional 'use' statement inside a BEGIN
              block..That should work

              Actually, it won't, since "use" is already a compile-time directive.
              Using it inside a BEGIN block is redundant. From "perlmod" in the
              Perl docs:

              ] Perl modules are included into your program by saying
              ]
              ] use Module;
              ] or
              ] use Module LIST;
              ]
              ] This is exactly equivalent to
              ]
              ] BEGIN { require Module; import Module; }
              ] or
              ] BEGIN { require Module; import Module LIST; }

              What you really want is something like this:

              BEGIN {
              if ($^O =~ /MSWin/) {

              require Win32::GuiTest;

              }
              else {

              require Proc::ProcessTable;

              }
              }





              SPONSORED LINKS

              Basic programming language
              <http://groups.yahoo.com/gads?t=ms&k=Basic+programming+language&w1=Basic
              +programming+language&w2=C+programming+language&w3=Computer+programming+
              languages&w4=The+c+programming+language&w5=C+++programming+language&w6=S
              oftware+programming+language&c=6&s=193&.sig=p2tsb9F38_BRtgYd-Lrx9w>

              C programming language
              <http://groups.yahoo.com/gads?t=ms&k=C+programming+language&w1=Basic+pro
              gramming+language&w2=C+programming+language&w3=Computer+programming+lang
              uages&w4=The+c+programming+language&w5=C+++programming+language&w6=Softw
              are+programming+language&c=6&s=193&.sig=s417rQDhIfEJWoylZxl7QQ>

              Computer programming languages
              <http://groups.yahoo.com/gads?t=ms&k=Computer+programming+languages&w1=B
              asic+programming+language&w2=C+programming+language&w3=Computer+programm
              ing+languages&w4=The+c+programming+language&w5=C+++programming+language&
              w6=Software+programming+language&c=6&s=193&.sig=QgdknWHEB-7BcpDElLJcYw>


              The c programming language
              <http://groups.yahoo.com/gads?t=ms&k=The+c+programming+language&w1=Basic
              +programming+language&w2=C+programming+language&w3=Computer+programming+
              languages&w4=The+c+programming+language&w5=C+++programming+language&w6=S
              oftware+programming+language&c=6&s=193&.sig=DSnZ2EFeZa_krjnfz_P5vQ>

              C++ programming language
              <http://groups.yahoo.com/gads?t=ms&k=C+++programming+language&w1=Basic+p
              rogramming+language&w2=C+programming+language&w3=Computer+programming+la
              nguages&w4=The+c+programming+language&w5=C+++programming+language&w6=Sof
              tware+programming+language&c=6&s=193&.sig=IvzvhTPnaj_LFsbqs2knAg>

              Software programming language
              <http://groups.yahoo.com/gads?t=ms&k=Software+programming+language&w1=Ba
              sic+programming+language&w2=C+programming+language&w3=Computer+programmi
              ng+languages&w4=The+c+programming+language&w5=C+++programming+language&w
              6=Software+programming+language&c=6&s=193&.sig=pUnPrY01tNTjZVkDEHkvYQ>



              ________________________________

              YAHOO! GROUPS LINKS



              * Visit your group "perlguitest
              <http://groups.yahoo.com/group/perlguitest> " on the web.

              * To unsubscribe from this group, send an email to:
              perlguitest-unsubscribe@yahoogroups.com
              <mailto:perlguitest-unsubscribe@yahoogroups.com?subject=Unsubscribe>

              * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
              Service <http://docs.yahoo.com/info/terms/> .



              ________________________________



              [Non-text portions of this message have been removed]
            • Clement Cherlin
              If that works for you, great! For an object-oriented module, it probably doesn t matter whether you use a BEGIN block or not, since method calls are
              Message 6 of 10 , May 26, 2006
              • 0 Attachment
                If that works for you, great! For an object-oriented module, it probably doesn't matter whether you use a BEGIN block or not, since method calls are dispatched at run-time.

                On the other hand, if you want to import symbols from a package, use package constants, take advantage of sub prototypes, or other compile-time features and optimizations, you'll need to put your require statement into a BEGIN block so that the module is available at compile-time.

                Basically, putting a require statement inside a BEGIN block doesn't hurt and it could help, so it's safer as a rule of thumb.

                ----- Original Message ----
                From: Sonam Chauhan <sonam.chauhan@...>
                To: perlguitest@yahoogroups.com
                Sent: Thursday, May 25, 2006 6:25:30 PM
                Subject: RE: [perlguitest] Re: Writing a cross platform Perl script

                Thanks Clement - it was 'require' as you said. Thanks to Susruth as
                well. .



                I think can do away with a BEGIN block: the following code gave expected
                output under both Cygwin and Windows:

                ----

                perl -e "if ($^O eq 'cygwin') {require Proc::ProcessTable; print 'found
                cygwin'} elsif ($^O eq 'MSWin32') {require Win32::GuiTest; print 'found
                windows'}"

                ----



                Sincerely,

                Sonam Chauhan

                ________________________________

                From: perlguitest@yahoogroups.com [mailto:perlguitest@yahoogroups.com]
                On Behalf Of Clement Cherlin
                Sent: Friday, 26 May 2006 5:53 AM
                To: perlguitest@yahoogroups.com
                Subject: [perlguitest] Re: Writing a cross platform Perl script



                --- In perlguitest@yahoogroups.com, Susruth Sudhakaran <sush_1205@...>
                wrote:
                >
                > sonam,
                >
                > try including the conditional 'use' statement inside a BEGIN
                block..That should work

                Actually, it won't, since "use" is already a compile-time directive.
                Using it inside a BEGIN block is redundant. From "perlmod" in the
                Perl docs:

                ] Perl modules are included into your program by saying
                ]
                ] use Module;
                ] or
                ] use Module LIST;
                ]
                ] This is exactly equivalent to
                ]
                ] BEGIN { require Module; import Module; }
                ] or
                ] BEGIN { require Module; import Module LIST; }

                What you really want is something like this:

                BEGIN {
                if ($^O =~ /MSWin/) {

                require Win32::GuiTest;

                }
                else {

                require Proc::ProcessTable;

                }
                }






                SPONSORED LINKS

                Basic programming language
                <http://groups.yahoo.com/gads?t=ms&k=Basic+programming+language&w1=Basic
                +programming+language&w2=C+programming+language&w3=Computer+programming+
                languages&w4=The+c+programming+language&w5=C+++programming+language&w6=S
                oftware+programming+language&c=6&s=193&.sig=p2tsb9F38_BRtgYd-Lrx9w>

                C programming language
                <http://groups.yahoo.com/gads?t=ms&k=C+programming+language&w1=Basic+pro
                gramming+language&w2=C+programming+language&w3=Computer+programming+lang
                uages&w4=The+c+programming+language&w5=C+++programming+language&w6=Softw
                are+programming+language&c=6&s=193&.sig=s417rQDhIfEJWoylZxl7QQ>

                Computer programming languages
                <http://groups.yahoo.com/gads?t=ms&k=Computer+programming+languages&w1=B
                asic+programming+language&w2=C+programming+language&w3=Computer+programm
                ing+languages&w4=The+c+programming+language&w5=C+++programming+language&
                w6=Software+programming+language&c=6&s=193&.sig=QgdknWHEB-7BcpDElLJcYw>


                The c programming language
                <http://groups.yahoo.com/gads?t=ms&k=The+c+programming+language&w1=Basic
                +programming+language&w2=C+programming+language&w3=Computer+programming+
                languages&w4=The+c+programming+language&w5=C+++programming+language&w6=S
                oftware+programming+language&c=6&s=193&.sig=DSnZ2EFeZa_krjnfz_P5vQ>

                C++ programming language
                <http://groups.yahoo.com/gads?t=ms&k=C+++programming+language&w1=Basic+p
                rogramming+language&w2=C+programming+language&w3=Computer+programming+la
                nguages&w4=The+c+programming+language&w5=C+++programming+language&w6=Sof
                tware+programming+language&c=6&s=193&.sig=IvzvhTPnaj_LFsbqs2knAg>

                Software programming language
                <http://groups.yahoo.com/gads?t=ms&k=Software+programming+language&w1=Ba
                sic+programming+language&w2=C+programming+language&w3=Computer+programmi
                ng+languages&w4=The+c+programming+language&w5=C+++programming+language&w
                6=Software+programming+language&c=6&s=193&.sig=pUnPrY01tNTjZVkDEHkvYQ>



                ________________________________

                YAHOO! GROUPS LINKS



                * Visit your group "perlguitest
                <http://groups.yahoo.com/group/perlguitest> " on the web.

                * To unsubscribe from this group, send an email to:
                perlguitest-unsubscribe@yahoogroups.com
                <mailto:perlguitest-unsubscribe@yahoogroups.com?subject=Unsubscribe>

                * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
                Service <http://docs.yahoo.com/info/terms/> .



                ________________________________



                [Non-text portions of this message have been removed]







                Yahoo! Groups Links











                [Non-text portions of this message have been removed]
              Your message has been successfully submitted and would be delivered to recipients shortly.