[10362] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3955 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 12 16:07:15 1998

Date: Mon, 12 Oct 98 13:00:20 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 12 Oct 1998     Volume: 8 Number: 3955

Today's topics:
    Re: Alpha and MacPerl do not play well together (brian d foy)
        can DCOM Objects can be Executed by \ c++ written for p <yuvaly1@isdn.net.il>
    Re: Character to hex conversion (brian d foy)
        Communication with a program via system() <showie@uoguelph.ca>
    Re: Communication with a program via system() <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: Communication with a program via system() <aperrin@mcmahon.qal.berkeley.edu>
        Connecting to Oracle on Unix using Win32::ODBC broker2000@my-dejanews.com
    Re: Difficulty with HTML & Perl & CGI (brian d foy)
        Free Software Award (Michael J Gebis)
        How to install perl compiler? <pinimog@internet-zahav.net.il>
    Re: London.pm - Changed URL (brian d foy)
    Re: Need help with time function scott@softbase.com
        Newbie Using a variable for search/substitue options asequeir@yahoo.com
    Re: Newbie Using a variable for search/substitue option <rick.delaney@shaw.wave.ca>
        Pack and Unpack (Garrett Casey)
    Re: Perl freezes when using special characters in HTML (Tad McClellan)
    Re: Perl freezes when using special characters in HTML scott@softbase.com
        Q: How to use a parameter on a perl script executed fro (Raoul)
    Re: sorting hack (Abigail)
    Re: Statistics for comp.lang.perl.misc (Bart Lateur)
        Trying to setup Perl locally:  Software Error? <BOwen@PrioritySearch.Com>
    Re: unidirectional pipe into interactive program (passw <aperrin@mcmahon.qal.berkeley.edu>
    Re: unidirectional pipe into interactive program (passw <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: unidirectional pipe into interactive program (passw <mtk@egmont-kol.dk>
    Re: want to leave tcl for perl <ldaffner@rsn.hp.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Mon, 12 Oct 1998 14:44:24 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Alpha and MacPerl do not play well together
Message-Id: <comdog-ya02408000R1210981444240001@news.panix.com>
Keywords: from just another new york perl hacker

In article <xzcbtnhrc3f.fsf@rodan.syr.edu>, rsholmes@rodan.syr.edu (Richard S. Holmes) posted:

>With some older versions of Alpha and MacPerl I had no problems
>editing a script in Alpha and sending it to MacPerl to run.  But no
>longer -- now I get
>
># Illegal character \012 (carriage return).
>File 'Untitled'; Line 2
># (Maybe you didn't strip carriage returns after a network transfer?)

>This is using Alpha 7.1 and MacPerl 5.2.0r4 on a PowerMac G3 running
>Mac OS 8.1.  Any ideas?  Any FAQs I should have read?  Thanks.

i haven't used Alpha, but i got similar results once with a BBEdit
file that had Unix line breaks set rather than Mac line breaks.  change
the \012 (0x0A) to \015 (0x0D) and see what happens. :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>


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

Date: Tue, 13 Oct 1998 08:23:03 +0200
From: Yuval Yosef <yuvaly1@isdn.net.il>
Subject: can DCOM Objects can be Executed by \ c++ written for perl
Message-Id: <3622F1C7.6EFA563D@isdn.net.il>

hello everybody !

Can i tie DCOM objects through WSH in the new ActiveState Release .
What does it takes to write such objects in c++

Thanks,

                                  Yuval



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

Date: Mon, 12 Oct 1998 14:39:42 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Character to hex conversion
Message-Id: <comdog-ya02408000R1210981439420001@news.panix.com>
Keywords: from just another new york perl hacker

In article <3621E4D2.DCA808EE@david-bradshaw.com>, David Bradshaw <david@david-bradshaw.com> posted:

>Can someone please inform me of how i can convert a Character ie "a"
>within a string ie "Today" to give it its hexadecimal character code.

something i put together for a BBEdit Perl Filter that allows me to
do this to the selected text.  notice the use of ord() and printf(). :)

000000 23217065 726C202D 6E0D242F 3D756E64  #!perl -n.$/=und
000010 65663B24 643D245F 2E3C3E3B 246C3D6C  ef;$d=$_.<>;$l=l
000020 656E6774 68202464 3B776869 6C652824  ength $d;while($
000030 693C246C 297B7072 696E7466 22253036  i<$l){printf"%06
000040 5820222C 24692069 66212469 2531363B  X ",$i if!$i%16;
000050 0D24633D 73756273 74722824 642C2469  .$c=substr($d,$i
000060 2B2B2C31 293B7072 696E7466 22253032  ++,1);printf"%02
000070 58222C6F 72642824 63293B24 732E3D6F  X",ord($c);$s.=o
000080 72642824 63293C30 7831303F 272E273A  rd($c)<0x10?'.':
000090 24633B69 6628210D 28246925 34292626  $c;if(!.($i%4)&&
0000A0 24692531 36297B70 72696E74 2720277D  $i%16){print' '}
0000B0 656C7369 66282128 24692531 3629297B  elsif(!($i%16)){
0000C0 7072696E 74662220 2025735C 6E253036  printf"  %s\n%06
0000D0 5820222C 24732C24 693B2473 3D0D2727  X ",$s,$i;$s=.''
0000E0 7D7D7072 696E7422 20227828 322A2472  }}print" "x(2*$r
0000F0 2B28696E 74282472 2F342929 292C2220  +(int($r/4)))," 
000100 2024735C 6E226966 28282472 3D31362D   $s\n"if(($r=16-
000110 28246925 31362929 213D3136 293B0D    ($i%16))!=16);.

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>


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

