[25030] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 7280 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 21 11:09:13 2004

Date: Thu, 21 Oct 2004 08:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 21 Oct 2004     Volume: 10 Number: 7280

Today's topics:
    Re: eval function <nobull@mail.com>
    Re: eval function (Anno Siegel)
        Free sex hotline from China <hkconet@tom.com>
    Re: Hash as an function argument <ebohlman@omsdev.com>
    Re: How do I check a valid mail address? <matthew.garrish@sympatico.ca>
    Re: How do I print http 404 not found header? <tadmc@augustmail.com>
    Re: Lowest array value given index (Jim)
    Re: Lowest array value given index (Jim)
    Re: Lowest array value given index (Jim)
    Re: Lowest array value given index <jurgenex@hotmail.com>
        LWP Post (Dale Gerdemann)
    Re: LWP Post <theaney@cablespeed.com>
    Re: LWP Post <tadmc@augustmail.com>
    Re: Mail::Sender - Attaching output from pipe <postmaster@localhost.localdomain>
    Re: Mail::Sender - Attaching output from pipe <postmaster@localhost.localdomain>
    Re: Mail::Sender - Attaching output from pipe <postmaster@localhost.localdomain>
    Re: Mail::Sender - Attaching output from pipe <postmaster@localhost.localdomain>
    Re: Mail::Sender - Attaching output from pipe <mritty@gmail.com>
    Re: Mail::Sender - Attaching output from pipe <tadmc@augustmail.com>
    Re: Net::FTP and Passive mode problems <1usa@llenroc.ude.invalid>
    Re: options to shrink-wrap a perl script (dan baker)
    Re: options to shrink-wrap a perl script <uri@stemsystems.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 21 Oct 2004 13:20:11 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: eval function
Message-Id: <cl8996$nn$1@sun3.bham.ac.uk>

Anno Siegel wrote:

> wana  <ioneabu@yahoo.com> wrote in comp.lang.perl.misc:
 >
>>local $_ = append;
>>
>>Won't that fix it?
> 
> In most cases it would (if there were a "$" in front of "append"), but
> there appear to be exceptions.  Brian?  You're the specialist!

Yes there are exceptions.  $_ is generallly an alias to some other 
scalar.  Most of the time this is fine and dandy, local($_) will 
temporarily break the alias relationship.  But for obscure reasons this 
does not apply if $_ is an alias to an element of a tied aggregate.


require Tie::Hash;

for my $tied ( 0,1 ) {
     my %bar;
     tie %bar, 'Tie::StdHash' if $tied;

     $bar{X} = 666;

     for ( $bar{X} ) {
         print "$bar{X} $_\n";
         {
             local $_ = 777;
             print "$bar{X} $_\n";
         }
         print "$bar{X} $_\n";
     }
}

In general you don't know what state $_ is in when someone calls a 
subroutine so no subroutine should ever local($_).

It is AFAIK generally safe to local(*_) so long as you don't need 
anything further from @_ (and of course you are not relying on the value 
of *_{IO} or using any of the more exotic slots in *_ ).



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

Date: 21 Oct 2004 14:32:29 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: eval function
Message-Id: <cl8h9t$ud$1@mamenchi.zrz.TU-Berlin.DE>

Brian McCauley  <nobull@mail.com> wrote in comp.lang.perl.misc:
> Anno Siegel wrote:
> 
> > wana  <ioneabu@yahoo.com> wrote in comp.lang.perl.misc:
>  >
> >>local $_ = append;
> >>
> >>Won't that fix it?
> > 
> > In most cases it would (if there were a "$" in front of "append"), but
> > there appear to be exceptions.  Brian?  You're the specialist!
> 
> Yes there are exceptions.  $_ is generallly an alias to some other 
> scalar.  Most of the time this is fine and dandy, local($_) will 
> temporarily break the alias relationship.  But for obscure reasons this 
> does not apply if $_ is an alias to an element of a tied aggregate.

Ugh.  I'm not surprised to see a bug in that area.  The relationship
of tie() and local() has at least once changed drastically.  It used
to be that local( $tied_scalar) temporarily disabled the tie and left
you with an undefined, untied scalar.  These days, local() jumps
through tie()s hoops and uses ->FETCH and ->STORE.  (Not that that
has directly anything to do with access to tied aggregates.)

