[22208] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4429 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jan 19 18:06:57 2003

Date: Sun, 19 Jan 2003 15:05:08 -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           Sun, 19 Jan 2003     Volume: 10 Number: 4429

Today's topics:
    Re: A Good Perl Developing Enviroment (Sara)
        ANNOUNCE: DBIx::Hash2Table V 1.01 <ron@savage.net.au>
        ANNOUNCE: Solaris::PerlGcc 1.1 <Alan.Burlison@sun.com>
    Re: Arrays. What don't I get? <wkrempa@erols.com>
    Re: Arrays. What don't I get? <wkrempa@erols.com>
    Re: Arrays. What don't I get? (Anno Siegel)
    Re: Arrays. What don't I get? (Tad McClellan)
        cgi.pm-> cant locate object method 'save' via package <cmustard_!SPAM@nyc.rr.com>
        DBIx::Table2Hash V 1.10 <ron@savage.net.au>
    Re: got me foxed <bongie@gmx.net>
    Re: How are named unary operators that take $_ created? <pinyaj@rpi.edu>
    Re: How are named unary operators that take $_ created? (J. Romano)
    Re: How to execute a perl script from within a perl scr <barbr-en@online.no>
    Re: How to execute a perl script from within a perl scr <tassilo.parseval@post.rwth-aachen.de>
    Re: How to execute a perl script from within a perl scr <bongie@gmx.net>
    Re: How to execute a perl script from within a perl scr <torvill@trolldata.no>
    Re: How to execute a perl script from within a perl scr <barbr-en@online.no>
    Re: How to execute a perl script from within a perl scr <flavell@mail.cern.ch>
    Re: How to execute a perl script from within a perl scr <flavell@mail.cern.ch>
    Re: Inlining object methods via preprocessor for effici (Anno Siegel)
        Net:Ftp output from site command? (Shawn Laemmrich)
    Re: Net:Ftp output from site command? <christian.winter@coc-ag.net>
        parse email from /var/spool/mail/username (Chas Friedman)
        push @x, "a $_ b"; only $_ b is pushed <istink@real.bad.com>
    Re: push @x, "a $_ b"; only $_ b is pushed (Jay Tilton)
        server and client on the same port (Markus Rachbauer)
    Re: server and client on the same port <laocoon@eudoramail.com>
    Re: Using domain.com/?query+string and domain.com/index (krakle)
    Re: Why is order of REs important? <eric.ehlers@btopenworld.com.nospam>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 19 Jan 2003 08:41:56 -0800
From: genericax@hotmail.com (Sara)
Subject: Re: A Good Perl Developing Enviroment
Message-Id: <776e0325.0301190841.634bce0c@posting.google.com>

"A. Fuentes" <alvarof2@hotmail.com> wrote in message news:<iz4W9.43403$aG4.2586200@twister.austin.rr.com>...
> Fellow Perl Netters:
> 
> I have a newbie question:
> 
> What would be a good Perl Developing Enviroment for
> managing and developing Perl projects?
> (Visual Developer Studio-like)
> 
> Any suggestions will be appreciated.
> 
> Thanks in advance,
> 
> A. Fuentes
> 512-297-9937

Some people "emacs" an environment. It runs in Perlmode, and you can
open various windows to do OS and compiling tasks. I like it for
editing and the syntax highlighting is nice, but I still just go to an
eterm for everything else, probably out of my own ignorance of the
power of emacs. In fact newer versions of vi do syntax highlighting as
well so even that distinction isn't so evident.

I've never really seen a (*-nix) Perl dev environment (PDE) per se and
I wouldn't consider working in WinBloz so with those restraints I may
be SOL for a true PDE. Which is pretty much OK with me, I spend about
80% editing and 20% debugging and testing anyhow. So when I'm shopping
for development tools, I spent most of the time in the "editor"
section of the store!

Good luck! At least you chose the right LANGUAGE!

-Gx


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

Date: Sat, 18 Jan 2003 13:08:29 +1100
From: "Ron Savage" <ron@savage.net.au>
Subject: ANNOUNCE: DBIx::Hash2Table V 1.01
Message-Id: <3e2af22f$3_3@news.teranews.com>

DBIx::Hash2Table is a pure Perl module available immediately from CPAN or
from http://savage.net.au/Perl-modules.html.

'ABSTRACT' => 'Save a hash into a database table'

Recent changes:
1.01  Sat Jan 18 12:47:00 2003
 - Change use CGI to use Carp. Upgrading is advised






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

Date: Sun, 19 Jan 2003 12:04:26 +0000
From: Alan Burlison <Alan.Burlison@sun.com>
Subject: ANNOUNCE: Solaris::PerlGcc 1.1
Message-Id: <3e2af21b$1_3@news.teranews.com>

Solaris/PerlGcc version 1.1
============================

perlgcc - Compile perl modules using gcc.

The perl 5.005_03 and 5.6.1 shipped with Solaris 8, 9 and 10 were built with
the Forte compilers, and therefore assume that any add-on modules will
also be built with the Forte compiler.  The C<perlcc> command will
allow gcc to be used to compile add-on modules for use with the perl
versions shipped with Solaris.

