[21912] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4119 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 14 14:08:12 2002

Date: Thu, 14 Nov 2002 11:05:07 -0800 (PST)
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, 14 Nov 2002     Volume: 10 Number: 4119

Today's topics:
    Re: [Q] Script to search auction sites? <usenet@dwall.fastmail.fm>
    Re: Babelfish Webservice Bug w/ SOAP::Lite (Ted Smith)
    Re: Binary Deployment for Perl? <nobull@mail.com>
        Constructing a simple comparison between two arrays (Simon)
    Re: Constructing a simple comparison between two arrays <robertbu@hotmail.com>
    Re: Constructing a simple comparison between two arrays <jurgenex@hotmail.com>
    Re: Constructing a simple comparison between two arrays <nobull@mail.com>
    Re: Cross platform issues <usenet@dwall.fastmail.fm>
        hash names from scalar values <linuxnb@yahoo.com>
        Help Using Crypt() <paanwa@hotmail.com>
    Re: multi-file search/replace? <fxn@hashref.com>
    Re: multi-file search/replace? <steven.smolinski@sympatico.ca>
    Re: multi-file search/replace? (Tad McClellan)
    Re: multi-file search/replace? (George Eccles)
    Re: multi-file search/replace? (Tad McClellan)
    Re: sendmail: error email <nobull@mail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 14 Nov 2002 17:08:49 -0000
From: "David K. Wall" <usenet@dwall.fastmail.fm>
Subject: Re: [Q] Script to search auction sites?
Message-Id: <Xns92C67B912563Ddkwwashere@216.168.3.30>

Sir Loin of Beef <NOSPAMmdknight@pacific.net.sg> wrote on 14 Nov 2002:

> Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net> wrote:
> 
>>You could start by *really* fixing the syntax error.
>>Next, you should enable warnings and strictures by putting the
>>following two lines under the shebang:
> 
> Hi..
> sorry about that, I missed out something when copying code to the
> newsgroup. There's no syntax error now, nor are there any compilation
> errors. What I need to know is how I can substitute the real value of
> mySearchTerm in the url, rather than passing it as a literal.