Date: 12 Oct 1998 17:50:42 GMT
From: Steve Howie <showie@uoguelph.ca>
Subject: Communication with a program via system()
Message-Id: <6vtfhi$cl8$1@testinfo.uoguelph.ca>

I have a question regarding a dialog with an external program called via
system().  When called using system(), the program will prompt to stdout
for a y/n response before continuing. Any ideas how to go about setting
this up so that the perl program can communicate with this external 
program? Named pipes possibly?

The external program cannot be set up to mask the prompt, unfortunately.

perl 5.004 under Unix

Thanks in advance,

Scotty
-- 
Steve Howie					root@127.0.0.1
Netnews and Listserv Admin			519 824-4120 x2556
University of Guelph			
"If it's not Scottish it's CRRRRAAAAAAAPPPPPP!"


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

Date: 12 Oct 1998 21:08:07 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Communication with a program via system()
Message-Id: <83r9wdtx7s.fsf@vcpc.univie.ac.at>

Re: Communication with a program via system(), Steve
<showie@uoguelph.ca> said:

Steve> I have a question regarding a dialog with an external
Steve> program called via system().  When called using
Steve> system(), the program will prompt to stdout for a y/n
Steve> response before continuing. Any ideas how to go about
Steve> setting this up so that the perl program can
Steve> communicate with this external program? Named pipes
Steve> possibly?

perldoc perlipc

-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien,  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: Mon, 12 Oct 1998 12:37:51 -0700
From: Andrew Perrin <aperrin@mcmahon.qal.berkeley.edu>
To: Steve Howie <showie@uoguelph.ca>
Subject: Re: Communication with a program via system()
Message-Id: <36225A8F.570BD8CE@mcmahon.qal.berkeley.edu>

[Reply posted & sent via e-mail]

If all you need is to send a 'y', you have a couple easy options:

1.) Use the yes program (I think gnu has one):
system('yes | externalprogram');

2.) Use a filehandle:
open(PROGRAM, '|externalprogram') || die "Couldn\'t open program: $!\n";
print PROGRAM "y\n";

3.) Use Expect.pm
This is a much more powerful way of controlling external programs, but if
all you need is the "y" then it's overkill.

4.) Use sockets, pipes, named pipes, etc.
All of these will solve your problem, but are probably too much bother.

Good luck!
ap


Steve Howie wrote:

> I have a question regarding a dialog with an external program called via
> system().  When called using system(), the program will prompt to stdout
> for a y/n response before continuing. Any ideas how to go about setting
> this up so that the perl program can communicate with this external
> program? Named pipes possibly?
>
> The external program cannot be set up to mask the prompt, unfortunately.
>
> perl 5.004 under Unix
>
> Thanks in advance,
>
> Scotty
> --
> Steve Howie                                     root@127.0.0.1
> Netnews and Listserv Admin                      519 824-4120 x2556
> University of Guelph
> "If it's not Scottish it's CRRRRAAAAAAAPPPPPP!"