Alan Burlison




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

Date: Sun, 19 Jan 2003 16:35:53 -0500
From: wrk <wkrempa@erols.com>
Subject: Re: Arrays. What don't I get?
Message-Id: <3E2B1A38.56A1C4FD@erols.com>



Tina Mueller wrote:

> wrk <wkrempa@erols.com> wrote:
>
> > The foreach looping construct has another feature: each time through the loop,
> > the iterator variable becomes not a copy of but rather an alias for the current
> > element. This means that when you change that iterator variable, you really
> > change each element in the list:
>
> [ snip example ]
>
> > If you didn't know about it, you might accidentally change
> > something. Now
> > you know about it.
>
> what made you think i didn't know? i mentioned "alias" in
> my other post.
>
> regards, tina

Tina,

That was an exerpt from "The Perl Cookbook". I was very impressed you knew about it.!

Bill

>
> --
> http://www.tinita.de/        \  enter__| |__the___ _ _ ___
> http://Movies.tinita.de/      \     / _` / _ \/ _ \ '_(_-< of
> http://PerlQuotes.tinita.de/   \    \ _,_\ __/\ __/_| /__/ perception



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

Date: Sun, 19 Jan 2003 16:53:20 -0500
From: wrk <wkrempa@erols.com>
Subject: Re: Arrays. What don't I get?
Message-Id: <3E2B1E50.3A8DACB6@erols.com>

Why don't you educate me and tell  me what was wrong with my posting . I made it clear
that the text was from the "Perl Cookbook" which I cut and pasted from "The Perl CD
Bookshelf.

It was intended as a compliment Tina's excellant knowledge of Perl.


Anno Siegel wrote:

> Tina Mueller  <usenet@tinita.de> wrote in comp.lang.perl.misc:
> > wrk <wkrempa@erols.com> wrote:
> >
> > > The foreach looping construct has another feature: each time through the loop,
> > > the iterator variable becomes not a copy of but rather an alias for
> > the current
> > > element. This means that when you change that iterator variable, you really
> > > change each element in the list:
> >
> > [ snip example ]
> >
> > > If you didn't know about it, you might accidentally change
> > > something. Now
> > > you know about it.
> >
> > what made you think i didn't know? i mentioned "alias" in
> > my other post.
>
> That was my reaction too, until I realized that the entire posting
> (excepting the first line) is quoted from the Cookbook.  This clown
> did about everything wrong that can be wrong in a Usenet posting, but
> he (or she) probably didn't direct "Now you know..." at you personally.
>
> Anno



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

Date: 19 Jan 2003 22:54:16 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Arrays. What don't I get?
Message-Id: <b0faao$dg5$2@mamenchi.zrz.TU-Berlin.DE>

wrk  <wkrempa@erols.com> wrote in comp.lang.perl.misc:
> Why don't you educate me and tell  me what was wrong with my posting . I

Yeah, why don't I?

I am here to discuss and explain Perl, not explain basic Netiquette.
This excellent source has been pointed out to you elsewhere in this
thread, I'm repeating it here:

    http://mail.augustmail.com/~tadmc/clpmisc.shtml

> made it clear

 ...not clear enough...

> that the text was from the "Perl Cookbook" which I cut and pasted from
> "The Perl CD
> Bookshelf.

 ...with no indication where the multi-paragraph quote ended, followed
by your signature if I remember right.  In addition to top-posting
and full-quoting.

> It was intended as a compliment Tina's excellant knowledge of Perl.

Fair enough, but with your total lack of posting style you formally
invited the misunderstanding that promptly followed.

[TOFU snipped]

Anno


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

Date: Sun, 19 Jan 2003 16:58:22 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Arrays. What don't I get?
Message-Id: <slrnb2mbce.np5.tadmc@magna.augustmail.com>

wrk <wkrempa@erols.com> wrote:
> Anno Siegel wrote:
>> Tina Mueller  <usenet@tinita.de> wrote in comp.lang.perl.misc:
>> > wrk <wkrempa@erols.com> wrote:

[snip stuff from the Cookbook about foreach aliasing]


>> That was my reaction too, until I realized that the entire posting
>> (excepting the first line) is quoted from the Cookbook.  


I think Anno must have overlooked the part that said it was
from the Cookbook.


>> This clown
>> did about everything wrong that can be wrong in a Usenet posting,


I don't know what that was about. 

wrk did only 2 "bad things" that I can see...


> Why don't you educate me and tell  me what was wrong with my posting . 


1) lines too long 

2) top-posting

For other things to avoid, see:

      http://mail.augustmail.com/~tadmc/clpmisc.shtml


> I made it clear
> that the text was from the "Perl Cookbook" which I cut and pasted 
> from "The Perl CD
> Bookshelf.


Anno must have overlooked that part.


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


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

Date: Sun, 19 Jan 2003 19:22:17 GMT
From: mUs <cmustard_!SPAM@nyc.rr.com>
Subject: cgi.pm-> cant locate object method 'save' via package
Message-Id: <slrnb2japc.1c5.cmustard_!SPAM@nyc.rr.com>


