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

Re: [PBML] PERL installation on win32 worked

Expand Messages
  • Erwinchow²
    It worked, thanks Dreassoft Dreadsoft® Corporation wrote:Try using this as first output line of your script: print
    Message 1 of 4 , Jun 30, 2004
    • 0 Attachment
      It worked, thanks Dreassoft

      Dreadsoft� Corporation <trenchtownman@...> wrote:Try using this as first output line of your script:

      print "Content-Type:text/html\n\n";

      Marco


      At 30/06/04 02.56, you wrote:
      >hi Im new to perl, Im trying to install perl on win2000 advanced
      >server but it it got this error messages when triying to access .pl
      >file from my browser
      >Im using Internet Explorer 6 SP1, ActivePERL 5.6.1 and IIS 5.0
      >What Im supposed to do?
      >--------------------------------------------------------------------
      >CGI Error
      >The specified CGI application misbehaved by not returning a complete
      >set of HTTP headers. The headers it did return are:
      >
      >
      >Hello from ActivePerl!
      >
      >--------------------------------------------------------------------


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




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








      ---------------------------------
      Do you Yahoo!?
      Yahoo! Mail - 50x more storage than other providers!

      [Non-text portions of this message have been removed]
    • Alan
      Hi, Why, when the near the bottom below sub routine is added in, brings a global (scope, evidently) error as it reports that the @messg is used only once?
      Message 2 of 4 , Jul 4, 2004
      • 0 Attachment
        Hi,

        Why, when the near the bottom below sub routine is added in, brings a
        global (scope, evidently) error as it reports that the @messg is used
        only once? Also, the sub routine does not print any data, why not?

        I want to end up with a numerically sorted (get that hashref of msgnum
        => size into a sorted order, sorted by msgnum).

        But, so far, I went into array because it maybe easier to sort an array
        (at least for me, the Noob). And, I WILL use apop instead of login when
        I learn some more.

        Want to delete all mail that is a week old or older is the end purpose.

        The next works:

        #!/usr/bin/perl -w
        use strict;
        use Net::POP3;

        my $pop = Net::POP3->new('mail.cwnet.com');
        $pop = Net::POP3->new('mail.cwnet.com', Timeout => 60);

        my $username = "username";
        my $password = "password";
        if ($pop->login($username, $password) > 0) {
        my $msgnums = $pop->list; # hashref of msgnum => size
        foreach my $msgnum (keys %$msgnums) {
        # my $msg = $pop->get($msgnum);
        my $msg = $pop->top($msgnum, 1);

        my $id_num = "Msgnum: $msgnum\n";
        my @messg = @$msg;
        unshift( @messg, $id_num );

        print "~~\t~~";
        print @messg;
        }
        }
        $pop->quit;
        --------------------------------------------

        But that prints the entire header. Instead, from a header, I want to
        print which message number it is, followed by the Date: line

        Here's an example of the desired print, for message number 2:

        2, Wed, 30 Jun 2004 00:56:20 -0000
        --------------------
        So, as next, I added in a sub routine and called the sub:
        ----------

        PrintList(@messg);
        }

        $pop->quit;
        # --- above script ends at this point here -------

        sub PrintList
        {
        # Assign parameter to a local variable
        my (@lines) = @_;

        # Declare local variables
        my ($date, $line, $id_digit);

        # Check each line in the header
        foreach $line (@lines)
        {
        if($line =~ m/^Msgnum: (.*)/)
        {
        # get what we need
        $id_digit = $1;
        # $id_digit = substr($from, 0, 39);
        }
        elsif( $line =~ m/^Date: (.*)/)
        {
        # get what we need
        $date = $1;
        $date = substr($date, 0, 29);
        }

        last if( defined($date) && defined($id_digit) );
        }
        printf "IdNum: %-40s Date: %s\n", $id_digit, $date;
        }
        ----------------------------------------------------------

        --
        Alan.
      Your message has been successfully submitted and would be delivered to recipients shortly.