--
-------------------------------------------------------------
Andrew J. Perrin - NT/Unix/Access Consulting -  (650)938-4740
aperrin@mcmahon.qal.berkeley.edu (Remove the Junk Mail King)
     http://www.geocities.com/SiliconValley/Grid/7544/
-------------------------------------------------------------




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

Date: Mon, 12 Oct 1998 17:47:38 GMT
From: broker2000@my-dejanews.com
Subject: Connecting to Oracle on Unix using Win32::ODBC
Message-Id: <6vtfbq$nna$1@nnrp1.dejanews.com>

Hi,

I am running PERL v5.0004 on WinNT. I am trying to write a script that will
connect to an Oracle server on Unix. I am trying to use the Win32:ODBC module
to accomplish this.

When I set up the ODBC source using the ODBC Administartor, there is no place
to specify the userid or passwd for the Oracle database. So when I try to use
Win32::ODBC($OracleDb) I get an error "1004[Oracle][ODBC Oracle
Driver][Oracle OCI]ORA-01004: default username feature not supported; logon
denied.main." So is there any way I can specifythe user name and passwd when
I make that call to Win32::ODBC? If not then is there any other way to get
around this problem?

Thanks for all the help.

--
Sincerely,
Broker2000

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 12 Oct 1998 14:19:49 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Difficulty with HTML & Perl & CGI
Message-Id: <comdog-ya02408000R1210981419490001@news.panix.com>
Keywords: from just another new york perl hacker

In article <36220707.4CC17214@min.net>, John Porter <jdporter@min.net> posted:

>brian d foy wrote:
>> 
>> header() doesn't ignore the argument list:

>So, header; and header() are in fact identical.
>It's kinda too bad a module has to subvert normal perl semantics
>like that.

that's not the worst of it.  CGI.pm also has its own Autoloader :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>


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

Date: 12 Oct 1998 18:27:55 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Free Software Award
Message-Id: <6vthnb$m7n@mozo.cc.purdue.edu>

Perhaps I'm just a victim of USENET non-causality, or maybe I'm just
out of the loop, but I haven't seen this here yet.  It seems that the
author of the "Warp space-war game" has won the Gnu Free Software Award.
The original copy of this article can be found at:

http://www.gnu.org/gnu/award.html

Rock on, Larry!
-----------------------------------------------------------------------------
Larry Wall won the Free Software Foundation Award for the Advancement
of Free Software for his many contributions to
the advancement of freely distributed software, most notably Perl, a
robust scripting language for sophisticated text
manipulation and system management. His other widely-used programs
include rn (news reader), patch (development and
distribution tool), metaconfig (a program that writes Configure
scripts), and the Warp space-war game. 

"... Perl, a tool that takes the UNIX ideas of flexibility and
portability further than almost any program before it. Perl is
probably the most powerful and widely applicable GNU program." 

"Larry Wall has always promoted keeping his implementations free for
all to study, enhance, and build on, without
restrictions, and the freedom for all to benefit in whatever ways they
can from his products." 

In choosing the winner, we looked for a person who has made a great
contribution to the progress and development of free
software, through activities that accord with the spirit of free
software. 

Any kind of activity could be eligible--writing software, writing
documentation, publishing CDs, even journalism--but
whatever the activity, we wanted to recognize long-term central
contributions to the development of the world of free
software. ``Accord with the spirit'' means, for example, that
software, manuals or collections of them (on tape or CD) must
be entirely free. (That's free as in freedom; selling copies of free
software for money is legitimate and would not disqualify
someone from the award.) Work done commercially is eligible, but we
want to give awards to individuals, not companies. 

People such as Richard Stallman and Linus Torvalds, who have already
received other awards for their contributions, are
not eligible for the Free Software Award. 

The awards committee considered nominations and decided who will
receive the award. The committee's members are Peter
Salus (Chairman), Scott Christley, Rich Morin, Adam Richter, Richard
Stallman, and Vernor Vinge. 

Copyright (C) 1998 Free Software Foundation, Inc., 59 Temple Place -
Suite 330, Boston, MA 02111, USA 