I am using perl/5.6.1 on Debian/GNU Linux Woody 3.0. 
I am unable to use the 'save' method. There is no explaination of
having to 'import' anything in the docs, why does this fail?. 

<snip>

#!/usr/bin/perl -lTw

use CGI::Carp 'fatalsToBrowser'; # for debugging info
use strict;
use diagnostics;
use CGI;
use Fcntl;


	   while ( !eof(COMM_OUT) ) {
	       $get_comments = CGI->new(\*COMM_OUT); # pass handle by ref
	       push @entries, $get_comments;

	     }

388	    foreach $get_comments ( @entries ) {
389                 $get_comments->save(\*COMM_OUT);
390             }

</snip>

The error i recieve is:
Can't locate object method 'save' via package 'pack'; 
(perhaps you forgot to load 'pack'?) at script line 389.
It appears that this method is no longer implemented but
i would appreciate any 'real'
info that anyone could provide.
thank you.

-mUs



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

Date: Sat, 18 Jan 2003 13:10:47 +1100
From: "Ron Savage" <ron@savage.net.au>
Subject: DBIx::Table2Hash V 1.10
Message-Id: <3e2af224$1_7@news.teranews.com>

DBIx::Table2Hash is a pure Perl module available immediately from CPAN or
from http://savage.net.au/Perl-modules.html

'ABSTRACT' => 'Read a database table into a hash'

Recent changes:
1.10  Fri Jan 17 11:01:55 2003
 - Add method select_hashref() for when you want a hashref associated with
  each key, where the original method select() just associates a single
  value with each key. In this case, the constructor parameter
  value_column is ignored, and can be omitted
 - Change the sanity checks and error messages, now that value_column can
  be an optional parameter
 - Add a directory, examples/, with a complete program which loads a table
  from a text file into the test database, and calls select_hashref()
  and select() to display the data. This demo also shows the way to use
  exception handling, and suggests one way to corrupt the source code
  in order to trigger an exception with die rather than with throw
 - Update the docs
 - Change use CGI; to use Carp;. So much for my scrupulous testing regime






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

Date: Sun, 19 Jan 2003 18:26:01 +0100
From: "Harald H.-J. Bongartz" <bongie@gmx.net>
Subject: Re: got me foxed
Message-Id: <1083074.Ni2NEU91H3@nyoga.dubu.de>

David Sparkmunster wrote:
> The .shttp page has several lists of names from text files on it apart
> from the form. These are written to it by  !--#exec.
> 
> The perl writes to these files which the user can then see the result
> by hitting refresh. The important things are the text files, the
> .shtml page is only a front end to alter them and check the result.

Ah, so your Perl script should just return the user to this .shtml page?
So, just tell the browser to do that:  After everything is finished
(i.e. after the call to writedata()) insert this:
        print redirect('http://url/of/your/shtml/file');
where the URL must be changed appropriately.

This generates a redirection header that tells the browser not to wait
for any data but to go to the given URL.

Ciao,
        Harald
-- 
Harald H.-J. Bongartz <bongie@gmx.net>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
                    Loading vmunix.el...


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

Date: Sun, 19 Jan 2003 13:26:10 -0500
From: Jeff 'japhy' Pinyan <pinyaj@rpi.edu>
Subject: Re: How are named unary operators that take $_ created?
Message-Id: <Pine.SGI.3.96.1030119132528.649787A-100000@vcmr-64.server.rpi.edu>

On Sun, 19 Jan 2003, Peter J. Acklam wrote:

>jl_post@hotmail.com (J. Romano) wrote:
>
>>    How do you create named unary operators that operate on $_ by
>> default? [...]
>
>I think you must use a prototype, like this:
>
>    sub ceil (;$) {
>        my $x  = @_ ? $_[0] : $_;
>        my $ix = int $x;
>        ($ix >= $x) ? $ix : $ix + 1;
>    }

He tried that.  It doesn't work.  Perl's built-in functions get special
precedence, because the unary ones are more like operators than functions.

-- 
Jeff Pinyan            RPI Acacia Brother #734            2003 Rush Chairman
"And I vos head of Gestapo for ten     | Michael Palin (as Heinrich Bimmler)
 years.  Ah!  Five years!  Nein!  No!  | in: The North Minehead Bye-Election
 Oh.  Was NOT head of Gestapo AT ALL!" | (Monty Python's Flying Circus)



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

Date: 19 Jan 2003 11:49:07 -0800
From: jl_post@hotmail.com (J. Romano)
Subject: Re: How are named unary operators that take $_ created?
Message-Id: <b893f5d4.0301191149.79edb8cb@posting.google.com>

pjacklam@online.no (Peter J. Acklam) wrote in message news:<of6diaev.fsf@online.no>...
> I think you must use a prototype, like this:
> 
>     sub ceil (;$) {
>         my $x  = @_ ? $_[0] : $_;
>         my $ix = int $x;
>         ($ix >= $x) ? $ix : $ix + 1;
>     }

   Thanks for the response, but no, that doesn't work.  (It's similar