You should still enable strictures and warnings.  Or would you also work in 
high-rise construction without safety equipment?  (Although you (probably) 
won't die if your program crashes. :-)

You said you've used Basic + Turbo Pascal;  how would you solve the problem 
in one of those languages?

You might look at scalar value constructors in perldata, and also in perlop 
under additive operators.

-- 
David K. Wall - usenet@dwall.fastmail.fm
"Oook."


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

Date: 14 Nov 2002 10:37:59 -0800
From: bluearchtop@my-deja.com (Ted Smith)
Subject: Re: Babelfish Webservice Bug w/ SOAP::Lite
Message-Id: <9d2caaf1.0211141037.b7fdf22@posting.google.com>

The bug is in XML::Parser (as stated by xmethods). I can clearly see
that SOAP gets the translated text and the XML returned is valid.
However, when it is handed off to XML::Parser it fails on the first
"umlaut" it sees. I've tried all different encodings too, no such luck
yet....


> > 
> > BUGS
> > 
> > Currently, the service has trouble with some special
> > characters, such as those with umlauts, for the input
> > string.  For PERL client implementations that rely on
> > XML::Parser, this bug also will affect the parsing of
> > return strings.
> > 
> > 
> > My code is pretty straight forward:
> >
> 
> And simplistic, how will you ever know what the error is?  Did you set
> the on_fault handler? What error are you receiving?
>  
> >
> > my $result = SOAP::Lite
> >      -> uri('http://www.xmethods.net/xmethodsBabelFish')
> >      -> proxy('http://services.xmethods.net:80/perl/soaplite.cgi')
> >      -> encoding('ISO-8859-1')
> >      -> BabelFish($req->param('translate'),$string)
> >      -> result;
> > 
> > 
> > Is there anything that can be done for a workaround for this bug?
> 
> There is more than one bug described, how do you know which bug
> happened while trying to access their service?  The docs for
> SOAP::Lite show the basic examples layering 1 method call on top of
> another.  You need to break those apart to do some debugging.  Some
> things you might do are shown below.
> 
> ** I don't know what the parameters to the BabelFish method
>    are, but I got a fault when giving it meaningless data.
>    See the fault message below, I think the problem is with
>    their service, and not SOAP::Lite.
> 
>    Try this code out with the correct parameters and see 
>    what you get.  You might want to send the people at 
>    xmethods an email? **
> 
> (here is how I would go about debugging the SOAP call)
> 
> # You can use the on_fault parameter when SOAP::Lite is 
> # use'd to set an error handler sub
> use strict;
> use warnings;
> use Carp;
> use SOAP::Lite;
> #use SOAP::Lite on_fault => sub { die "SOAP FAULT!" };
> 
> my $soap = SOAP::Lite->new;
> $soap->uri('http://www.xmethods.net/xmethodsBabelFish') || die;
> $soap->proxy('http://services.xmethods.net:80/perl/soaplite.cgi') ||
> die;
> $soap->encoding('ISO-8859-1') || die;
> my $som = $soap->BabelFish("bryan","castillo");
> 
> # Check to see if there was a fault
> if (my $fault = $som->fault) {
>   while (my ($k,$v) = each %$fault) { 
>     print $k, "\n", $v, "\n\n";
>   }
> }
> else {
>   print $som->result, "\n";
> }
> 
> # Try setting the outputxml flag to see the actual response
> # from the server.
> $soap = SOAP::Lite->new;
> $soap->outputxml(1); 
> $soap->uri('http://www.xmethods.net/xmethodsBabelFish') || die;
> $soap->proxy('http://services.xmethods.net:80/perl/soaplite.cgi') ||
> die;
> $soap->encoding('ISO-8859-1') || die;
> print $soap->BabelFish("bryan","castillo");
> 
> 
> faultcode
> SOAP-ENV:Server
> 
> faultstring
> Could not translate. Either the service cannot handle your input, your
> connection to the babelfish site may be down or the site itself may be
> expiencing difficulties
> 
> 
> ----------------------------------------
> <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/1999/XMLSchema"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode
> xsi:type="xsd:string">SOAP-ENV:Server</faultcode><faultstring
> xsi:type="xsd:string">Could not translate. Either the service cannot
> handle your input, your connection to the babelfish site may be down
> or the site itself may be expiencing difficulties
> </faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
> 
> 
> 
> 
> 
> Based on the fault message, I might think there is something
> wrong with the request being sent to the server.  You might 
> want to capture the data being sent.
> 
> I use nc (netcat) to grab the client request, changing the 
> uri and proxy to point to my own system and the port that 
> nc is listening to. You can then break out of the client 
> as it hangs and your request will be in output.txt.
> 
> I don't see anything wrong with the request (but I'm not an expert)
> 
> $ nc -p 7170 -l > output.txt 
> ----------------------------------------------------
> POST /perl/soaplite.cgi HTTP/1.1
> TE: deflate,gzip;q=0.3
> Connection: TE, close
> Accept: text/xml
> Accept: multipart/*
> Host: localhost:7170
> User-Agent: SOAP::Lite/Perl/0.55
> Content-Length: 595
> Content-Type: text/xml; charset=iso-8859-1
> SOAPAction: "http://localhost:7170/xmethodsBabelFish#BabelFish"
> 
> <?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope
> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/1999/XMLSchema"><SOAP-ENV:Body><namesp1:BabelFish
> xmlns:namesp1="http://localhost:7170/xmethodsBabelFish"><c-gensym3
> xsi:type="xsd:string">bryan</c-gensym3><c-gensym5
> xsi:type="xsd:string">castillo</c-gensym5></namesp1:BabelFish></SOAP-ENV:Body></SOAP-ENV:Envelope>
> 
> 
> This doesn't answer your question, but I hope it helps your research
> and debugging skills.


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

Date: 14 Nov 2002 18:43:13 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Binary Deployment for Perl?
Message-Id: <u9k7jgxa9q.fsf@wcl-l.bham.ac.uk>

peterwu@hotmail.com (Peter Wu) writes:

> I plan not to open my source when releasing my own product written in
> Perl.

> I might not be clear in my original post. What I want to know is how
> to *technically* prevent my Perl code from being seen by customers
> with a simple text editor?

You were unclear because you are are using the legal term "open
source" when you meant something different.
 
> > There may be a FAQ about this too.

There was a :-) missing there.

This is one of the most-FAQ!
 
> Can you please post the link to the FAQ?

Where have you looked?  It is virtually impossible to make any genuine
effort to find the Perl FAQ and not find it within a minuite.

> I'm pretty new to Perl programming.

Did it occur to you to look at any of the manuals ever?  Like at least
the table of contectes of the reference material that ships with Perl?

As has been pointed out many times in this newsgroup it's odd that
it's alwas the people new to Perl that think their Perl program is so
wonderfull that they need to hide it.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 14 Nov 2002 09:59:12 -0800
From: simontheak@hotmail.com (Simon)
Subject: Constructing a simple comparison between two arrays
Message-Id: <495e297c.0211140959.36441368@posting.google.com>

Hello there.

I'm trying to write a simple program that will populate and compare
two arrays of files which will have the same filenames, but different
extensions. The aim of the program will be to tell the user which (if
any) file is missing from a particular array. I hope that makes some
kind of sense.

Anyway, I was wondering whether somebody might be able to help me
through the basics of it as I'm still pretty new to Perl, but trying
to learn.

These are the various steps I have.

1. A regular expression is produced to chop off the file extensions
from each of the files.
2. The 2 sets of files are loaded in to 2 different arrays and sorted
by alphabetical order.
3. The lengths of the arrays are compared to see which is longer. This
is then assigned as the array which the other needs to be compared to.
4. A loop is created to cycle through each section of the array and if
the two don't match, then the file is assigned to an 'error' variable.
5. The error variable is printed out listing the file names which have
no equivalent.

Would this be correct? Have I missed any steps out?? Any help with
this would be REALLY appreciated.

Thank you very much,

Simon


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

Date: Thu, 14 Nov 2002 18:27:05 GMT
From: "robertbu" <robertbu@hotmail.com>
Subject: Re: Constructing a simple comparison between two arrays
Message-Id: <ZVRA9.23472$6Z.14151@nwrddc01.gnilink.net>

> 3. The lengths of the arrays are compared to see which is longer. This
> is then assigned as the array which the other needs to be compared to.

This implies that you are looking at one list as being a subset of the other
list.  Not true in general, but may be workable in your case.

== Rob ==






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

Date: Thu, 14 Nov 2002 18:34:56 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Constructing a simple comparison between two arrays
Message-Id: <k1SA9.24095$TL6.21321@nwrddc02.gnilink.net>

Simon wrote:
> I'm trying to write a simple program that will populate and compare
> two arrays of files which will have the same filenames, but different
> extensions. The aim of the program will be to tell the user which (if
> any) file is missing from a particular array. I hope that makes some
> kind of sense.
>
> Anyway, I was wondering whether somebody might be able to help me
> through the basics of it as I'm still pretty new to Perl, but trying
> to learn.

Please see 'perldoc -f difference':
  How do I compute the difference of two arrays?  How do I compute the
intersection of two arrays?

You will have to remove the extension (apparently the same name with
different extensions is still considered the same file) but that's trivial
with "use File::Basename".

jue




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

Date: 14 Nov 2002 18:33:35 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Constructing a simple comparison between two arrays
Message-Id: <u9of8sxaps.fsf@wcl-l.bham.ac.uk>

simontheak@hotmail.com (Simon) writes:

> I'm trying to write a simple program that will populate and compare
> two arrays of files which will have the same filenames, but different
> extensions.

You have an X->Y problem.  You are saying "arrays" but "arrays" is
not, I suspect, part of what you are trying to do ('X') but rather
part of how you are trying to do it ('Y').  What, I suspect, you are
trying to do, at the conceptual level, is compare sets.  The builtin
Perl datatype usually most suited to implementign set operations is
not the array.

> The aim of the program will be to tell the user which (if
> any) file is missing from a particular array. I hope that makes some
> kind of sense.

> Anyway, I was wondering whether somebody might be able to help me
> through the basics of it as I'm still pretty new to Perl, but trying
> to learn.
> 
> These are the various steps I have.
> 
> 1. A regular expression is produced to chop off the file extensions
> from each of the files.

That's good.

> 2. The 2 sets of files are loaded in to 2 different arrays and sorted
> by alphabetical order.
> 3. The lengths of the arrays are compared to see which is longer. This
> is then assigned as the array which the other needs to be compared
> to.

That doesn't make sense.  Surely you want to compare both ways.

> 4. A loop is created to cycle through each section of the array and if
> the two don't match, then the file is assigned to an 'error' variable.
> 5. The error variable is printed out listing the file names which have
> no equivalent.
> 
> Would this be correct?

You could get it to work.  The algorithm you describe is what one
might do with huge sets using the external Unix sort program.

But it's not the most natural way to do it in Perl for sets that fit
comfortably in VM.

I Perl set operations are most easily implemented using hashes and
slices.  There are numerous places you could find out about this so I
won't go into details.

However in this case you could probably solve your original problem it
even more directly.

my %files;
opendir(my $dir, '.') or die; 
while ( my $file = readdir($dir) ) {
        if ( my ( $base, $ext1 ) = $file =~ /^(.*)\.(?:(ext1)|ext2)$/ ) {
                $files{$base} += $ext1 ? 1 : -1;
        }
}

In each element of %files you now have 1, -1 or 0 depending on whether
the file in question appears with .ext1 suffix only, with .ext2 only
or both.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Thu, 14 Nov 2002 16:14:04 -0000
From: "David K. Wall" <usenet@dwall.fastmail.fm>
Subject: Re: Cross platform issues
Message-Id: <Xns92C6724889CAEdkwwashere@216.168.3.30>

Tim <tim@deadgoodsolutions.spam-me-and-die.com> wrote on 14 Nov 2002:

> I have developed some Perl CGI scripts on Windows 2000 and ActivePerl
> 5.6.1 that run under Apache 2.  I've moved them to my RH 8 web server
> which also uses Apache 2 and Perl 5.8.0 (shipped with RH).  However I'm
> having a number of issues, the most serious being that the PARAM command
> refuses to pick up hidden HTML tags when forms are submitted.  Apache on
> both platforms is configured exactly the same (where possible) and the
> only thing I can think of is a compatibility issue with Perl?  I really
> am at a loss here, so if anyone could offer any advice i'd really
> appreciate it. 

Maybe you should post the code so we can look at it.  Not all of it; try and 
reduce it to as small a snippet as possible that still exhibits the problem.  
You might find that the process of reducing it allows you to isolate the 
problem for yourself.  That's happened to me a number of times:  I get stuck, 
decide to ask for help, and in the process of writing a reasonably succinct 
post explaining my problem, I figure out what is wrong and end up not posting 
at all.

-- 
David K. Wall - usenet@dwall.fastmail.fm
"Oook."


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

Date: Thu, 14 Nov 2002 19:01:08 GMT
From: "matt" <linuxnb@yahoo.com>
Subject: hash names from scalar values
Message-Id: <UpSA9.30228$QZ.6362@sccrnsc02>

Hi All,

A little question about naming hashes from scalar values. I've heard that
this is not a good idea, but I don't know how many hashes I will need until
a loop finishes. Is there anything wrong with this? Here's my code:

-----------------------------------
$n=1;
@ary=();
while (@data = get_row_from_DB) {

    $hash_name = "temp" . $n;

    %{$hash_name} = (
                this => $data[0],
                that => $data[1]
                );

    push (@ary, \%{$hash_name});
    $n++;
}
------------------------------------

Basically as you can see I need to end up with an array full of hash ref's.
Is there a better way to accomplish this?

Thanks in advance -- Matt




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

Date: Thu, 14 Nov 2002 11:58:05 -0500
From: "Paanwa" <paanwa@hotmail.com>
Subject: Help Using Crypt()
Message-Id: <ut7lgu3n189sbb@corp.supernews.com>

Hi all,

I am working on a web-based authentication script - the frontend of which is
a (big surprise) form.  A username and password fields are provided on the
form.  I have a flat textfile containing the usernames and pre-crypted
passwords.  Below is an example of the section of code not returning what I
am expecting (note - I have warnings enabled but no warnings are flagged, am
using CGI qw(:standard), PERL 5, Apache Server on FreeBSD 4.4):

----------------------------------------------
<snip>
 my $StoredPassword;
 $StoredPassword = $Auth{param('Username')}{Pword}; # Grab the pword for the
correct username
 my $SubmittedPassword;
 $SubmittedPassword = crypt(param('Password'),$Salt); # crypt() the pword
from the login form

 if ($StoredPassword ne $SubmittedPassword)
 {
 print "Permission Denied",p,

param('Username'),"<pre>",$SubmittedPassword,"\n",$StoredPassword,"</pre>",p
 $Auth{param('Username')}{Fname}," ",$Auth{param('Username')}{Lname};
 }
 else
 {
 print "Permission Granted";
 }
</snip>
----------------------------------------------

In the Permission denied section I trap the two variables so that I can
verify their values - each time the two are identical.  So, what rule am I
missing here that prevents "Permission Granted" condition when the two
variable are indeed equal?

PAW




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

Date: 14 Nov 2002 17:12:33 +0100
From: Xavier Noria <fxn@hashref.com>
Subject: Re: multi-file search/replace?
Message-Id: <87adkc3zbi.fsf@kodo.localdomain>

eccles@a-znet.com (George Eccles) writes:

: running perl, version 5.005_03 built for MSWin32-x86-object
: on Win NT4
: 
: I would like to be able to do a (wildcard) mult-file search/replace
: from the command line, as in 
: 
:    > funcname s/_pattern_/_replace_/  *.
: 
: The command line
: 
:    > perl -p -i.bck "s/_pattern_/_replace/"  (file_list)
: 
: does a multi-file find/replace, but requires a file list.  I can glob
: ($ARGV[0]) to produce a file list, but haven't found a way to use that
: ias input for the above command line.  I would prefer to avoid writing
: a whole script (with error-handling, etc), when the above command line
: so nearly does what I want.

The problem there is that the shell that comes with Windows doesn't do
wildcard expansion, so

    C:\>perl -we "print @ARGV" *.pl

prints '*.pl' under Windows, instead of initializing @ARGV with the
names of files with extension 'pl' under C:\.

As you surely now glob() is portable, but then you'd write a script or
else try this meta one liner (tested under Linux and edited here to
follow Windows conventions):

   C:\>perl -e "exec 'perl', '-p', '-i.bck', '-e', 's/search/replace/', glob '*.pl'"

A script would be surely more clear though.

-- fxn


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

Date: Thu, 14 Nov 2002 16:08:02 GMT
From: Steven Smolinski <steven.smolinski@sympatico.ca>
Subject: Re: multi-file search/replace?
Message-Id: <CTPA9.12174$QD6.1246169@news20.bellglobal.com>

George Eccles <eccles@a-znet.com> wrote:
> running perl, version 5.005_03 built for MSWin32-x86-object
> on Win NT4
> 
> I would like to be able to do a (wildcard) mult-file search/replace
> from the command line, as in 
> 
>    > funcname s/_pattern_/_replace_/  *.
> 
> The command line
> 
>    > perl -p -i.bck "s/_pattern_/_replace/"  (file_list)
> 
> does a multi-file find/replace, but requires a file list. 

That is your shell's problem, not perl's.  Solution: use a shell that
allows wildcards to specify file lists.  I thought cmd.exe on Windows
did this if you specify *.*, but it's been a long time since I touched
the Windows shell, so don't trust me.  You can always get cygwin and
use bash.

BTW, you forgot an '-e' up there.  On most unix shells, this will work
fine: 

perl -pi.bck -e 's/foo/bar/' *

Steve


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

Date: Thu, 14 Nov 2002 10:51:35 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: multi-file search/replace?
Message-Id: <slrnat7l4n.2u9.tadmc@magna.augustmail.com>

George Eccles <eccles@a-znet.com> wrote:
> running perl, version 5.005_03 built for MSWin32-x86-object
> on Win NT4
> 
> I would like to be able to do a (wildcard) mult-file search/replace
> from the command line, as in 

>    > perl -p -i.bck "s/_pattern_/_replace/"  (file_list)
> 
> does a multi-file find/replace, but requires a file list.  I can glob
> ($ARGV[0]) to produce a file list, but haven't found a way to use that
> ias input for the above command line.  


(untested)

perl -p -i.bck -e "BEGIN {@ARGV = glob $ARGV[0]} s/_pattern_/_replace/" *.*


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


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

Date: Thu, 14 Nov 2002 17:18:07 GMT
From: eccles@a-znet.com (George Eccles)
Subject: Re: multi-file search/replace?
Message-Id: <3dd3d9ce.1084751400@news.a-znet.com>

On Thu, 14 Nov 2002 10:51:35 -0600, tadmc@augustmail.com (Tad
McClellan) wrote:

>....  

>(untested)
>
>perl -p -i.bck -e "BEGIN {@ARGV = glob $ARGV[0]} s/_pattern_/_replace/" *.*

That seems to do what I want; thank you muchly.  

Is there a doc where a person would discover this construct, or is it
just a matter of "read harder"?

George


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


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

Date: Thu, 14 Nov 2002 11:39:52 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: multi-file search/replace?
Message-Id: <slrnat7nv8.32m.tadmc@magna.augustmail.com>

George Eccles <eccles@a-znet.com> wrote:
> On Thu, 14 Nov 2002 10:51:35 -0600, tadmc@augustmail.com (Tad
> McClellan) wrote:

>>perl -p -i.bck -e "BEGIN {@ARGV = glob $ARGV[0]} s/_pattern_/_replace/" *.*
> 
> That seems to do what I want; thank you muchly.  


Glad I could help. You might want to make the program more flexible
by allowing multiple patterns as arguments:

   BEGIN {@ARGV = glob @ARGV}

> Is there a doc where a person would discover this construct, or is it
> just a matter of "read harder"?


The problem is a Windows-only problem, maybe the win32 Perl docs
address it? I dunno, I don't do Windows.

Other than that, there are several disparate things that you
have to "put together" yourself:

  -i uses the <> diamond operator

  the diamond operator works on whatever is in @ARGV

  you need a BEGIN block to get @ARGV set early enough
  to work with the switches


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


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

Date: 14 Nov 2002 18:07:53 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: sendmail: error email
Message-Id: <u9smy4xbwm.fsf@wcl-l.bham.ac.uk>

[ Text re-ordered.  Top-posting is rude.  Stop it. ]

"Anthony" <anthony.heuveline@wanadoo.fr> top-posts:

> "Brian McCauley" <nobull@mail.com> a écrit dans le message de news:
> u97kfgzcw0.fsf@wcl-l.bham.ac.uk...
> > "Anthony" <anthony.heuveline@wanadoo.fr> writes for the third time...
> >
> > [essentially the same thing he's asked twice already ]

Sorry, I'd only counted the thread in comp.lang.perl.misc.  I now
realise it was more than twice.

> > If you want to refine a question you've already asked then post a
> > follow-up.  Do not start new theads.  Read responses.  If the response
> > doesn't fully answer your question then follow-up the response
> > explaining why it doesn't and ask a supplementary question.

> I'm sorry

Good.

> but each message I posted about sendmail was dealing with
> different aspects of this program.

No.  You had a question about getting error information back from a
piped 'sendmail -t' child process in Perl.

You started at least five separate threads (in comp.lang.perl.misc and
comp.mail.sendmail) each asking minutely different varients of the
same question (or in some cases exactly the same question).

Like I said before if you want to refine a question or want to ask 
supplementary questions you should follow-up within the same thread.

Starting multiple threads is rude because it potentially wastes the
time of people who are trying to help you by not letting them see the
full discussion so making them repeat what others have said.

Like I didn't say before, but will now, if you have a question that
you think may be best discussed in more than one newsgroup then that's
OK - crosspost.  Do _not_ start separate threads.

Starting multiple threads is rude because it potentially wastes the
time of people who are trying to help you by not letting them see the
full discussion so making them repeat what others have said.

> I posted these questions on this forum because I wanted to ask them to
> persons who know about Perl specificities in using sendmail.

The API that sendmail presents when run as a pipelined child from Perl
is exactly the same one it presents when run as a pipelined clild from
C, bourne-shell or any other language.

The way in Perl to capture STDOUT and exit status from a pipelined sendmail 
child process is exactly the same as any other child process.

You really had a question that was in two parts.  A question about
Perl and a question about sendmail.  As you investigated further and
got answers you had supplementary questions (which were not Perl
related).

It would have been OK and nobody would have criticised you if you'd
done all this in a single crossposted thread.  It was the fact that
you started so many threads that was offesive.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

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.  

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 4119
***************************************


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