Verbatim copying and distribution is permitted in any medium, provided
this notice is prese.

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: Mon, 12 Oct 1998 20:25:50 +0200
From: internet-zahav <pinimog@internet-zahav.net.il>
Subject: How to install perl compiler?
Message-Id: <362249AE.8DBBAD22@internet-zahav.net.il>

I tried to install Malcolm Beattie's perl compiler, on win95, but got so
many
errors - I almost fainted. I have the standard perl 5.004_02 binary
distribution. Did anybody succeed in installing this compiler on win95 ?

Also - were can I get perlcc and how does it work ?
Any help would be appreciated. Thanks.



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

Date: Mon, 12 Oct 1998 14:28:47 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: London.pm - Changed URL
Message-Id: <comdog-ya02408000R1210981428470001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6vsj51$j81$1@nnrp1.dejanews.com>, dave@mag-sol.com posted:

>Please note that the URL for the London.pm web site has changed. If you link
>to our page, please update your links accordingly.
>
>New URL: <http://london.pm.org>
>
>Thanks to pm.org and all concerned for making this new URL possible.

That is, Perl Mongers now offers free web hosting to Perl Users Groups.
And we're not talking that limited sort of web hosting either - all the
toys are there:

   * full shell access
   * cgi
   * mod_perl
   * name based virtual host
   * full access to log files
   * and anything else we might think is cool

and it's free as in "freedom" and as is in "free beer". :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>


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

Date: 12 Oct 1998 19:51:29 GMT
From: scott@softbase.com
Subject: Re: Need help with time function
Message-Id: <36225dc1.0@news.new-era.net>

r j huntington (wolph@merlin.albany.net) wrote:

> ...but
> the third, recording the time, I'm find trickier.
> The user comes in via a remote link on the web. 

*Your* local time, or the *user's* remote time? The first can be gotten
from Perl's localtime() function, and formatted however you please.
(This is so obvious it makes me think you really want the second.) The
second is probably in an HTTP header someplace, if it isn't I don't
know how you could get it short of using JavaScript to construct a
string and pass it either as a hidden field or part of a URL.

> I'm totally confused as to how to record the time and then remove the
> ones over a certain age. 

You could just delete the log file when it gets bigger than a given
size. :)

Scott


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

Date: Mon, 12 Oct 1998 18:49:32 GMT
From: asequeir@yahoo.com
Subject: Newbie Using a variable for search/substitue options
Message-Id: <6vtivt$sba$1@nnrp1.dejanews.com>

Hi
I am trying to use a variable for search /substitue options.
Perl does not seem to allow it.
For example

 s/$pattern/$subst/g;

works, but,

 s/$pattern/$subst/$opt;

gives error. How do I make options dynamic ?

-Antony

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 12 Oct 1998 19:56:54 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: Newbie Using a variable for search/substitue options
Message-Id: <3622609F.58803173@shaw.wave.ca>

[posted & mailed]

asequeir@yahoo.com wrote:
> 
> How do I make options dynamic ?

Asked and answered.

> -----------== Posted via Deja News, The Discussion Network ==
> http://www.dejanews.com/      Search, Read, Discuss, or Start Your Own
  ^^^^^^^^^^^^^^^^^^^^^^^^      ^^^^^^  ^^^^
  Go here.                      Do this.

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: Mon, 12 Oct 1998 19:13:11 GMT
From: nospamno_adms1@cts.com (Garrett Casey)
Subject: Pack and Unpack
Message-Id: <36225480.870945683@nntp.cts.com>

Do you know of any good tutorial or lesson that goes over the pack and
unpack functions.  I looked at perlfunc but I am still a bit unclear.


Garrett Casey
nospamo_adms1@cts.com
Remove "nospamo_" To send me email.


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

Date: Mon, 12 Oct 1998 11:15:16 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Perl freezes when using special characters in HTML
Message-Id: <ku9tv6.964.ln@flash.net>

Ruud Limbeck (ruud.limbeck@tip.nl) wrote:
: On 12 Oct 1998 10:37:04 -0400, mjd@op.net (Mark-Jason Dominus) wrote:

: >Because your program has a bug.

: Here is the program:


   I don't see a shebang line anywhere.

   Are you using the -w switch (and checking STDERR output)?