to the function

   sub buongiorno (;$) {
      $_[0]=$_ unless @_;  print "Buongiorno, @_!\n";
   }

that I already stated doesn't work.)

   In other words, the line:

   print ceil 3|4

prints "7" (and not "3" like named unary operators do).

   Do you have any other ideas how to construct a Perl function that
behaves like a named unary operator and operates on $_ by default?

   -- J.


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

Date: Sun, 19 Jan 2003 17:41:32 +0100
From: Kåre Olai Lindbach <barbr-en@online.no>
Subject: Re: How to execute a perl script from within a perl script and return info
Message-Id: <86kl2vcvo286fdp5mdblskclcta3q63aeg@4ax.com>

On 19 Jan 2003 15:47:36 GMT, "Tassilo v. Parseval"
<tassilo.parseval@post.rwth-aachen.de> wrote:

>Also sprach Alan J. Flavell:
>
>> On Jan 19, Kåre Olai Lindbach inscribed on the eternal scroll:
>> 
>>> Just for info to the OP: We also have a nice newsgroup in Norwegian
>>> called "no.it.programmering.perl" with so low traffic that we allow
>>> (tolerate) both FAQ-questions and CGI/HTML-related stuff  ;-)

My comment was directed to OP (which clearly seemed Norwegian) and
fellow Norwegian-speaking people. I feel there are so high volume on
cl.perl.misc that I think one should try contry-local group first. And
since volume there is so much lower, we tend to help at a much wider
range of questions.

But of course, one is free to do whatever one wish, and in some cases
clpm might be the right place to start, or continue into, but then
certainly with a somewhat more perlish problem.

>> Just as a side comment to this: as I understand it, the German (de.*)
>> hierarchy have had a reasonably-active ...perl.cgi group for some
>> time, but are just voting to abolish their WWW CGI group on the basis
>> that it has fallen into disuse.
>
>I haven't observed any disuse within the past week. On the contrary,
>at least I have the impression that dclp.cgi produces a similar amount
>of traffic as dclp in these days.

Hopefully with right type of questions within each group :)

>> This is not meant as any kind of proposal for the comp.* hierarchy,
>> and certainly not as a troll; just a comment on the situation as I
>> understand it to be. It would be interesting to hear how it looks to
>> those who are active on the de.* hierarchies,
>
>From my personal standpoint, it looks quite good. dclpm receives far
>less CGI-related postings than this group which makes it a pleasant spot
>overall. I'd even go as far as saying that a clp.cgi would be a benefit
>to this group, too.


*********************
[1] English no problem, although some Italiens read the hierarchy
"no.it.*" as something to with Italia, but we then tell them to read
it as it is written: "NO italians" [2]   :-)

[2] I hope noone takes this personally ;-)


-- 
mvh/Regards
Kåre Olai Lindbach


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

Date: 19 Jan 2003 18:57:09 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de>
Subject: Re: How to execute a perl script from within a perl script and return info
Message-Id: <b0ese5$o4i$1@nets3.rz.RWTH-Aachen.DE>

Also sprach Alan J. Flavell:

> On Jan 19, Tassilo v. Parseval inscribed on the eternal scroll:
> 
>> > Just as a side comment to this: as I understand it, the German (de.*)
>> > hierarchy have had a reasonably-active ...perl.cgi group for some
>> > time, but are just voting to abolish their WWW CGI group on the basis
>> > that it has fallen into disuse.
>>
>> I haven't observed any disuse within the past week. On the contrary,
>> at least I have the impression that dclp.cgi produces a similar amount
>> of traffic as dclp in these days.
> 
> Sorry, I think you misunderstand me, By "abolish their WWW CGI group"
> I meant this:
> 
>  ___
> /
> 
> Ergebnisse Loeschung von de.comm.infosystems.www.authoring.cgi

Ah, indeed. That was a couple of weeks ago.

[...]

>> From my personal standpoint, it looks quite good. dclpm receives far
>> less CGI-related postings than this group which makes it a pleasant spot
>> overall.
> 
> Indeed.  However, there then seems to be no appropriate place for
> discussing language-neutral CGI issues.

Well, you could naturally argue that once there was such a group and it
became obsolete. ;-)

> But I'll hang fire on any further detailed comments until I've seen
> other reactions.  I just wanted to clarify my original reference, as
> it seems you misunderstood me on that.

Thanks, reference is clear now. As for reactions: Mine is probably
non-authoritive since I am not subscribed to any CGI-specific group.
de.comp.lang.perl.cgi is an exception because it has the word 'perl' in
it and thus received my mercy.

Tassilo
-- 
$_=q!",}])(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus;})(rekcah{lrePbus;})(lreP{rehtonabus;})(rehtona{tsuJbus!;
$_=reverse;s/sub/(reverse"bus").chr(32)/xge;tr~\n~~d;eval;


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

