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

Re: [PBML] Switching from Windows to Unix -- Flush issue

Expand Messages
  • J.E. Cripps
    ... the code: #!/usr/bin/perl -w; use strict; my $newfilename =1000227_0000950116-05-001151.txt; print 10k file exists $newfilename n gives the output: 10k
    Message 1 of 14 , Aug 9 9:43 PM
    • 0 Attachment
      > I just bought a Mac and I'm trying to run a script I wrote on my
      > windows machine (that worked when I ran it in dos) on unix now.

      the code:

      #!/usr/bin/perl -w;
      use strict;
      my $newfilename =1000227_0000950116-05-001151.txt;
      print "10k file exists $newfilename\n"

      gives the output:

      10k file exists 1000227_0000950116-05-001151.txt

      on 1. FreeBSD and 2. Linux Mandrake

      Just what OS is on your Mac?
    • Prasanna Goupal
      Hi, I am getting following error while loading the cgi page. Out of memory! I checked the error from apache error log. If anbody have any idea about it then
      Message 2 of 14 , Aug 10 12:25 AM
      • 0 Attachment
        Hi,

        I am getting following error while loading the cgi page.
        Out of memory!

        I checked the error from apache error log.
        If anbody have any idea about it then please let me know.

        Thanks.

        Regards,
        Prasanna A. Goupal


        ---------------------------------
        Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1¢/min.

        [Non-text portions of this message have been removed]
      • Mike Southern
        ... Oh come on Mr perldeveloper ... How on earth in your experience as perl developer do you expect anybody to help you out when you supply absolutely NO
        Message 3 of 14 , Aug 10 3:03 AM
        • 0 Attachment
          On 8/10/06 3:25 AM, Prasanna Goupal at perl_developer@... wrote:

          > I am getting following error while loading the cgi page.
          > Out of memory!
          >
          > I checked the error from apache error log.
          > If anbody have any idea about it then please let me know.
          >
          > Thanks.
          >
          > Regards,
          > Prasanna A. Goupal

          Oh come on Mr perldeveloper ... How on earth in your experience as "perl
          developer" do you expect anybody to help you out when you supply absolutely
          NO additional information.

          Like:
          * what is your server environment
          * how is the script launched
          * what is the script trying to do

          If you aren't prepared to do that then you'll have to figure it out for
          yourself. If you don't think for yourself, why should I?

          Without more information, my answer would be "you are receiving the message
          because you are attempting to perform a task for which there is not enough
          memory".
        • Charles K. Clarkson
          ... Your CGI application is probably using more than the available memory. For more detailed solutions provide more detailed information. The code you are
          Message 4 of 14 , Aug 10 4:11 AM
          • 0 Attachment
            Prasanna Goupal wrote:

            : I am getting following error while loading the cgi page.
            : Out of memory!
            :
            : I checked the error from apache error log.
            : If anbody have any idea about it then please let me know.

            Your CGI application is probably using more than the
            available memory. For more detailed solutions provide
            more detailed information. The code you are running, for
            example.


            HTH,

            Charles K. Clarkson
            --
            Mobile Homes Specialist
            Free Market Advocate
            Web Programmer

            254 968-8328

            Don't tread on my bandwidth. Trim your posts.
          • Mike Southern
            ... Oh come on Mr perldeveloper ... How on earth in your experience as perl developer do you expect anybody to help you out when you supply absolutely NO
            Message 5 of 14 , Aug 10 4:22 AM
            • 0 Attachment
              On 8/10/06 3:25 AM, Prasanna Goupal at perl_developer@... wrote:

              > I am getting following error while loading the cgi page.
              > Out of memory!
              >
              > I checked the error from apache error log.
              > If anbody have any idea about it then please let me know.
              >
              > Thanks.
              >
              > Regards,
              > Prasanna A. Goupal

              Oh come on Mr perldeveloper ... How on earth in your experience as "perl
              developer" do you expect anybody to help you out when you supply absolutely
              NO additional information.

              Like:
              * what is your server environment
              * how is the script launched
              * what is the script trying to do

              If you aren't prepared to do that then you'll have to figure it out for
              yourself. If you don't think for yourself, why should I?

              Without more information, my answer would be "you are receiving the message
              because you are attempting to perform a task for which there is not enough
              memory".
            • Rob Biedenharn
              ... Interesting, on my Mac, that exact code produces: rab:tmp $ cat x.pl #!/usr/bin/perl -w; use strict; my $newfilename =1000227_0000950116-05-001151.txt;
              Message 6 of 14 , Aug 10 6:48 AM
              • 0 Attachment
                On Aug 10, 2006, at 12:43 AM, J.E. Cripps wrote:
                >> I just bought a Mac and I'm trying to run a script I wrote on my
                >> windows machine (that worked when I ran it in dos) on unix now.
                >
                > the code:
                >
                > #!/usr/bin/perl -w;
                > use strict;
                > my $newfilename =1000227_0000950116-05-001151.txt;
                > print "10k file exists $newfilename\n"
                >
                > gives the output:
                >
                > 10k file exists 1000227_0000950116-05-001151.txt
                >
                > on 1. FreeBSD and 2. Linux Mandrake
                >
                > Just what OS is on your Mac?

                Interesting, on my Mac, that exact code produces:

                rab:tmp $ cat x.pl
                #!/usr/bin/perl -w;
                use strict;
                my $newfilename =1000227_0000950116-05-001151.txt;
                print "10k file exists $newfilename\n"
                rab:tmp $ ./x.pl
                Unrecognized switch: -; (-h will show valid options).

                Hmm.. Oh, get rid of that semi-colon:

                rab:tmp $ cat x.pl
                #!/usr/bin/perl -w
                use strict;
                my $newfilename =1000227_0000950116-05-001151.txt;
                print "10k file exists $newfilename\n"
                rab:tmp $ ./x.pl
                Bareword "txt" not allowed while "strict subs" in use at ./x.pl line 3.
                Execution of ./x.pl aborted due to compilation errors.

                Oh yeah! Put quotes around that filename:

                rab:tmp $ cat x.pl
                #!/usr/bin/perl -w
                use strict;
                my $newfilename = '1000227_0000950116-05-001151.txt';
                print "10k file exists $newfilename\n"
                rab:tmp $ ./x.pl
                10k file exists 1000227_0000950116-05-001151.txt

                Hey, that looks alright! But the OP didn't have \n in his print
                statement:

                rab:tmp $ cat x.pl
                #!/usr/bin/perl -w
                use strict;
                my $newfilename = '1000227_0000950116-05-001151.txt';
                print "10k file exists $newfilename"
                rab:tmp $ ./x.pl
                10k file exists 1000227_0000950116-05-001151.txtrab:tmp $

                That looks familiar!

                Perhaps you just need to define your end-of-line behavior.

                And to be exact, my OS is:
                rab:tmp $ uname -rv
                8.7.1 Darwin Kernel Version 8.7.1: Wed Jun 7 16:19:56 PDT 2006;
                root:xnu-792.9.72.obj~2/RELEASE_I386

                -Rob

                Rob Biedenharn http://agileconsultingllc.com
                Rob@...

                [Non-text portions of this message have been removed]
              • sarahjfriedman
                ... It s Mac OS X
                Message 7 of 14 , Aug 10 10:48 AM
                • 0 Attachment
                  --- In perl-beginner@yahoogroups.com, "J.E. Cripps" <cycmn@...> wrote:
                  >
                  >
                  > > I just bought a Mac and I'm trying to run a script I wrote on my
                  > > windows machine (that worked when I ran it in dos) on unix now.
                  >
                  > the code:
                  >
                  > #!/usr/bin/perl -w;
                  > use strict;
                  > my $newfilename =1000227_0000950116-05-001151.txt;
                  > print "10k file exists $newfilename\n"
                  >
                  > gives the output:
                  >
                  > 10k file exists 1000227_0000950116-05-001151.txt
                  >
                  > on 1. FreeBSD and 2. Linux Mandrake
                  >
                  > Just what OS is on your Mac?
                  >
                  It's Mac OS X
                • Prasanna Goupal
                  Hi, I was executing script under apache server and in redhat 8. But when i had modified the sql query, it is working fine. Thanks for your reply. Regards,
                  Message 8 of 14 , Aug 10 11:37 PM
                  • 0 Attachment
                    Hi,

                    I was executing script under apache server and in redhat 8.
                    But when i had modified the sql query, it is working fine.

                    Thanks for your reply.

                    Regards,
                    Prasanna


                    Mike Southern <gb1198@...> wrote:
                    On 8/10/06 3:25 AM, Prasanna Goupal at perl_developer@... wrote:

                    > I am getting following error while loading the cgi page.
                    > Out of memory!
                    >
                    > I checked the error from apache error log.
                    > If anbody have any idea about it then please let me know.
                    >
                    > Thanks.
                    >
                    > Regards,
                    > Prasanna A. Goupal

                    Oh come on Mr perldeveloper ... How on earth in your experience as "perl
                    developer" do you expect anybody to help you out when you supply absolutely
                    NO additional information.

                    Like:
                    * what is your server environment
                    * how is the script launched
                    * what is the script trying to do

                    If you aren't prepared to do that then you'll have to figure it out for
                    yourself. If you don't think for yourself, why should I?

                    Without more information, my answer would be "you are receiving the message
                    because you are attempting to perform a task for which there is not enough
                    memory".






                    ---------------------------------
                    Do you Yahoo!?
                    Next-gen email? Have it all with the all-new Yahoo! Mail Beta.

                    [Non-text portions of this message have been removed]
                  • Prasanna Goupal
                    Hi, I am tring to wite data from hash to the file, i got following error. Inappropriate ioctl for device If Anybody have any idea about that, then please let
                    Message 9 of 14 , Aug 10 11:38 PM
                    • 0 Attachment
                      Hi,

                      I am tring to wite data from hash to the file, i got following error.

                      Inappropriate ioctl for device

                      If Anybody have any idea about that, then please let me know.
                      Thanks.

                      Regards,
                      Prasanna




                      ---------------------------------
                      How low will we go? Check out Yahoo! Messenger’s low PC-to-Phone call rates.

                      [Non-text portions of this message have been removed]
                    • Charles K. Clarkson
                      ... You are probably trying to access a device (socket, file, etc.) in a way which it cannot be accessed. Like trying to write to a CD-reader. If you provide
                      Message 10 of 14 , Aug 11 1:59 AM
                      • 0 Attachment
                        Prasanna Goupal wrote:
                        :
                        : I am tring to wite data from hash to the file, i got
                        : following error.
                        :
                        : Inappropriate ioctl for device
                        :
                        : If Anybody have any idea about that, then please
                        : let me know.

                        You are probably trying to access a device (socket,
                        file, etc.) in a way which it cannot be accessed. Like
                        trying to write to a CD-reader. If you provide some code
                        illustrating the problem, I might be more specific.



                        HTH,

                        Charles K. Clarkson
                        --
                        Mobile Homes Specialist
                        Free Market Advocate
                        Web Programmer

                        254 968-8328

                        Don't tread on my bandwidth. Trim your posts.
                      • merlyn@stonehenge.com
                        ... Prasanna I am tring to wite data from hash to the file, i got following error. Prasanna Inappropriate ioctl for device What are you doing immediately
                        Message 11 of 14 , Aug 11 6:27 AM
                        • 0 Attachment
                          >>>>> "Prasanna" == Prasanna Goupal <perl_developer@...> writes:

                          Prasanna> I am tring to wite data from hash to the file, i got following error.

                          Prasanna> Inappropriate ioctl for device

                          What are you doing immediately prior to this? Are you *sure* you got
                          a system-related error?

                          Are you checking $!, without first having been told that you had
                          an I/O error? Keep in mind that $! is set on error, BUT NEVER RESET
                          ON SUCCESS. So for example, this is broken:

                          print "something";
                          die $! if $!;

                          But this is ok:

                          print "something" or die "can't print: $!";

                          Maybe that's what you're seeing: a spurious $! left over from something
                          that happened long before your (successful) I/O.

                          --
                          Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
                          <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
                          Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See
                          PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
                        • Prasanna Goupal
                          Hi, There is one file which contains list of hashes. I had require this file in main program and accessing the value for perticular key and printing this value
                          Message 12 of 14 , Aug 13 9:51 PM
                          • 0 Attachment
                            Hi,

                            There is one file which contains list of hashes. I had require this file in main program and accessing the value for perticular key and printing this value to the file.

                            For testing i had written the code like

                            my $temp = $code{$key} || die "Error - $!\n";

                            where $code is hash from required file.

                            And i got the this error.
                            Please let me know anything else you require.

                            Thanks.

                            Regards,
                            Prasanna



                            "Charles K. Clarkson" <cclarkson@...> wrote:
                            Prasanna Goupal wrote:
                            :
                            : I am tring to wite data from hash to the file, i got
                            : following error.
                            :
                            : Inappropriate ioctl for device
                            :
                            : If Anybody have any idea about that, then please
                            : let me know.

                            You are probably trying to access a device (socket,
                            file, etc.) in a way which it cannot be accessed. Like
                            trying to write to a CD-reader. If you provide some code
                            illustrating the problem, I might be more specific.

                            HTH,

                            Charles K. Clarkson
                            --
                            Mobile Homes Specialist
                            Free Market Advocate
                            Web Programmer

                            254 968-8328

                            Don't tread on my bandwidth. Trim your posts.






                            ---------------------------------
                            How low will we go? Check out Yahoo! Messenger’s low PC-to-Phone call rates.

                            [Non-text portions of this message have been removed]
                          • Dave Gray
                            ... $! is irrelevant here, as Randal explained. You want: my $tmp = $code{$key} or die [$key] not set in %code n ;
                            Message 13 of 14 , Aug 14 7:29 AM
                            • 0 Attachment
                              On 8/13/06, Prasanna Goupal <perl_developer@...> wrote:
                              > There is one file which contains list of hashes. I had require this file in main program and accessing the value for perticular key and printing this value to the file.
                              >
                              > For testing i had written the code like
                              >
                              > my $temp = $code{$key} || die "Error - $!\n";

                              $! is irrelevant here, as Randal explained. You want:

                              my $tmp = $code{$key} or die "[$key] not set in \%code\n";
                            Your message has been successfully submitted and would be delivered to recipients shortly.