: $size=$ENV{'CONTENT_LENGTH'};
: read (STDIN, $form_info, $size);

   1) You read stuff into $form_info, and then never use it.

      Why even include those two lines of code?


   2) You don't check the return value from read().

      What happens if the read() fails?


   3) You should be using CGI.pm for this anyway.



: system ('pro98.exe 111.bbx');

      You don't check the return value from system().

      What happens if the system() (or pro98.exe) fails?


: print "Content-type: text/plain", "\n\n";

   print "Content-type: text/plain\n\n";  # no need to break it into a list


: open(wrk, "111.wrk");

      You don't check the return value from open().

      What happens if the open() fails?

      What happens if 'pro98.exe' failed above and did not produce
      a file named '111.wrk'?


: while (read(wrk,$html,80)){

      ditto.


: print $html;
: }
: close(wrk);
: system ('del 111.wrk')
: exit (0);

: I can not imagine there is something wrong with it because it is
: working fine untill...... it encounters a "%"-sign while reading
: 111.wrk


   Me either.

   I think if you checked return values every once in awhile you
   might be able to localize where the problem is occuring...



--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 12 Oct 1998 19:55:53 GMT
From: scott@softbase.com
Subject: Re: Perl freezes when using special characters in HTML
Message-Id: <36225ec9.0@news.new-era.net>

Ruud Limbeck (ruud.limbeck@tip.nl) wrote:
> system ('pro98.exe 111.bbx');
> ...
> open(wrk, "111.wrk");

Are you sure:

	1. Pro908.exe has *finished* when the open call has been
	made? It is possible to start asynchronous commands. I think
	that's what system does. You should try start/w to make
	sure it is through. You might be hitting EOF on a % because
	that is as far as output has gone.

	2. Are you sure it's crashing on a %, and not an EOF character?
	Does pro98 produce binary output?

	3. Have you considered checking the return code of the open
	and read commands, and printing the $! error message?

	4. And, if you're using IIS or PWS as your web server, I have
	*NEVER* gotten system to work well. THe spawned processes
	either do nothing or lock up. There's something
	weird in the I/O redirection.

Scott


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

Date: Mon, 12 Oct 1998 19:28:38 GMT
From: raoul@xs4all.nl (Raoul)
Subject: Q: How to use a parameter on a perl script executed from HTML on Apache
Message-Id: <6vtl99$57t$1@news2.xs4all.nl>

Hi,

For some while I've been working with the Apache webserver and have used 
perl-script executions from a HTML-document like this:

<html>
 ...
<!--#exec cgi="/cgi-bin/do_something.pl"-->
 ..
</html>

The script is executed when the Apache is about to serve the page to a 
client. To make it all more flexibel I'd like to add a parameter to the script 
call, something like this:

<html>
 ...
<!--#exec cgi="/cgi-bin/do_something.pl?say_hello"-->
 ..
</html>

Unfortunately this is not understood by the Apache webserver. Does someone 
have a clue how this can be done? Thanks in advance for all your help.

Raoul Suurmeijer


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

Date: 12 Oct 1998 18:22:54 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: sorting hack
Message-Id: <6vthdu$m3e$1@client3.news.psi.net>

Xah (xah@best.com) wrote on MDCCCLXVII September MCMXCIII in
<URL:news:6vqlr2$aga$1@nntp2.ba.best.com>:
++ 
++ I have an array of arrays of the form [[a1,a2,...],[b1,b2,...],...]. I want
++ to sort them first by their digits starting from the left, then by their
++ length. For example, here's a sorted result
++ [[0], [1], [1, 0], [1, 1], [1, 1, 0], [1, 1, 1], [1, 1, 2], [1, 2], [1, 2,
++ 0], [1, 2, 1], [1, 2, 2], [2], [2, 0], [2, 1], [2, 1, 0], [2, 1, 1], [2, 1,
++ 2], [2, 2], [2, 2, 0], [2, 2, 1], [2, 2, 2]]
++ 
++ [1,1,2] comes before [1,2] because the second digit of first is smaller.
++ [1, 2] come before [1, 2, 0] because even their index comparison is neutral,
++ but the first has shorter length.
++ 
++ How would one best implement this in Perl? I couldn't figure out a way to
++ avoid a loop in the sort comparison subroutine. (I'm interested in speed
++ here.) This will be a function. The argument is not known until runtime.