Date: Sun, 19 Jan 2003 20:27:01 +0100
From: "Harald H.-J. Bongartz" <bongie@gmx.net>
Subject: Re: How to execute a perl script from within a perl script and return info
Message-Id: <16049581.WmMDS2T5KO@nyoga.dubu.de>

Alan J. Flavell wrote:
> However, there then seems to be no appropriate place for
> discussing language-neutral CGI issues.

The german general CGI group had almost no traffic lately
(<< 1 post/day), and some of the postings even were about Perl CGI, so
the rmgroup was perhaps okay (although I voted against it, same
reasoning as yours).  

Ciao,
        Harald
-- 
Harald H.-J. Bongartz <bongie@gmx.net>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
perl -le'$/=1;L:while($/++){$/%$_||next L for(@_);push@_,$/;print$/}'



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

Date: Sun, 19 Jan 2003 21:34:35 +0100
From: "Anders Torvill Bjorvand" <torvill@trolldata.no>
Subject: Re: How to execute a perl script from within a perl script and return info
Message-Id: <1043008540.715577@a217-118-32-43.bluecom.no>

"Tad McClellan" <tadmc@augustmail.com> skrev i melding
news:slrnb2ios6.7f1.tadmc@magna.augustmail.com...
> have you heard of the really great perl documentation?

And have you heard of common courtesy?

My comment was a legitimate answer to a proposal that I doubted would solve
my problem - therefore I asked. Your answer on the other hand generated some
10 irrelevant postings as to the proper division of the different countries'
perl-newsgroups. So I am not responsible for flooding this group. YOU on the
other hand ...

Unless you contribute, shut up and stop flooding this group yourself.

> If you read the documentation for the function that you are using
> there, it will tell you how to do what you have asked.

Well - if you had even cared to reread my original posting, that's just what
I have done from the start, and it does not work.

Sincerely,
Anders Torvill Bjorvand




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

Date: Sun, 19 Jan 2003 23:40:52 +0100
From: Kåre Olai Lindbach <barbr-en@online.no>
Subject: Re: How to execute a perl script from within a perl script and return info
Message-Id: <go8m2vo647t9bccpqjbtk0s535hisvk9or@4ax.com>

On Sun, 19 Jan 2003 21:34:35 +0100, "Anders Torvill Bjorvand"
<torvill@trolldata.no> wrote:

>"Tad McClellan" <tadmc@augustmail.com> skrev i melding
>news:slrnb2ios6.7f1.tadmc@magna.augustmail.com...
>> have you heard of the really great perl documentation?
>
>And have you heard of common courtesy?
>
>My comment was a legitimate answer to a proposal that I doubted would solve
>my problem - therefore I asked. Your answer on the other hand generated some
>10 irrelevant postings as to the proper division of the different countries'
>perl-newsgroups. So I am not responsible for flooding this group. YOU on the
>other hand ...

This is Usenet. You donot own any thread or sub-thread ;-)

>Unless you contribute, shut up and stop flooding this group yourself.

If that was directed towards Mr. McClellan, you _certainly_ pointed it
towards the wrong person. Mr. McClellan, among many others, tries
their best to keep up a good conduct and policy here. Often in vain
effort, I think he and others get at least 5-10 such replies a month.

But it maybe dosn't matter anymore, since your're probably silently
killfiled many places ... (and that by people knowing much more than
me, both about Perl and CGI and OS-problems) 

 ... which you probably would have avoided, had you paid better notice!

>> If you read the documentation for the function that you are using
>> there, it will tell you how to do what you have asked.
>
>Well - if you had even cared to reread my original posting, that's just what
>I have done from the start, and it does not work.

The problem is that your question probably is better suited somewhere
else.

You might get a solution with Perl's system( ) (That's a Perl FAQ).
That's rather for invoking another script, and not getting the result
back into a variable)

You might use "action"-attribute in "form"-s-tag (That's HTML and CGI,
since you mention .cgi-files)
(Here one needs to read about CGI-modules-stuff to make it related to
Perl)

You might use Perl LPW-modules-stuff to parse results/output, and put
results into a variable

I think you are thinking somewhat of a X-Y problem.

PS: You are still welcome in no.it.programmering.perl  ;-) ES.

-- 
mvh/Regards
Kåre Olai Lindbach


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

Date: Sun, 19 Jan 2003 18:03:39 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: How to execute a perl script from within a perl script and return info
Message-Id: <Pine.LNX.4.40.0301191745310.3614-100000@lxplus072.cern.ch>

On Jan 19, Tassilo v. Parseval inscribed on the eternal scroll:

> > Just as a side comment to this: as I understand it, the German (de.*)
> > hierarchy have had a reasonably-active ...perl.cgi group for some
> > time, but are just voting to abolish their WWW CGI group on the basis
> > that it has fallen into disuse.
>
> I haven't observed any disuse within the past week. On the contrary,
> at least I have the impression that dclp.cgi produces a similar amount
> of traffic as dclp in these days.

Sorry, I think you misunderstand me, By "abolish their WWW CGI group"
I meant this:

 ___
/

Ergebnisse Loeschung von de.comm.infosystems.www.authoring.cgi
(106 gueltige Stimmen)

 Ja  Nein : 2/3? >=60? : ang.? : Gruppe