> require Tie::Hash;
> 
> for my $tied ( 0,1 ) {
>      my %bar;
>      tie %bar, 'Tie::StdHash' if $tied;
> 
>      $bar{X} = 666;
> 
>      for ( $bar{X} ) {
>          print "$bar{X} $_\n";
>          {
>              local $_ = 777;
>              print "$bar{X} $_\n";
>          }
>          print "$bar{X} $_\n";
>      }
> }
> 
> In general you don't know what state $_ is in when someone calls a 
> subroutine so no subroutine should ever local($_).
> 
> It is AFAIK generally safe to local(*_) so long as you don't need 
> anything further from @_ (and of course you are not relying on the value 
> of *_{IO} or using any of the more exotic slots in *_ ).

What about another layer of aliasing?  Replacing the bare block with

    for ( 777 ) {
        print "$bar{X} $_\n";
    }

also gives the desired behavior without clobbering the other *_ values.

The one difference I see is exposure.  If it were "for ( $x ) {...",
changes you make to $_ would really be changes in $x (and with the
literal 777, you wouldn't be able to change $_).

Anno


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

Date: 21 Oct 2004 11:57:23 GMT
From: "¦º¼¿" <hkconet@tom.com>
Subject: Free sex hotline from China
Message-Id: <cl8873$gv552@imsp212.netvigator.com>

+86 13680152666



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

Date: 21 Oct 2004 14:53:16 GMT
From: Eric Bohlman <ebohlman@omsdev.com>
Subject: Re: Hash as an function argument
Message-Id: <Xns9589659211575ebohlmanomsdevcom@130.133.1.4>

Tommy Butler <noreply@fake.address> wrote in 
news:1098325545.WYwuHlgZoeiqWipL5W09tw@teranews:

> call the following subroutine like this:
>      &example1(arg1 => value1, arg2 => value2, arg3 => value3);
>      sub example1 { my(%args) = @_; ... }

Thanks to the fact that if there are duplicate keys in a list used to 
initialize a hash the last one "wins," you can supply default values for 
some or all arguments to make them optional:

sub example1 {
  my %args=(arg2=>default2, arg3=>default3, @_);
  ...
}

That would be quite useful if the sub were called most of the time with 
different values for arg1 but the same value for arg2 or arg3 or both.  In 
the most common cases, you'd only need to supply one argument.



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

Date: Thu, 21 Oct 2004 09:06:07 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: How do I check a valid mail address?
Message-Id: <0vOdd.54689$JG5.807133@news20.bellglobal.com>


"PerlFAQ Server" <comdog@panix.com> wrote in message 
news:cl81ua$5p7$1@reader1.panix.com...

> --------------------------------------------------------------------
>
> 9.17: How do I check a valid mail address?
>
>
>    You can't, at least, not in real time. Bummer, eh?
>
>    Without sending mail to the address and seeing whether there's a human
>    on the other hand to answer you, you cannot determine whether a mail
>    address is valid.

On the other "hand"? Shouldn't that be "end"?

Matt 




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

Date: Thu, 21 Oct 2004 08:06:42 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: How do I print http 404 not found header?
Message-Id: <slrncnfd32.76v.tadmc@magna.augustmail.com>

lesley_b_linux@yahoo.co.yuk <lesley_b_linux@yahoo.co.yuk> wrote:
> "Alan J. Flavell" <flavell@ph.gla.ac.uk> writes:

>> With respect, one -is- supposed to familiarise oneself with the 
>> relevant Perl FAQs before posting here (see the regular "posting 
>> guidelines" which appear here). 

> Fair comment about familiarising oneself with the FAQ's.
> 
> I would like a pointer being published in this NG, 


Have you see the Posting Guidelines that Alan referred you to?


> either monthly or
> fortnightly 


The guidelines are posted here twice each week.


> to the URL http://www.perldoc.com/perl5.8.0/pod/perlfaq.html and


Why make them go out on the 'net when the same data is already
on their very own disk?


> perhaps also saying " Use any or all of 'man perl', 'man perlfaq', 'man
> perldoc' 


Those only work on some operating systems so they will ADD to
the confusion of those that don't have "man".

A general-purpose OS-agnostic pointer is better.


> and 'perldoc perldoc' to view up to date information that comes with
> your distribution."


The Posting Guidelines already say that.


> If this was published under the same subject line each time then it would
> simplify the 'finding the FAQ' problem. 


Good, then the 'finding the FAQ' problem has already been solved!

:-)


> Absolutely no disrespect intended to people who have put so much effort in
> already to disseminating information via the FAQ: postings, but my
> view of this NG is that it's not just for proficient perl programmers but also
> for newbies who may actually not know where to find the information they need.
> Imho, one place they should be able to find out how to access that info is
> here.


This is already being done, but it only works if they actually
read the Posting Guidelines.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 21 Oct 2004 06:22:12 -0700
From: jimnl69@hotmail.com (Jim)
Subject: Re: Lowest array value given index
Message-Id: <3966ee66.0410210522.c799fc3@posting.google.com>

"Clyde Ingram" <clydenospamorham@nospamorhamgetofftheline.freeservenospamorham.co.uk> wrote in message news:<PJYbd.477$TA1.99@newsfe1-win.ntli.net>...
> Jim,
> 
> "Jim" <jimnl69@hotmail.com> wrote in message 
> news:3966ee66.0410151008.3b38007@posting.google.com...
> > I'm trying to find an efficient way of finding the lowest value of an
> > array but starting at a given index.  For example:
> >
> > @array = (0, 0, 1, 2, 0, 1, 1, 1);
> <SNIP>
> 
> My attempt outputs this:
> 
> Scan from element 1 (index 0)
> [1,2,3,4,5,6,7,8][]
> [0,0,1,2,0,1,1,1][]
> Lowest value is   0
> at element        1
> 
> Scan from element 3 (index 2)
> [3,4,5,6,7,8][1,2]
> [1,2,0,1,1,1][0,0]
> Lowest value is   0
> at element        5
> 
> Scan from element 6 (index 5)
> [6,7,8][1,2,3,4,5]
> [1,1,1][0,0,1,2,0]
> Lowest value is   0
> at element        1
> 
> That gets the answers you want.
> 
> > Any suggestions on an efficient way to do this?  Thanks...
> 
> "Efficient" compared with what?
> It is conventional for you to show us what you have tried.
> Otherwise, respondents cannot compare efficiency of their algorithms with 
> yours.
> (And there is the lurking suspicion that you might have tried nothing at 
> all.
> Such a case is often described as a "homework question".)
> 
> I used "splice", "push", and a "for"-loop, which are simple enough, but I 
> make no claims for great efficiency.
> How many elements might you encounter in the array in your production 
> program?
> FWIW, my code is below.  (Excuse the length of this posting, people.)
> 
> Regards,
> Clyde
> 
> #!/bin/perl -w
> use strict;
> use Data::Dumper;
> local $Data::Dumper::Terse  = 1;
> local $Data::Dumper::Indent = 0;
> 
> my @array   = ( 0, 0, 1, 2, 0, 1, 1, 1 );
> my @indices = ( 0, 2, 5 );
> 
> for my $index ( @indices ) {
> 
>     # We are going to skip the leading elements of the array, and
>     # start our scan from the given index.
>     #     $index      numbers from 0 (e.g.: 5)
>     #     $element_nr numbers from 1 (e.g.: 6)
> 
>     my $element_nr = $index+1;
>     print "\nScan from element $element_nr (index $index)\n";
> 
>     my @arr = @array;     # Copy array, before splicing it
> 
>     if ( ($index < 0) or ($index > $#arr) ) {
>         warn "$index: index out of range 0..$#arr.  Ignoring\n\n";
>         next;
>     }
> 
>     # Remember ranges of element numbers in skipping and starting portions
>     # e.g.: (1..5) and (6..8)
>     my @skipping_element_nrs = ( 1           .. ($element_nr - 1) );
>     my @starting_element_nrs = ( $element_nr .. (scalar @arr    ) );
> 
>     # Remove the leading $index elements of @arr, into new array @skip
>     # e.g.: for index 5, we will skip elements (1..5)
>     my @skip = splice( @arr, 0, $index );
> 
>     # Print out 2 arrays of element numbers, one from the starting element
>     # to the end, the second for the element numbers we skipped.
>     # e.g.: [6,7,8][1,2,3,4,5]
>     print Data::Dumper->Dump( [
>             \@starting_element_nrs, \@skipping_element_nrs ] ) . "\n";
> 
>     # Then print corresponding 2 arrays of elements
>     # e.g.: [1,1,1][0,0,1,2,0]
>     print Data::Dumper->Dump( [\@arr, \@skip] ) . "\n";
> 
>     # Push the skipped elements onto the end of @arr
>     push( @arr, @skip );
> 
>     # Scan the re-formed array @arr for the lowest value and its index
>     my $new_index_of_lowest = 0;
> 
>     for my $i (1 .. $#arr) {
> 
>         $new_index_of_lowest = $i if ($arr[$i] < 
> $arr[$new_index_of_lowest]);
>     }
> 
>     # Work out element nr of lowest, with respect to original array,
>     # remembering that search wraps around the end of the array
>     my $old_element_nr_of_lowest = ($new_index_of_lowest+$index)%(scalar 
> @arr)+1;
> 
>     print "Lowest value is   $arr[$new_index_of_lowest]\n";
>     print "at element        $old_element_nr_of_lowest\n";
> }
> 
> (End of response)

Sorry I didn't post my code earlier.  This is how I "solved" my
problem.  And yes, I was looking for the index of the lowest value.


      my $min = $dept[$index_critical][$SEV1];
      for my $i ($index_critical .. $#dept) {
        if ($dept[$i][$SEV1] < $min) {
          $min = $dept[$i][$SEV1];
          $index_dept = $i;
        }
      }
      for my $i (0 .. $index_critical) {
        if ($dept[$i][$SEV1]) {
          $min = $dept[$i][$SEV1];
          $index_dept = $i;
        }
      }

Basically, I start at my starting index and go to the end to see if
there is a lower value.  Then, I start at the beginning and go to the
starting index to see if there is a lower value.  This way I get the
index of the lowest value starting at my index.  It works, I just
don't particularly like the 2 for loops.

Thanks for all the responses (even those that I apparently confused
the requirements of, sorry) and any future responses on improving
this.

Jim


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

Date: 21 Oct 2004 06:23:58 -0700
From: jimnl69@hotmail.com (Jim)
Subject: Re: Lowest array value given index
Message-Id: <3966ee66.0410210523.21f0a45c@posting.google.com>

"Jürgen Exner" <jurgenex@hotmail.com> wrote in message news:<xxZbd.167$TW4.3@trnddc07>...
> Jim wrote:
> > I'm trying to find an efficient way of finding the lowest value of an
> > array but starting at a given index.
> 
> Well, you have to look at every single value between your start index and 
> the end of the array at least once anyway. In other words obviously your 
> algorithm cannot become better then O(n).
> Therefore the straight-forward, linear approach is probably very close to 
> optimal already:
> 
> my $min = $array[$i];     # $i be the given starting index
> for (@array[$i..$#array]) {
>     if ($min > $_) { $min = $_;}
> }
> print $min;
> 
> jue

Except this doesn't conform to the requirement of starting at a
specified index in the array.  If I want to start at index 5 with a
value of 1 and both index 1 and index 7 have values of 0, I want to
get back index 7, not index 1.

Thanks...  Jim


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

Date: 21 Oct 2004 06:35:03 -0700
From: jimnl69@hotmail.com (Jim)
Subject: Re: Lowest array value given index
Message-Id: <3966ee66.0410210535.108740c1@posting.google.com>

Charlton Wilbur <cwilbur@mithril.chromatico.net> wrote in message news:<87ekjwrre6.fsf@mithril.chromatico.net>...
> >>>>> "j" == Jim  <jimnl69@hotmail.com> writes:
> 
>     j> I'm trying to find an efficient way of finding the lowest value
>     j> of an array but starting at a given index.
> 
> This one is clear code; you need to examine every element to determine
> that you have the lowest one.  Anything more efficient than this will
> probably require arcane knowledge of perl internals which are likely
> to change from version to version.
> 
> my $low_index = $index;
> for ($index .. $#array, 0 .. $index - 1)
> {
>     $low_index = $_
> 	if $array[$_] < $array[$low_index];
> }
> 
> print "low element is at index $low_index\n";
> 
> 
> 
> Charlton

This looks good!  This looks like it performs the exact same thing I
coded but in less "lines"..

      my $min = $dept[$index_critical][$SEV1];
      for my $i ($index_critical .. $#dept) {
        if ($dept[$i][$SEV1] < $min) {
          $min = $dept[$i][$SEV1];
          $index_dept = $i;
        }
      }
      for my $i (0 .. $#dept) {
        if ($dept[$i][$SEV1] < $min) {
          $min = $dept[$i][$SEV1];
          $index_dept = $i;
        }
      }

should be able to become

      my $index_dept = $index_critical;
      for ($index_critical .. $#dept, 0 .. $index_critical - 1) {
        $index_dept = $_ if ($dept[$_][$SEV1] <
$dept[$index_dept][$SEV1]);
      }

I'll give it a shot..  Thanks!

Jim


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

Date: Thu, 21 Oct 2004 14:03:10 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Lowest array value given index
Message-Id: <ykPdd.6428$5l3.1261@trnddc02>

Jim wrote:
> "Jürgen Exner" <jurgenex@hotmail.com> wrote in message
> news:<xxZbd.167$TW4.3@trnddc07>...
>> Jim wrote:
>>> I'm trying to find an efficient way of finding the lowest value of
>>> an array but starting at a given index.
>>
>> Well, you have to look at every single value between your start
>> index and the end of the array at least once anyway. In other words
>> obviously your algorithm cannot become better then O(n).
>> Therefore the straight-forward, linear approach is probably very
>> close to optimal already:
>>
>> my $min = $array[$i];     # $i be the given starting index
>> for (@array[$i..$#array]) {
>>     if ($min > $_) { $min = $_;}
>> }
>> print $min;
>
> Except this doesn't conform to the requirement of starting at a
> specified index in the array.  If I want to start at index 5 with a
> value of 1 and both index 1 and index 7 have values of 0, I want to
> get back index 7, not index 1.

Did you try it?
I guess you didn't notice that the loop _starts_ at the given start index 
(as it says "be $i the starting index"). Therefore it cannot return the 
unwanted index 1 because it is not part of the search space to begin with.

jue 




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

Date: 21 Oct 2004 03:59:42 -0700
From: dg@sfs.nphil.uni-tuebingen.de (Dale Gerdemann)
Subject: LWP Post
Message-Id: <9313e3af.0410210259.857765c@posting.google.com>

I'm trying to figure out how use LWP::UserAgent to get dynamically
generated Web pages using the POST method. I've followed the examples
in the O'Reilly book: Perl & LWP by Sean M. Burke. There's an example
there of posting to the AltaVista Babelfish translator, and this
example works fine for me. But when I try to do someting similar on
another page, it fails.

For example, I tried to get morphological analysis (word structure
analysis) from http://www.uni-plovdiv.bg/dcs/morphe.htm, and even
though it's a very simple minded form, I had no success. Sean Burke
has a program in his book called formpairs, which allows you to test
what posted info a form is expecting. I used this and checked very
carefully, but still, no success.

Here's what the form looks like:

function FrontPage_Form1_Validator(theForm)
{

  if (theForm.D1.selectedIndex < 0)
  {
    alert("Please select one of the \"D1\" options.");
    theForm.D1.focus();
    return (false);
  }
  return (true);
}
//--></script><!--webbot BOT="GeneratedScript" endspan --><form
action="http://rdesc.pu.acad.bg/cgi-bin/cgi_morf.exe" method="POST"
onsubmit="return FrontPage_Form1_Validator(this)"
name="FrontPage_Form1"> 
  <p><textarea name="S1" rows="5" cols="82"></textarea></p>
  <p><!--webbot bot="Validation" b-value-required="TRUE" --><select
name="D1" size="3"> 
    <option>1.Windows ( àáâãäåæçèéêëìíîïðñòóôõö÷øùúüþÿ )</option>
    <option>2.Macintosh ( abvgde'zijklmnoprstufxchw]=;_q )</option>
    <option>3.QWERTY ( abwgdevzijklmnoprstufhc`[]yx\q )</option>
  </select></p>

  <p><input type="submit" name="B1" value="Analysis"></p>
</form>


You see that there's a bit of Javascript getting in the way, but I
don't think thats a problem here. [You also see that the author of the
page mixed up is terminology and referred to ASCII as QWERTY.
But that's beside the point.] I tried to access this page with the
following:  

use strict;
use LWP;
my $browser;
sub do_POST {
  # Parameters:
  #  the URL,
  #  an arrayref or hashref for the key/value pairs,
  #  and then, optionally, any header lines: (key,value, key,value)
  $browser = LWP::UserAgent->new(  ) unless $browser;
  my $resp = $browser->post(@_);
  return ($resp->content, $resp->status_line, $resp->is_success, $resp)
    if wantarray;
  return unless $resp->is_success;
  return $resp->content;
}



my ($content, $message, $is_success) = do_POST(
  'http://www.uni-plovdiv.bg/dcs/morphe.htm',
  [ 'S1' => 'ne', 'B1' => "Analysis", 
    'D1'=>'3.QWERTY ( abwgdevzijklmnoprstufhc`[]yx\q )' ],
);

print "$content\n";



Anybody have any ideas???


Dale Gerdemann


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

Date: Thu, 21 Oct 2004 08:47:06 -0400
From: Tim Heaney <theaney@cablespeed.com>
Subject: Re: LWP Post
Message-Id: <87pt3cp7at.fsf@mrbun.watterson>

dg@sfs.nphil.uni-tuebingen.de (Dale Gerdemann) writes:

> my ($content, $message, $is_success) = do_POST(
>   'http://www.uni-plovdiv.bg/dcs/morphe.htm',
>   [ 'S1' => 'ne', 'B1' => "Analysis", 
>     'D1'=>'3.QWERTY ( abwgdevzijklmnoprstufhc`[]yx\q )' ],
> );
>
> print "$content\n";
>
>
>
> Anybody have any ideas???

You don't want to post to the HTML page with the form on it, you want
to post to their program. Try something like

  my ($content, $message, $is_success) = do_POST(
    'http://rdesc.pu.acad.bg/cgi-bin/cgi_morf.exe',
    [ 'S1' => 'ne',
      'D1' => '3.QWERTY ( abwgdevzijklmnoprstufhc`[]yx\q )',
      'B1' => "Analysis", 
    ],
  );

instead (note the different URL). When I do that, I get

  <HTML><HEAD><TITLE>DELPHI CGI TEST</TITLE></HEAD>
  <BODY bgcolor="#FFFFFF">
  <STRONG>Result:<BR><BR>
  <P>ne :Particle,  :189 1 base form:ne</P>
  </B></P>
  </BODY>

I hope this helps,

Tim


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

Date: Thu, 21 Oct 2004 08:19:32 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: LWP Post
Message-Id: <slrncnfdr4.76v.tadmc@magna.augustmail.com>

Dale Gerdemann <dg@sfs.nphil.uni-tuebingen.de> wrote:

> I'm trying to figure out how use LWP::UserAgent to get dynamically
> generated Web pages using the POST method.

> For example, I tried to get morphological analysis (word structure
> analysis) from http://www.uni-plovdiv.bg/dcs/morphe.htm, and even
> though it's a very simple minded form, I had no success. 


> Here's what the form looks like:

[snip]

> <form
> action="http://rdesc.pu.acad.bg/cgi-bin/cgi_morf.exe" method="POST"
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


There is where the message should be posted to...


> my ($content, $message, $is_success) = do_POST(
>   'http://www.uni-plovdiv.bg/dcs/morphe.htm',
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


 ... but that isn't where you are actually posting it!


> Anybody have any ideas???


Post to the correct URL.  :-)



BTW, the "web scraping proxy" is a wildly valuable tool for
reverse-engineering such things:

      http://www.research.att.com/~hpk/wsp/

It wrote this Perl code for me when I tried it:

   $request = POST "http://rdesc.pu.acad.bg/cgi-bin/cgi_morf.exe" , [
        'S1' => "a Bulgarian sentence",
        'D1' => "3.QWERTY ( abwgdevzijklmnoprstufhc`[]yx\q )",
        'B1' => "Analysis",
   ] ;


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Thu, 21 Oct 2004 13:33:15 +0100
From: bengee <postmaster@localhost.localdomain>
Subject: Re: Mail::Sender - Attaching output from pipe
Message-Id: <4177ac71$0$59479$ed2619ec@ptn-nntp-reader03.plus.net>

Tad McClellan wrote:
> bengee <postmaster@localhost.localdomain> wrote:
> 
>>Hope someone can help!
> 
> That seems an unrealistic expectation after:
> 
>    Message-ID: <akldmc$cea$1@news0.ifb.net>
> 
> You are on your own!

I haven't got a clue what you're talking about???

bengee


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

Date: Thu, 21 Oct 2004 13:36:00 +0100
From: bengee <postmaster@localhost.localdomain>
Subject: Re: Mail::Sender - Attaching output from pipe
Message-Id: <4177ad15$0$59479$ed2619ec@ptn-nntp-reader03.plus.net>

A. Sinan Unur wrote:
> bengee <postmaster@localhost.localdomain> wrote in
> news:4176d9e3$0$3252$ed2619ec@ptn-nntp-reader02.plus.net: 
> 
> 
>>I'm trying to send an HTML email with an inline PNG attached. I can do
>>this no probs as long as i'm attaching an actual PNG file. What i'd
>>like to do however, is attach the output of another perl program -
>>graph.pl. This creates a graphic (using GD.pm) and outputs to STDOUT.
> 
> 
> In Perl, we use backtics to get the output of a command.

I forgot about the backticks! But as you asy that won't work anyway. 
I've resorted to running graph.pl and outputing to a file on disk. Then 
passing the name of that file to Mail::Sender's Attach method

bengee


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

Date: Thu, 21 Oct 2004 13:38:13 +0100
From: bengee <postmaster@localhost.localdomain>
Subject: Re: Mail::Sender - Attaching output from pipe
Message-Id: <4177ad9b$0$59479$ed2619ec@ptn-nntp-reader03.plus.net>

Gunnar Hjalmarsson wrote:
> Tad McClellan wrote:
>> You are on your own!
> 
> Indeed.
> 
> It may be appropriate to quote the last para in the Mail::Sender POD:
> 
> "This program is free software; you can redistribute it and/or modify it 
> under the same terms as Perl itself. There is only one aditional 
> condition, you may NOT use this module for SPAMing! NEVER! (see 
> http://spam.abuse.net/ for definition)"

Are you trying to say that i'll be using this to SPAM? If that's the 
case then you're WRONG! I'll be sending emails out to people who are 
signed up to use my service.

bengee


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

Date: Thu, 21 Oct 2004 13:56:34 +0100
From: bengee <postmaster@localhost.localdomain>
Subject: Re: Mail::Sender - Attaching output from pipe
Message-Id: <4177b1e8$0$47992$ed2e19e4@ptn-nntp-reader04.plus.net>

Tad McClellan wrote:
> That seems an unrealistic expectation after:
> 
>    Message-ID: <akldmc$cea$1@news0.ifb.net>
> 
> You are on your own!

I've just clicked on to what you meant. Did you read the entire thread 
in the archive?

bengee


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

Date: Thu, 21 Oct 2004 13:24:25 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Mail::Sender - Attaching output from pipe
Message-Id: <dMOdd.4846$TU5.745@trndny06>

"bengee" <postmaster@localhost.localdomain> wrote in message
news:4177b1e8$0$47992$ed2e19e4@ptn-nntp-reader04.plus.net...
> Tad McClellan wrote:
> > That seems an unrealistic expectation after:
> >
> >    Message-ID: <akldmc$cea$1@news0.ifb.net>
> >
> > You are on your own!
>
> I've just clicked on to what you meant. Did you read the entire thread
> in the archive?

Are you implying there was more to this thread than Google cached?

http://groups.google.com/groups?hl=en&lr=&safe=off&threadm=akldmc%24cea%241%40news0.ifb.net&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26safe%3Doff%26selm%3Dakldmc%2524cea%25241%2540news0.ifb.net

If so, how about a pointer to the rest, something that might explain
your seemingly uncalled for vulgarity?

Paul Lalli




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

Date: Thu, 21 Oct 2004 08:48:30 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Mail::Sender - Attaching output from pipe
Message-Id: <slrncnffhe.7er.tadmc@magna.augustmail.com>

bengee <postmaster@localhost.localdomain> wrote:
> Tad McClellan wrote:
>> That seems an unrealistic expectation after:
>> 
>>    Message-ID: <akldmc$cea$1@news0.ifb.net>
>> 
>> You are on your own!
> 
> I've just clicked on to what you meant. Did you read the entire thread 
> in the archive?


Yes I did. What was it that you were expecting me to see there?

It is a moot point anyway, if you use vulgarity you go in the killfile.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 21 Oct 2004 12:09:03 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Net::FTP and Passive mode problems
Message-Id: <Xns958952EA2291Easu1cornelledu@132.236.56.8>

hosti1e17@yahoo.com (Hostile17) wrote in
news:a5522b8e.0410202329.2a002cb0@posting.google.com: 

> "A. Sinan Unur" <usa1@llenroc.ude.invalid> wrote in message
> news:<Xns9588EA031B566asu1cornelledu@132.236.56.8>... 
>> Why don't you have:
>> 
>> use strict;
>> use warnings;
> 
> Because you asked for the "shortest possible script".

That does not mean "post an incomplete script".

> I don't mean to be rude, but you're not helping. The two of us are
> wasting time on a conversation which can be reduced to:
> 
>   ME:  Why does NET::FTP do this?
>   YOU: Don't know.

I gave you a script that "worked" as expected on Win98, WinXP and 
FreeBSD. You may not have realized it, but before posting it, I actually 
tested it from behind a firewall with 2 servers. So, since you did not 
post a complete script, and since I had no way of knowing what was 
happening on your particular system (you did not post a complete log 
either), I asked you to see if something I _knew_ worked properly still 
exhibited the problem.

At this stage, my feeling is that your problem is just that: Your 
problem.

Enjoy.


-- 
A. Sinan Unur
1usa@llenroc.ude.invalid 
(remove '.invalid' and reverse each component for email address)



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

Date: 21 Oct 2004 07:25:06 -0700
From: botfood@yahoo.com (dan baker)
Subject: Re: options to shrink-wrap a perl script
Message-Id: <13685ef8.0410210625.18180469@posting.google.com>

Tad McClellan <tadmc@augustmail.com> wrote in message 
> > didn't your mother ever teach you to keep your mouth shut if you dont
> > have anything nice (or helpful) to say?
> 
> 
> Where is the nice or helpful part in *your* followup, huh?

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

in that I am attempting to clue you guys into acceptable public
behavior. You might get a lot further in life and have more friends.

d


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

Date: Thu, 21 Oct 2004 14:46:01 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: options to shrink-wrap a perl script
Message-Id: <x7pt3c167o.fsf@mail.sysarch.com>

>>>>> "db" == dan baker <botfood@yahoo.com> writes:

  db> Tad McClellan <tadmc@augustmail.com> wrote in message 
  >> > didn't your mother ever teach you to keep your mouth shut if you dont
  >> > have anything nice (or helpful) to say?
  >> 
  >> 
  >> Where is the nice or helpful part in *your* followup, huh?

  db> -----------------

  db> in that I am attempting to clue you guys into acceptable public
  db> behavior. You might get a lot further in life and have more friends.

you are so wise in the ways of good behavior! i will fly to your side
and sit at your feet absorbing such nuggets of wisdom. do you teach perl
as well as life lessons? can you handle the hordes of acolytes you so
richly deserve? can i be your friend too?

uri

ps. tad IS a friend of mine. we have broken bread and code together. so
we each have at least one friend. does that count?

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 7280
***************************************


home help back first fref pref prev next nref lref last post