You will always have a loop in the comparison routine; either directly
in your program, or somewhere behind the scenes.

Now, if we could use recursion in a sort routine, life would be easier,
but we can't. So, we use an explicit loop.


sort {my $i = 0; {return  0 if $#{$a} < $i && $#{$b} < $i;
                  return -1 if $#{$a} < $i;
                  return +1 if $#{$b} < $i;
                  $a -> [$i] <=> $b -> [$i] or do {$i ++; redo}}} @list;


Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


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

Date: Mon, 12 Oct 1998 20:39:21 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <362264f8.577591@news.ping.be>

Greg Bacon wrote:

>Top 10 Posters by Number of Posts
>=================================
>
>         (kb)   (kb)  (kb)  (kb)
>Posts  Volume (  hdr/ body/ orig)  Address
>-----  --------------------------  -------
>
>   44    61.6 ( 40.2/ 21.3/ 15.1)  Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
 ...
>Top 10 Posters by OCR (minimum of five posts)
>==============================================
>
>         (kb)    (kb)
>OCR      orig /  body  Posts  Address
>-----  --------------  -----  -------
>
>0.986  (  9.4 /  9.5)      6  baillie@my-dejanews.com
 ...

An interesting statistic would be the number of off-topic (= not
immediately Perl related) posts. Unfortunately, that's something that
cannot easily be automated...

	Bart.


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

Date: Mon, 12 Oct 1998 15:53:15 -0400
From: "Brian Owen" <BOwen@PrioritySearch.Com>
Subject: Trying to setup Perl locally:  Software Error?
Message-Id: <6vtmmr$5t7$1@news0-alterdial.uu.net>

I found in some older postings ways of running Perl locally.  I'm trying to
be able and test scripts on my machine here before posting them.  My machine
is a P-2 266 OS: NT 4.0 Mem: 64, so I don't really see a problem with it so
far.  I've d/l'ed and installed the OmniHTTPd Professional Edition, but when
I run a script I know works it returns a Software Error.  I've adjusted the
setting to try and match file locations, and believe things are set
correctly.  If anyone has had similar problems please let me know.  The
error that is occuring it is stating, "Can't tie AE Info at
C:\httpd\cgi-bin\viewJO.pl line 47. "  Is there any adjustments that need to
made to the script as well?

This is that part of the script:

tie (%aeInfo, SDBM_File, $dataPath.$aeInfoName, O_RDONLY, 0660) || die
("Can't tie AE Info");

Thanks In Advance,

Brian




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

Date: Mon, 12 Oct 1998 10:39:12 -0700
From: Andrew Perrin <aperrin@mcmahon.qal.berkeley.edu>
Subject: Re: unidirectional pipe into interactive program (passwd)
Message-Id: <36223EC0.B77CC418@mcmahon.qal.berkeley.edu>

Hmm. I believe you need a pipe character to open the pipe:

open(MY_PIPE,"| /usr/local/samba/smbpasswd") or die "Dang!";

I think I remember there's also a way to do it all on the command line with
smbpasswd, but I could be mistaken.

ap

Mikkel K. wrote:

> Hi.
>
> I need to pipe a string into an interactive program, and I thought that
> something like this could do it:
>
> open(MY_PIPE, "/usr/local/samba/smbpasswd&") or die "Dang!";
> sleep 2;
> print MY_PIPE $first_secret;
> sleep 2;
> print MY_PIPE $second_secret;
> sleep 2;
> print MY_PIPE $second_secret;
> close MY_PIPE or die "Dang2!";
>
> But this doesn't work, I get prompted for the old, new and retype
> password, and then I get a "broken pipe". Why? Do I need to redirect
> STDIN or something. It doesn't matter whether I use the "&" after the
> command.
>
> I found Expect.pm on CPAN, but partly I'm lazy, and partly I need some
> portability for my program, and I (think that I ;-) don't need the
> output from my passwd program.
>
> Can my problem be solved without Expect.pm (which definitely seems to be
> able to do it)?
>
> Thanks a lot in advance, Mikkel
>
> NB: People only in for this trick with "passwd" and not "smbpasswd" can
> use the "chpasswd"-command that comes with the unix shadow-password
> package, and there is some version of passwd that takes pipes with the
> -P option. It will take pipes.