==== ==== : ==== ===== : ===== :
===============================================
  93   12 :  Ja   Ja   :   Ja  : Loeschung
de.comm.infosystems.www.authoring.cgi

1 Enthaltung

Gegen dieses Ergebnis kann innerhalb einer Woche nach seiner
Veroeffentlichung Einspruch erhoben werden (siehe Wahlregeln).

\___

Message-ID:
<Result-Loeschung-de.comm.infosystems.www.authoring.cgi-03.01.2003@dana.de>

> From my personal standpoint, it looks quite good. dclpm receives far
> less CGI-related postings than this group which makes it a pleasant spot
> overall.

Indeed.  However, there then seems to be no appropriate place for
discussing language-neutral CGI issues.

But I'll hang fire on any further detailed comments until I've seen
other reactions.  I just wanted to clarify my original reference, as
it seems you misunderstood me on that.



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

Date: Sun, 19 Jan 2003 22:35:20 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: How to execute a perl script from within a perl script and return info
Message-Id: <Pine.LNX.4.40.0301192218570.3614-100000@lxplus072.cern.ch>

On Jan 19, Torvill at the aptly-named trolldata.no opined:

> "Tad McClellan" <tadmc@augustmail.com> skrev i melding
> news:slrnb2ios6.7f1.tadmc@magna.augustmail.com...
> > have you heard of the really great perl documentation?
>
> And have you heard of common courtesy?

I think he has.  That's why he took the trouble to collate an
excellent posting guidelines article - to help people avoid various
kinds of social faux pas (netiquette errors, call them what you will)
on the group.  Most of it is just an encapsulation of accepted good
practice on any technical usenet group.

> My comment was a legitimate answer to a proposal that I doubted would solve
> my problem

But was unfortunately composed in such a way as to guarantee that
the discussion would be more about its inappropriate form than about
its substantive content.

It would appear from your first posting that you _do_ know how to
capture the standard output from a system command.  But you didn't
tell anything about just what you tried, what output you expected,
etc.: all that we know is that the results, whatever they might have
been, disappeared somewhere within the invoking script.  That's no way
to seek help.

> Your answer on the other hand generated some
> 10 irrelevant postings as to the proper division of the different countries'
> perl-newsgroups. So I am not responsible for flooding this group. YOU on the
> other hand ...

Do you have the slightest justification for accusing Tad of being the
cause for other people's thread drift?  I see absolutely none.
Speaking as one of the offenders, I want to see you accusing the right
people, and not trying to jail someone who just happened to arrive on
the scene shortly before the crime was committed.

> Unless you contribute, shut up and stop flooding this group yourself.

Right, that's it.  You go in the killfile now.

> Well - if you had even cared to reread my original posting, that's just what
> I have done from the start, and it does not work.
                                  ^^^^^^^^^^^^^^^^

 Beware of saying ``doesn't work''
  This is a ``red flag'' phrase. If you find yourself writing that,
  pause and see if you can't describe what is not working without
  saying ``doesn't work''. That is, describe how it is not what you
  want.

http://mail.augustmail.com/~tadmc/clpmisc.shtml

You have an error in line 47.

Bye.



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

Date: 19 Jan 2003 22:28:17 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Inlining object methods via preprocessor for efficiency (!?)
Message-Id: <b0f8q1$dg5$1@mamenchi.zrz.TU-Berlin.DE>

Ben Morrow <mauzo@mimosa.csv.warwick.ac.uk> wrote in comp.lang.perl.misc:
> richw@richw.org (Rich Wales) wrote:
> >I wrote an object-oriented Perl program some time ago which needed
> >to run as fast as possible.
> 
> Hmm, bad plan. OO is slow in Perl, as inheritance is computed at compile time.

s/compile time/run time/, I suppose.  That's true, but it's not so bad.
Perl caches inherited methods, so in the long run a call to an
inherited method isn't any slower than a plain method call, even if deep
inheritance is involved.  Only if you mess with an @ISA is inheritance
resolved at run time, and that won't happen very often.

Choosing Perl to write a program that must run "as fast as possible" is
the bad move.  Once you have made that choice, Damian's rule of thumb
says that OO cost you up to one third more than a non-OO implementation.
I have found that to be true, and often the overhead is much smaller.

[good advice, which mentions premature optimization, snipped]

Anno


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

Date: 19 Jan 2003 13:22:37 -0500
From: swlaemmr@mtu.edu (Shawn Laemmrich)
Subject: Net:Ftp output from site command?
Message-Id: <3e2aeced@mtunews.mtu.edu>


Trying to do something which I thought would be relatively simple.....

I want to connect to a ftp site, run several site commands and capture
the output for later processing.... something like this:

$ftp->login("blah","oog");
$x = $ftp->site("info blah");


Then post process $x later.  Unfortunately $x does not contain the output
of the "site info blah" command.... How do I capture this info?


thanks


Shawn


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

Date: Sun, 19 Jan 2003 20:52:05 +0100
From: "Christian Winter" <christian.winter@coc-ag.net>
Subject: Re: Net:Ftp output from site command?
Message-Id: <4#kMhO$vCHA.2604@aurum.coc-ag.net>

"Shawn Laemmrich" <swlaemmr@mtu.edu> wrote:
[...]
> I want to connect to a ftp site, run several site commands and capture
> the output for later processing.... something like this:
> 
> $ftp->login("blah","oog");
> $x = $ftp->site("info blah");
[...]

Hi,

Just call $ftp->message() after doing the site command like
my $returnmsg = $ftp->message();

The message() function is inherited from package
Net::Cmd and returns the response of the last command
issued. See "perldoc Net::Cmd" for details.

HTH
-Christian



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

Date: Sun, 19 Jan 2003 19:51:40 +0000 (UTC)
From: friedman@math.utexas.edu (Chas Friedman)
Subject: parse email from /var/spool/mail/username
Message-Id: <b0evkc$fbv$1@geraldo.cc.utexas.edu>


>Anyone know what separates each message in the /var/spool/mail/username
>file?

 You should be able to find out easily by looking at the file. In many
cases, you can use /^From /, i.e. look for "From" at the beginning of a line
followed by a space to find where messages begin. 
(If an email actually contains a line of text beginning with "From" followed 
by a space, many mail programs replace that by "^From" or something similar for obvious reasons...)
                      chas




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

Date: Sun, 19 Jan 2003 17:11:26 -0500
From: istink <istink@real.bad.com>
Subject: push @x, "a $_ b"; only $_ b is pushed
Message-Id: <3E2B228E.791E75DA@real.bad.com>

push @x, "a $_ b";

why only $_ and what comes after is pushed?
what happened to text before?
---------------------------------

$list="/../myList.txt";

open (READ, "$list");
while (<READ>){
    chomp;
    @fields=split /\|/, $_;
    if ($fields[0] ne "ID") {
        #get important items first
        if ($fields[2] eq "y") {
            $pushit = "why am I not printed $_ why am I getting
attention";
            push @itemsImportant, $pushit;
        }
        #now get the unimportant items
        else {
            push @itemsUnimportant, $_;
        }
    }
}
close (READ);

push @list, @itemsImportant;
push @list, @itemsUnimportant;

print
"\n\n\n_________________________________________________________\n";



foreach (@list) {
    @fields=split /\|/, $_;
    print "$fields[1]";
    if ($fields[3]){
        print " -- Due: $fields[3]";
    }
    print "\n";
}


------------------------------------------
my $list looks like this
$list="/../myList.txt";

ID|field1|field2|field3...
1|a|b|c...
2|a|b|c...


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

Date: Sun, 19 Jan 2003 22:50:40 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: push @x, "a $_ b"; only $_ b is pushed
Message-Id: <3e2b2890.227338689@news.erols.com>

istink <istink@real.bad.com> wrote:

: push @x, "a $_ b";
: 
: why only $_ and what comes after is pushed?
: what happened to text before?
: ---------------------------------
: 
: $list="/../myList.txt";
: open (READ, "$list");
: while (<READ>){

For future reference, the __DATA__ token is perfectly suited to
embedding data into a program to be posted.  It saves readers the
trouble of creating a separate data file, 

:     chomp;
:     @fields=split /\|/, $_;
:     if ($fields[0] ne "ID") {
:         #get important items first
:         if ($fields[2] eq "y") {
:             $pushit = "why am I not printed $_ why am I getting
: attention";
:             push @itemsImportant, $pushit;

With the data supplied, that branch never gets executed.

:         }
:         #now get the unimportant items
:         else {
:             push @itemsUnimportant, $_;
:         }
:     }
: }
: close (READ);
: push @list, @itemsImportant;
: push @list, @itemsUnimportant;
: 
: foreach (@list) {
:     @fields=split /\|/, $_;
:     print "$fields[1]";
:     if ($fields[3]){
:         print " -- Due: $fields[3]";

There's the answer.  The problem is not with the push() but with this
output routine.  The strings in the array are complete, but you're
printing only selected pieces of them.

:     }
:     print "\n";
: }




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

Date: 19 Jan 2003 08:57:38 -0800
From: markus.rachbauer@chello.at (Markus Rachbauer)
Subject: server and client on the same port
Message-Id: <51afb9de.0301190857.784aa853@posting.google.com>

hi,

i need to write a program, that interacts with a communication-server,
which answers requests from clients back to the same ip/port, from
where the previous connection was initiated. this means, if i connect
to the comm-server from port 9000 on my machine, i've to start a
listening socket on port 9000. so i can't send a second message from
the same port. is it possible to start a listening socket on port 9000
and send messages from port 9000 on my machine to any port on another
machine? i've also tried the ReusePort option, but got an error
message on my system (suse81 on x86).

thanks,

markus rachbauer


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

Date: Sun, 19 Jan 2003 18:26:29 +0100
From: Lao Coon <laocoon@eudoramail.com>
Subject: Re: server and client on the same port
Message-Id: <Xns9308BBA14CA38Laocoon@62.153.159.134>