--
-------------------------------------------------------------
Andrew J. Perrin - NT/Unix/Access Consulting -  (650)938-4740
aperrin@mcmahon.qal.berkeley.edu (Remove the Junk Mail King)
     http://www.geocities.com/SiliconValley/Grid/7544/
-------------------------------------------------------------




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

Date: 12 Oct 1998 21:07:37 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: unidirectional pipe into interactive program (passwd)
Message-Id: <83sogttx8m.fsf@vcpc.univie.ac.at>

Re: unidirectional pipe into interactive program (passwd),
Mikkel <mtk@egmont-kol.dk> said:

Mikkel> open(MY_PIPE, "/usr/local/samba/smbpasswd&") or die

You're sure that smbpasswd reads from stdin?  I suspect it
doesn't, and that it wants to play with the tty to turn off
echo etc. (guess).

Mikkel> I found Expect.pm on CPAN, but partly I'm lazy, and
Mikkel> partly I need some portability for my program, and I
Mikkel> (think that I ;-) don't need the output from my
Mikkel> passwd program.

Expect would probably do what you want.  Have you checked on
CPAN for Samba related modules?  Maybe there's canned
solution.  Or even a cpanned solution :-)

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien,  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: Mon, 12 Oct 1998 21:10:20 +0200
From: "Mikkel K." <mtk@egmont-kol.dk>
Subject: Re: unidirectional pipe into interactive program (passwd)
Message-Id: <3622541C.C86C20CC@egmont-kol.dk>

Andrew Perrin wrote:
> 
> Hmm. I believe you need a pipe character to open the pipe:
> 
> open(MY_PIPE,"| /usr/local/samba/smbpasswd") or die "Dang!";

Dang! Little easier to answer my question if I write what I really
tried. I remembered the pipe sign in my script (as above), just not in
my posting.

So thanks, but this still does not work (either ;-)

M


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

Date: 12 Oct 1998 13:08:21 -0500
From: Larry Daffner <ldaffner@rsn.hp.com>
Subject: Re: want to leave tcl for perl
Message-Id: <f5ok925mz56.fsf@rsn.hp.com>

>>>>> "PK" == Per Kistler <kistler@datacomm.ch> writes:

    PK> Hi All How do I do the following tcl thing in perl?  Handling
    PK> unix background processes in an EASY way...

    PK>     if [catch {open $process r} PROC] {
    PK>         tellUserSpez "$process failed: $PROC\n"
    PK>         return 1
    PK>     } 
    PK>     fconfigure $PROC -blocking 0 -buffering line
    PK>     fileevent  $PROC readable "showOutputInMessageWindow $PROC"

    PK> I tried in perl with forking and select. I tried the perl
    PK> expect module (a rather quirky thing). It all works, but it's
    PK> much more code.

Well, you've got several different beasts here. First of all, to
replace the first if [...] {...} block, you'd use:

open(<PROC>, "$proc |") or warn("$proc failed") && return 1;

which will either open a filehandle named PROC which will read from
the output of $proc, or print a message to stdout and return.

For the fconfigure line, I don't think that does what you think it
does. The buffering modes are controlled by the output program, not
the input program. To set nonblocking input, you'd use:

use Fcntl;
fcntl(PROC, F_SETFL, O_NONBLOCK);

The fileevent line is Tk, not tcl, so you can just translate it
directly to perl (I'll assume you're using Tk):

$main->fileevent(PROC,readable, \&showOutputInMessageWindow, PROC);

(The last 2 parameters could also be written as
  sub{showOutputInMessageWindow(PROC);} )

Putting it all together:

use Fcntl;
open(<PROC>, "$proc |") or warn("$proc failed") && return 1;
fcntl(PROC, F_SETFL, O_NONBLOCK);
$main->fileevent(PROC,readable, \&showOutputInMessageWindow, PROC);

Of course, there's details like creating $main (which is any old Tk
widget), and such, but it looks like something similar to the above is 
what you were after.

HTH
-Larry (Speaking for myself only, and not HP)

-- 
| Larry Daffner - Software Engineer | email: ldaffner@rsn.hp.com        |
|      Hewlett Packard RSSL         | #include <disclamer.h>            |
    Ray's Rule of Precision:
	Measure with a micrometer.  Mark with chalk.  Cut with an axe.


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 3955
**************************************

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