markus.rachbauer@chello.at (Markus Rachbauer) wrote in 
news:51afb9de.0301190857.784aa853@posting.google.com:

> hi,
> 
> i need to write a program, that interacts with a communication-server,
> which answers requests from clients back to the same ip/port, from
> where the previous connection was initiated. this means, if i connect
> to the comm-server from port 9000 on my machine, i've to start a
> listening socket on port 9000. so i can't send a second message from
> the same port. is it possible to start a listening socket on port 9000
> and send messages from port 9000 on my machine to any port on another
> machine? i've also tried the ReusePort option, but got an error
> message on my system (suse81 on x86).

What exactly does this all have to do with Perl? Post in a group that deals 
with your particular system and/or the socket API.

Lao


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

Date: 19 Jan 2003 11:53:16 -0800
From: krakle@visto.com (krakle)
Subject: Re: Using domain.com/?query+string and domain.com/index.cgi?query+string...
Message-Id: <237aaff8.0301191153.2ab9f080@posting.google.com>

Andrew Lee wrote in message news:<nbui2v4qa0dairg8q695qq8cu1urmmceor@4ax.com>...
> Do you know how to use cgi?  THere are more than a few tutorials out
> there.

Being a perl programmer for 4 years yes. I don't think you understood
my post correctly.

Server 1 passes the query string to the CGI when you use /dir/?blah.
Server 2 (the new server) doesn't when you append the query string to
the directory which holds the index.cgi (the default page).

> 
> domain.com/?query+string sends the web server some info after the
> address

Heres an example http://typex.net/test/?http://yahoo.com

> -- since you are not explicitly calling index.cgi is the
> server supposed to call it for you?  With those parameters?  That
> looks odd to me.

Look at the above example.

> 
> You might want a URL like :
> 
> http://domain.com/cgi-bin/index.cgi?query=string
>

That would defeat the purpose of what I'm doing (See above example
again).
 
> But that is just a guess.  I have no idea what your setup is and what
> you expect.

Just as I described.


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

Date: Sun, 19 Jan 2003 22:05:53 +0000 (UTC)
From: "eric" <eric.ehlers@btopenworld.com.nospam>
Subject: Re: Why is order of REs important?
Message-Id: <b0f7g1$ad7$1@helle.btinternet.com>

"Andrej Hocevar" <root@siol.net> wrote in message
news:slrnb2l3ka.2gn.root@sonet.utopija.linux...
> Hello.
hello.

> I have a little problem with a program I've pasted here. It seems
> that the order in the configuration file is important: in this
> example, both rules should match, but instead only one does with
> inapropriate order. Why is this?
> If the rule #3 precedes rule #2, then both match, otherwise they
> don't. This shouldn't be, right?
right, i see what you mean.

first, below i add the bare minimum changes necessary to get your program to
a) compile and b) work as you expect.

> #!/usr/bin/perl
>
> $temp = "/tmp/mofo.tmp.TEST";
> $outm = "/tmp/mofo.tmp.new.TEST";
> $conf_f = "mofoconf";

<snip>

> if ($filters == 0) {
>     if ($prev =~ /^RULE/) {
>         $i++;
>         $ii = 0;
>     }
>     $rule[$i][$ii] = $_;
>     $ii++;
>     $prev = $_;
> }

} # missing a right curly brace here

>
> while (<>) {
> print TEMP $_;
> }
> close(TEMP);

<snip>

> if ($header_fields{$_} =~ /$search_hcontent/gsi) {

# remove the /g modifier above

=====================================

the bug can be recreated with the code below:

my @patterns = qw(pop\.siol\.net \"\@);
my $string='<"lucky customers"@pop.siol.net> <ah@siol.net>';
for (@patterns) {
  print "loop 1: testing $_:\n";
  print "matched\n" if $string =~ /$_/gsi;
}
for (reverse @patterns) {
  print "loop 2: testing $_:\n";
  print "matched\n" if $string =~ /$_/gsi;
}

which outputs:

loop 1: testing pop\.siol\.net:
matched
loop 1: testing \"\@:
loop 2: testing \"\@:
matched
loop 2: testing pop\.siol\.net:
matched

in scalar context, the /g modifier tells the engine to pick up where it left
off after a successful match.

in the first loop, in the first iteration, the engine searches string -
<"lucky customers"@pop.siol.net> <ah@siol.net>
for pattern
pop\.siol\.net
and finds a match.
in the second iteration, the engine searches the remainder of the string -
> <ah@siol.net>
for pattern
\"\@
and fails to find a match.

i'm sure you can work out why you get two matches when you list the patterns
in the reverse sequence.  i don't think you need the /g modifier so the fix
is to simply remove it.

apart from all that ...  there are loads of things you'll want to do
differently in this code before you put it live.  for starters i'd put
use strict;
use warnings;
at the top which will prevent it from compiling until you declare all the
variables properly etc.

also you're writing your arguments into a temp file and then just re-loading
them again, better simply to process them in memory.

have fun.

-eric




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

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


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