[9224] in Perl-Users-Digest
Perl-Users Digest, Issue: 2819 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 9 05:07:38 1998
Date: Tue, 9 Jun 98 02:00:37 -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 Tue, 9 Jun 1998 Volume: 8 Number: 2819
Today's topics:
'fork' on x86 port of Perl <sjackman@rogers.wave.ca>
** The Third Annual Obfuscated Perl Contest ** (Jon Orwant)
Re: Capturing STDERR <rlogsdon@io.com>
Date Manipulation <webmaster@perlsearch.hypermart.net>
Re: Field order from a Web Server (Andre L.)
Re: filenames between UNIX and win95 <ernst@eucanect.com>
Re: filenames between UNIX and win95 (Periat Henri)
Re: filenames between UNIX and win95 <robban@it-tkonsul.com>
Getting perldb to honor #line directives (Daniel E. Doherty)
How do you check an input buffer for data? <sjackman@rogers.wave.ca>
Re: Is PERL case sensitive? <rlogsdon@io.com>
Re: lambda fun in Perl (Andre L.)
Re: lambda fun in Perl <xah@shell13.ba.best.com>
Latest Perl Version (was Re: Field order from a Web Ser (Ronald J Kimball)
Re: localtime() and y2k (Craig Berry)
Looking for a script <boles@teleport.com>
Re: Looking for a script (Mike Heins)
NEED HELP: stty and the perl compiler <James@LinkedSolutions.com>
Re: offline mode? <dean@mail.biol.sc.edu>
Re: Passing arguements to interactive shell commands (Jon Orwant)
perl DBI for Empress DB ?? <goodwin@cuug.ab.ca>
perl on sunos 4.1 <justin@nectar.com.au>
Piping into telnet from Perl NT <walter@swiftech.REMOVE.THIS.net.sg>
Re: Piping into telnet from Perl NT (Martien Verbruggen)
Re: Piping into telnet from Perl NT <robban@it-tkonsul.com>
Re: print <<EOT; problems (Tad McClellan)
sparse matrix <rkerr1@geegee.une.edu.au>
Re: sparse matrix (Randy Kobes)
Re: splitting via LEADING whitespace jimbo@soundimages.co.uk
Test running PERL script in Windows 95 <jcong@ipacs.com>
Re: Web Hosting with CGI (Martien Verbruggen)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 09 Jun 1998 06:55:47 GMT
From: Shaun Jackman <sjackman@rogers.wave.ca>
Subject: 'fork' on x86 port of Perl
Message-Id: <357CDCB3.EA325C3@rogers.wave.ca>
The fork function crashes with
"The Unsupported function fork function is unimplemented"
upon use.
Is there an implementation of fork avaiable for the x86?
Thanks for your time,
Please respond by e-mail as well if possible,
Shaun Jackman
sjackman@home.com
------------------------------
Date: 09 Jun 1998 03:13:25 GMT
From: orwant@cyrano.media.mit.edu (Jon Orwant)
Subject: ** The Third Annual Obfuscated Perl Contest **
Message-Id: <ORWANT.98Jun8231325@cyrano.media.mit.edu>
The Third Obfuscated Perl Contest will be officially
announced in TPJ #10, but you can find the rules at
http://tpj.com/tpj/contest/ now.
Entries are due August 10, 1998.
Winners receive cash and trophies.
Issue #10 will be mailed later this month, featuring
these articles:
Just the FAQs: Understand References Today
Perl 5.005
Remote Access via CGI
Perl News
Threads
Parsing Command Line Options
OLE Automation with Perl
Debugging and Devel::
Learning Japanese
Ray Tracing
Infobots and Purl
-Jon
------------------------------------
Jon Orwant http://tpj.com
Editor & Publisher, The Perl Journal
--
------------------------------
Date: Tue, 9 Jun 1998 00:19:23 -0500
From: REUBEN LOGSDON <rlogsdon@io.com>
To: alex@inova.net
Subject: Re: Capturing STDERR
Message-Id: <Pine.BSI.3.96.980609001522.18703C-100000@pentagon.io.com>
[postd n mailed]
what i do is redirect stderr to a file then read it, like so:
open(STDERR,">/tmp/err") || or die "dammit, $! on write to /tmp/err";
$foo = `foo`; # <- do whatever backtick thing you want
close(STDERR);
open(X,"</tmp/err") || die "$! on read from /tmp/err";
$myErr = join('',<X>);
close(X);
print "foo returned $foo to stdout and $myErr to stderr\n";
you can also use some kind of io redirection, I think that "&>" will
redirect the error to a file.
Regards,
Reuben Logsdon
On 8 Jun 1998 alex@inova.net wrote:
> Hi,
>
> I am executing programs on my system via a script. I need to capture the output
> from these programs, but it seems to only work when the output is to STDOUT.
>
> ex.
> $grp=`groupadd mygroup`;
>
> if the group mygroup already exists a warning is sent to STDERR and is not
> caputured in my var. $grp.
>
> How would I be able to capture STDERR as well?
>
> Any help would be greatly appreciated.
>
> Alex Panagides
> Ceara, Brazil
>
> ------------------
> Spam free Usenet news http://www.newsguy.com
>
>
------------------------------
Date: Tue, 09 Jun 1998 20:49:31 -0700
From: Matt McKenzie <webmaster@perlsearch.hypermart.net>
Subject: Date Manipulation
Message-Id: <357E024B.BD377B5B@perlsearch.hypermart.net>
I'm having trouble converting a string into a nicely formatted
date.
I've tried HTTP::Date, but it will not accept the format.
I'm trying for example to convert:
980517 to 17 May 1998 or 17/May/1998
I know its not very Y2K compliant, but obviously simtel has
not cottoned on to converting their CSV file listings.
--
Matt McKenzie, Creator and Administrator
Perl Crawler - http://perlsearch.hypermart.net
http://perlsearch.fsn.net
------------------------------
Date: Mon, 08 Jun 1998 23:53:49 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Field order from a Web Server
Message-Id: <alecler-0806982353490001@dialup-784.hip.cam.org>
In article <357c0c78.0@145.227.194.253>, "Robin Smith"
<r.d.smith@man0501.wins.icl.co.uk> wrote:
> Does anyone know if it is possible to control/re-arrange the order that
> fields are passed to a perl script. I have a questionaire that has fields
>
> Q1.1, Q1.2, Q1.3, Q2.1, Q2.2, Q2.3 ...etc
>
> The perl script just writes them to a file, and they come out in the order
>
> Q1.1, Q1.2, Q2.1, Q1.3, Q2.2, Q3.1, Q1.4 ...etc
>
> I need them to be in the correct order that they appear in on the form.
> Why are they being changed??
--------
Because your data is in a hash (associative table). Key-value pairs in a
hash are kept in memory in some random order that only Larry Wall knows.
Is it safe to assume that the order that you want is the ascending order
of the numerical part of the 'QX.X'? In that case, here's the trick:
# assuming everything after 'Q' is a valid number
sub sort_my_keys {
map { $_->[0] }
sort { $a->[1] <=> $b->[1] }
map { [$_, /^Q(.*)/] } @_;
}
foreach $key (sort_my_keys(keys %data))
{
print FBFILE "$key:\n",&Fold($data{$key}),"\n\n"
unless $key =~ /ack|reject|fbdir|submit/i;
}
The sorting subroutine uses the famous Schwartzian transform; from bottom
to top: the part after the 'Q' is captured, the data is sorted on the
numbers, then the original data is returned, in the new order.
Really HTH!
A.L.
------------------------------
Date: Tue, 09 Jun 1998 03:00:16 GMT
From: "Andrew Ernst" <ernst@eucanect.com>
Subject: Re: filenames between UNIX and win95
Message-Id: <4z1f1.12$uZ4.139992@sapphire.mtt.net>
Tony,
Are you using single or double quotes?
If you use single quotes, you may find that this problem is solved.
Otherwise, give this a spin:
$newfilename =~ s!.*/!!;
$newfilename =~ s!.*\\!!;
This will remove everything but the filename.
-- Andrew
Andrew Ernst
Network Operations Manager
W3 Internet Services Ltd.
http://www.w3internet.com
------------------------------
Date: 9 Jun 1998 07:57:43 GMT
From: periat@ens.ascom.ch (Periat Henri)
Subject: Re: filenames between UNIX and win95
Message-Id: <6liptn$a6n$1@ascomax.hasler.ascom.ch>
In article <357C8DF7.DA72BA30@pobox.com>, Tony Giordano <giordano@pobox.com> writes:
>I am writing a script that gets a filename from an HTML form and then
>copies that file from the client computer (Windows) to the server
>(Solaris). By problem is that the backslashes used by Windows sometimes
>creates special characters.
>
>This filename works
>c:\directory\file.txt
>
>This doesn't work
>c:\temp\file.txt
>because the \t is sent as a tab.
>c: emp\file.txt
>
>This kind of thing happens with certain other characters also.
>
>Can anyone help me keep the characters from 'escaping ' and just use
>them as they are. (Like the difference between double and single quotes
>in UNIX shells).
>
>Thanks
>
Hi Tony
I had the same problem. I solved it by replacing all '\' in paths by
'/' (tr#\\#/#;). You can even use the UNIX paths on windows computers.
Henri
------------------------------
Date: 9 Jun 1998 08:12:14 GMT
From: "Robert Friberg" <robban@it-tkonsul.com>
Subject: Re: filenames between UNIX and win95
Message-Id: <01bd937e$25730820$c82da8c0@robban.ittek.org>
Tony Giordano <giordano@pobox.com> wrote <357C8DF7.DA72BA30@pobox.com>...
> I am writing a script that gets a filename from an HTML form and then
> copies that file from the client computer (Windows) to the server
> (Solaris). By problem is that the backslashes used by Windows sometimes
> creates special characters.
>
> This filename works
> c:\directory\file.txt
Are you sure about that?
> This doesn't work
> c:\temp\file.txt
> because the \t is sent as a tab.
> c: emp\file.txt
$filename = quotemeta $filename;
^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"
< Robert Friberg
< 'robban@it-tkonsul.com' =~ s/-(.)(.*)\./-$2$1./;
< Yet to be TC'd on c.l.p.m
------------------------------
Date: 08 Jun 1998 22:18:17 -0500
From: ddoherty@sprintmail.com (Daniel E. Doherty)
Subject: Getting perldb to honor #line directives
Message-Id: <m34sxv1cw6.fsf@slug.doherty.org>
I am using noweb to write a perl program. noweb is like Knuth's
tangle, in that it takes a noweb document and generates both a TeX
document explaining the program and a perl script that can be run.
I would like to be able to run the debugger and get it to step through
the noweb source (so I can edit in place). When I include the #line
directives in the generated perl program, the debugger does something
really weird: it steps through the dired buffer for the current
directory and never seems to associate the perl program with any
legitimate source file.
One concern I have is that I sinned and used a perl rpm package
instead of compiling perl natively. Could this possible make a
difference? Does the debugger claim to honor #line directives?
--
% Treason never prospers. % Daniel E. Doherty %
% What's the reason? % Roeland Park, KS (USA) %
% Why if treason ever prosper, % ddoherty@sprintmail.com %
% None dare call it treason. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
------------------------------
Date: Tue, 09 Jun 1998 06:53:09 GMT
From: Shaun Jackman <sjackman@rogers.wave.ca>
Subject: How do you check an input buffer for data?
Message-Id: <357CDC12.7E2ABB7C@rogers.wave.ca>
I have a section of code
#S is a socket
for(;;) {
@in = <S>;
print @in;
$out = <>;
print S $out;
}
What I want this to do is display all data received from the socket,
and then read one line of input and send it to the socket.
However, @in = <S> reads all data from the socket, and then stops,
waiting for more... which isn't going to come.
How do I set it to read all currently avaiable data from the buffer, and
continue on if no more data is currently avaiable.
Thanks for your time,
Please respond by e-mail as well if possible,
Shaun Jackman
sjackman@home.com
------------------------------
Date: Tue, 9 Jun 1998 00:03:40 -0500
From: REUBEN LOGSDON <rlogsdon@io.com>
To: Martien Verbruggen <mgjv@comdyn.com.au>
Subject: Re: Is PERL case sensitive?
Message-Id: <Pine.BSI.3.96.980609000038.18703A-100000@pentagon.io.com>
[ posted & mailed ]
sure no problem
Regards,
Reuben Logsdon
On 8 Jun 1998, Martien Verbruggen wrote:
> In article <Pine.BSI.3.96.980606193640.639B-100000@pentagon.io.com>,
> REUBEN LOGSDON <rlogsdon@io.com> writes:
> > On 5 Jun 1998, Martien Verbruggen wrote:
> >
> >> That is case sensitive. The program perl, and the language Perl are
> >> both case sensitive as well. I don't really know about PERL.
> >
> > PERL is an acroynm for "Practical Extraction and Report Language". It's
> > common practice to capitalize acronyms.
>
> Apart from the other responses you got to this: If you send a cc to
> the poster of an article on Usenet, you should mention so in both your
> post and the email. It makes it clear to the receiver that this was
> not a provate email, but rather a copy of a posted article.
>
> Martien
> --
> Martien Verbruggen |
> Webmaster www.tradingpost.com.au | I took an IQ test and the results were
> Commercial Dynamics Pty. Ltd. | negative.
> NSW, Australia |
>
>
------------------------------
Date: Mon, 08 Jun 1998 20:36:57 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: lambda fun in Perl
Message-Id: <alecler-0806982036570001@dialup-784.hip.cam.org>
In article <yo34sxw5bxp.fsf@shell13.ba.best.com>, Xah Lee
<xah@shell13.ba.best.com> wrote:
> Is there a way to create lamda function in perl? i.e. compose and apply
> arbitrary anonymous function in a line of code.
>
> For example, recently I had the question of droping elements in a list
in one line. A make-do solution supplied by someone is:
>
> splice (@{$x=[split ' ', 'a b c d e']}, -3);
>
> This is not entirely satisfactory, because $x is now a reference. I
rather want the whole thing be a value (list in this case) so I can
further manipulate it. (In Mathematica, it's done as
Function[Drop[#,{n,m}]][arbitraryListHere])
===============
What is the problem? It's easy to manipulate the data referenced to by $x:
$x->[2] = 'c'; # single element
foreach (@$x) { do_this } # whole array
(See perlref, among other useful documents.)
But if you want alternatives, all of those examples do the same thing;
some are good, some are bad, some are ugly. BTW, the specific answer to
your question is in there. Enjoy!
@x = qw/a b c d e/;
splice (@x, -3);
@x = (split /\s+/, 'a b c d e')[-5..-4];
@x = @{[ split /\s+/, 'a b c d e' ]}[-5..-4];
@x = ('a b c d e' =~ /\w+/g)[0..1];
@x = (map { chr() } 97..122)[-26,-25];
@x = (qw/a b c d e/)[0..$#{[qw/a b c d e/]}-3];
@x[0..1] = 'a'..'e';
@x = 'a'..'e', splice @x, -3;
@x = split(/\s+/, 'a b c d e') and splice(@x, -3);
@x = map { @$_[0..$#$_-3] } ['a'..'e'];
@x = sub { splice(@_, -3); @_ } -> (split /\+/, 'a+b+c+d+e');
Conclusion: sometimes, maybe two lines are better than one. :-)
A.L.
------------------------------
Date: 09 Jun 1998 01:19:12 -0700
From: Xah Lee <xah@shell13.ba.best.com>
Subject: Re: lambda fun in Perl
Message-Id: <yo33edf2dj3.fsf@shell13.ba.best.com>
Thanks to Randal Schwartz. A follow up question.
Is there a way to sequence pure functions without
using a nesting notation such as the following?
sub{sort @_;} ->
(sub{map {$_/2} @_;}->
( sub {reverse @_;}->
( sub {map {$_ *2} @_; } ->
(1..4))));
(it won't work without the crazy parenthesis a la lisp.)
In Mathematica, one can write f[g[h]] as f@g@h or h//g//f.
Xah, xah@best.com
http://www.best.com/~xah/Wallpaper_dir/c0_WallPaper.html
"Perl: all unix's stupidity in one."
Randal Schwartz <merlyn@stonehenge.com> writes:
> Xah> Is there a way to create lamda function in perl? i.e. compose and
> Xah> apply arbitrary anonymous function in a line of code.
>
> Here's one way (requires a modern Perl):
>
> sub { print "@_"; } -> (sort qw(b c d a));
>
> In this, the anon func that prints its args within a double-quoted
> string context (causing spaces between elements) is handed the args of
> the result of sort. You can use the result from the func further.
------------------------------
Date: Mon, 8 Jun 1998 23:58:40 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Latest Perl Version (was Re: Field order from a Web Server)
Message-Id: <1dabt8o.ydeyo51vol9a8N@bay1-473.quincy.ziplink.net>
Jonathan Stowe <Gellyfish@btinternet.com> wrote:
> I would seriously recommend upgrading that Perl - the latest
> "standard" distribution is at 5.004.02.
I believe you mean 5.004_04. Looks like he's not the only one who needs
to upgrade. :-)
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 9 Jun 1998 05:56:28 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: localtime() and y2k
Message-Id: <6liiqc$rba$1@marina.cinenet.net>
Chris (chris@bcadventure.com) wrote:
: The perl script command:
: localtime(time)
:
: Will give a 2 digit date,
No, it gives a year value offset by -1900; that is, it returns 98, 99,
100, and 101 for 1998, 1999, 2000, and 2001 respectively.
: several small scripts I have seen in this newsgroup
: simply add 1900 to the year and say it is y2k compliant.
And do so quite accurately.
: Am I missing something here?
Yes; you saw 2-digit dates from localtime() for years preceding 2000, and
mistakenly generalized this to infer that dates 2000 and beyond would also
be returned as 2 digits. This is incorrect.
: Is there a better way to get the local year in a 4 digit format?
Depends on your definition of 'better' I suppose, and where the year is
coming from. Adding 1900 to the year field of localtime is certainly
common, simple, and correct in this application.
: I could use the epoch format but that is added script lines and I am
: trying to keep my script small.
Not sure what you mean by this.
: Do you know of a fix for this?
I don't even know of a broken for this. :-)
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Tue, 09 Jun 1998 04:43:47 GMT
From: Erik <boles@teleport.com>
Subject: Looking for a script
Message-Id: <357CBDC8.3375@teleport.com>
I hope I have posted i nthe appropriate NG, if not I apologize. I have
seen other sites that have a section that allows you to look up a domain
name and see if it is available via internic.net but I cannot find the
script anywhere, does anyone have any ideas on where I can get this
script to put in my CGI-BIN?? ANY help greatly appreciated.
_E
------------------------------
Date: 9 Jun 1998 01:14:30 -0500
From: mikeh@minivend.com (Mike Heins)
Subject: Re: Looking for a script
Message-Id: <357cc4b6.0@news.one.net>
Erik <boles@teleport.com> wrote:
> I hope I have posted i nthe appropriate NG, if not I apologize. I have
> seen other sites that have a section that allows you to look up a domain
> name and see if it is available via internic.net but I cannot find the
> script anywhere, does anyone have any ideas on where I can get this
> script to put in my CGI-BIN?? ANY help greatly appreciated.
Screeepts? SCREEEPTS??!!!?? We got no steenking screepts here mon.
Try next door.
[with apologies to whomever they are due]
------------------------------
Date: Tue, 09 Jun 1998 00:13:59 -0700
From: "James W. Thornton" <James@LinkedSolutions.com>
To: james@comp4ncr.com
Subject: NEED HELP: stty and the perl compiler
Message-Id: <6lig37$4m8$1@gte2.gte.net>
--------------DE2AD8AC1009F1AD16B6D196
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I have setup the perl compiler and successfully compiled several
programs. However, the following bit of code doesn't execute correctly
when translated to C and then compiled.
#system "clear";
print "login: ";
$un = <STDIN>;
chop ($un);
system "stty -echo";
print "Password: ";
chop($pw = <STDIN>);
print "\n";
system "stty echo";
When I run the compiled executable, I get the login prompt...but after I
enter the username and hit enter, the program quits w/o prompting me for
the password.
If I recode the password section to be:
print "Password: ";
system "stty -echo";
chop($pw = <STDIN>);
print "\n";
system "stty echo";
...then I get the Password prompt, but after I enter the password and
hit enter, the program quits prematurely.
Both of the previous segments of code work correctly as an uncompiled
perl program.
Any ideas on why this is not working when translated to C and compiled?
My system info:
OS: Red Hat Linux 5.x
Perl Version: 5.00401
Thanks,
--James
--------------DE2AD8AC1009F1AD16B6D196
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
<TT>I have setup the perl compiler and successfully compiled several programs.
However, the following bit of code doesn't execute correctly when translated
to C and then compiled.</TT>
<BR><TT></TT>
<BLOCKQUOTE><TT>#system "clear";</TT></BLOCKQUOTE>
<BLOCKQUOTE><TT>print "login: ";</TT>
<BR><TT>$un = <STDIN>;</TT>
<BR><TT>chop ($un);</TT><TT></TT>
<P><TT>system "stty -echo";</TT>
<BR><TT>print "Password: ";</TT>
<BR><TT>chop($pw = <STDIN>);</TT>
<BR><TT>print "\n";</TT>
<BR><TT>system "stty echo";</TT>
<BR><TT></TT> </BLOCKQUOTE>
<TT>When I run the compiled executable, I get the login prompt...but after
I enter the username and hit enter, the program quits w/o prompting me
for the password.</TT><TT></TT>
<P><TT>If I recode the password section to be:</TT>
<BR><TT></TT>
<BLOCKQUOTE><TT>print "Password: ";</TT>
<BR><TT>system "stty -echo";</TT>
<BR><TT>chop($pw = <STDIN>);</TT>
<BR><TT>print "\n";</TT>
<BR><TT>system "stty echo";</TT></BLOCKQUOTE>
<TT></TT>
<P><TT>...then I get the Password prompt, but after I enter the password
and hit enter, the program quits prematurely.</TT><TT></TT>
<P><TT>Both of the previous segments of code work correctly as an uncompiled
perl program.</TT><TT></TT>
<P><TT>Any ideas on why this is not working when translated to C and compiled?</TT><TT></TT>
<P><TT>My system info:</TT>
<BR><TT></TT>
<BLOCKQUOTE><TT>OS: Red Hat Linux 5.x</TT>
<BR><TT>Perl Version: 5.00401</TT>
<BR><TT></TT> </BLOCKQUOTE>
<TT>Thanks,</TT><TT></TT>
<P><TT>--James</TT></HTML>
--------------DE2AD8AC1009F1AD16B6D196--
------------------------------
Date: 08 Jun 1998 18:23:46 -0400
From: Dean Pentcheff <dean@mail.biol.sc.edu>
Subject: Re: offline mode?
Message-Id: <m3k96r5y8d.fsf@mail.biol.sc.edu>
Tom Christiansen <tchrist@mox.perl.com> writes:
> In comp.lang.perl.misc,
> kahuna@panix.com writes:
> :Of course, the answer to my non-existent question is that tcp acts
> :the same under either language. As could a CGI under either
> :language.
>
> Don't you mean "a TCP acts the same"?
[Speaking for myself, not kahuna...]
Of course not. Any transmission control protocol could potentially
act the same way, just as could any old common gateway interface.
Or did you assume some particular transaction control protocol or
common gateway interface?
-Dean
--
N. Dean Pentcheff <pentcheff@acm.org>
Biological Sciences, Univ. of South Carolina, Columbia SC 29208 (803-777-7068)
------------------------------
Date: 09 Jun 1998 03:55:49 GMT
From: orwant@cyrano.media.mit.edu (Jon Orwant)
To: Joe Novielli <jnoviell@matrox.com>
Subject: Re: Passing arguements to interactive shell commands
Message-Id: <ORWANT.98Jun8235549@cyrano.media.mit.edu>
Joe Novielli <jnoviell@matrox.com> writes:
Is there a way I can pass the answers to interactive shell commands from
a PERL script?
e.g.: answering the command "rm -i filename" (interactive removal which
prompts for a "yes" or "no" answer.)
OR the thing I would like to do
e.g.: submitting new web users and their passwords by a PERL CGI script
by executing Apache's "htpasswd" utility.
Lincoln Stein has an article about exactly this topic in the upcoming
issue (#10) of The Perl Journal. In short: have your CGI script use
chat2.pl or Comm.pl to communicate with your shell.
-Jon
------------------------------------
Jon Orwant http://tpj.com
Editor & Publisher, The Perl Journal
--
------------------------------
Date: Tue, 09 Jun 1998 06:13:37 GMT
From: Rob Goodwin <goodwin@cuug.ab.ca>
Subject: perl DBI for Empress DB ??
Message-Id: <357CD2EE.9082D5D@cuug.ab.ca>
Hi there,
The company that I am working with right now is considering a using
Empress as the engine to run a medium scale cgi application. Does
anyone know of any issues aconcerning the DBI they have created?
Anyone using it and happy with it?
Thanks,
Rob
------------------------------
Date: Tue, 09 Jun 1998 15:41:50 +1000
From: Justin Wills <justin@nectar.com.au>
Subject: perl on sunos 4.1
Message-Id: <357CCB1E.6EA77115@nectar.com.au>
I don't seem to be able to get it to build at all. anybody got a
pointer to an installable binary ?????
--
Regards,
Justin Wills
justin@nectar.com.au
------------------------------
Date: Tue, 9 Jun 1998 13:55:49 +0800
From: "Walter Klomp" <walter@swiftech.REMOVE.THIS.net.sg>
Subject: Piping into telnet from Perl NT
Message-Id: <357ccf20.0@news.swiftech.com.sg>
Hi Guys,
I am trying to write a small script which opens a telnet session and sends
some commands. With the
open (TELNET,"| telnet hostname port") || die "Cannot Fork!\n";
I am not very successful. It opens the telnet program, but successively
doesn't pipe into it the commands I want to send to it.
Anybody did this already successfully on a WinNT box or Win95 box ?
Any help appreciated.
Regards
Walter
------------------------------
Date: 9 Jun 1998 06:52:48 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Piping into telnet from Perl NT
Message-Id: <6lim40$jcb$2@comdyn.comdyn.com.au>
In article <357ccf20.0@news.swiftech.com.sg>,
"Walter Klomp" <walter@swiftech.REMOVE.THIS.net.sg> writes:
> Hi Guys,
You don't want women to answer, hmm?
> open (TELNET,"| telnet hostname port") || die "Cannot Fork!\n";
Don't do this. use Net::Telnet.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au |
Commercial Dynamics Pty. Ltd. | Curiouser and curiouser, said Alice.
NSW, Australia |
------------------------------
Date: 9 Jun 1998 07:58:34 GMT
From: "Robert Friberg" <robban@it-tkonsul.com>
Subject: Re: Piping into telnet from Perl NT
Message-Id: <01bd937c$38dedf80$c82da8c0@robban.ittek.org>
Walter Klomp <walter@swiftech.REMOVE.THIS.net.sg> wrote
> Hi Guys,
>
> I am trying to write a small script which opens a telnet session and
sends
> some commands. With the
>
> open (TELNET,"| telnet hostname port") || die "Cannot Fork!\n";
>
> I am not very successful. It opens the telnet program, but successively
> doesn't pipe into it the commands I want to send to it.
telnet.exe won't read STDIN, you might find some freeware console app
that will but better yet, use the Net::Telnet module.
^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"^"
< Robert Friberg
< 'robban@it-tkonsul.com' =~ s/-(.)(.*)\./-$2$1./;
< Yet to be TC'd on c.l.p.m
------------------------------
Date: Mon, 8 Jun 1998 23:18:30 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: print <<EOT; problems
Message-Id: <m2dil6.2h4.ln@localhost>
David Sanders (dsanders@netxchange.com) wrote:
: angst wrote in message <6lhgbn$qld$1@jelerak.scrye.com>...
: >Please read the newsgroup before posting...this question was answered
: >just yesterday.
: I try to always read previous ng posts to see if my questions have
: already been asked. I didn't find this one.
from 'perldata':
A line-oriented form of quoting is based on the shell "here-doc"
syntax.
...
The terminating string must appear by itself (unquoted and with no
surrounding whitespace) on the terminating line.
How 'bout that?
The answer was right there on your HD all along...
;-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 09 Jun 1998 05:22:40 +0200
From: Richard Kerr <rkerr1@geegee.une.edu.au>
Subject: sparse matrix
Message-Id: <yy1yav7ntrz.fsf@geegee.une.edu.au>
Has anyone used perl to create a sparse matrix ? Does the module Math:
cover sparse matrices ?
If anyone has some useful code, I would appreciate it very much
Thanks
Richard
------------------------------
Date: 9 Jun 1998 03:50:27 GMT
From: randy@theory.uwinnipeg.ca (Randy Kobes)
Subject: Re: sparse matrix
Message-Id: <slrn6npcln.g3r.randy@theory.uwinnipeg.ca>
On 09 Jun 1998 05:22:40 +0200, Richard Kerr <rkerr1@geegee.une.edu.au> wrote:
>
>Has anyone used perl to create a sparse matrix ? Does the module Math:
>cover sparse matrices ?
>
>If anyone has some useful code, I would appreciate it very much
>
>Thanks
>Richard
Hi,
The modules Math::Matrix, Math::MatrixBool, and Math::MatrixReal
on CPAN handle general matrices of the indicated type, which includes
sparse matrices. They all have ways to populate a matrix by whatever
values you want. However, it doesn't appear that they recognize sparse
matrices specifically, where particularly efficient methods exist for
multiplication, inversion, etc. But unless your matrices are very
large, this might not be too bad.
Best regards,
Randy Kobes
--
Physics Department Phone: (204) 786-9399
University of Winnipeg Fax: (204) 774-4134
Winnipeg, Manitoba R3B 2E9 e-mail: randy@theory.uwinnipeg.ca
Canada http://theory.uwinnipeg.ca/
------------------------------
Date: 09 Jun 1998 07:27:20 +0100
From: jimbo@soundimages.co.uk
Subject: Re: splitting via LEADING whitespace
Message-Id: <upvgjum2f.fsf@JIMBOSNTSERVER.i-have-a-misconfigured-system-so-shoot-me>
sdinitto@kronos.com (Scott DiNitto) writes:
> Anyways, what I am trying to do is assign each field to an array. For
> example. Let's assume $tableScalar holds the third line of the ascii
> file. So far, I am doing:
>
> @tableArray = split (/ +/, $tableScalar);
>
> this gives me the result:
>
> @tableArray[0] "John"
> @tableArray[1] "Doe"
> @tableArray[2] "6-3-98"
> @tablearray[3] "10:11"
> @tableArray[4] "This"
> @tableArray[5] "is"
> @tableArray[6] "a"
> @tableArray[7] "message"
>
> Now, as far as I know I did a split using leading whitespace as the
> delimiter... right?
> Does anyone know the best way to perform a split and have the fields
> assigned the way I want it?
Yes. Read the documentation for split and you will see you can
specify the number of fields you want to split into. Set this
limit to 5 and, as you would expect, you will now have the five
fields you require.
@tableArray = split (/ +/, $tableScalar, 5);
^^^
Sorry, but as it is always said here, RTFM. It is in there, in
black and white. In perlfunc. Try 'perldoc -f split'.
HTH.
Jim Brewer
------------------------------
Date: Tue, 09 Jun 1998 16:54:22 +0800
From: Ong Joo Chin <jcong@ipacs.com>
Subject: Test running PERL script in Windows 95
Message-Id: <357CF83E.78E24BD1@ipacs.com>
Currently, I am writing my PERL CGI script in my Windows 95 machine
follow by FTP to the remote site. In this way, I can't test out my
script. Can anybody advise me how to write PERL script and test run in
my Window 95 machine with Netscape browser before FTP to the remote
site.
------------------------------
Date: 9 Jun 1998 06:54:58 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Web Hosting with CGI
Message-Id: <6lim82$jcb$4@comdyn.comdyn.com.au>
In article <6li5b8$10i2$1@news.gate.net>,
"John Jeevers" <jj239733@aol.com> writes:
^^^
And people wonder why AOL has a bad name.
> Has anyone heard of the the following 2 Web Hosting providers. Can anyone
> tell me anything about them.
>
> PremierSite http://www.premiersite.com
> Cybergate http://www.gate.net
>
> Any information would be greatly appreciated. Specially if they can run cgi
> scripts.
Why are you asking us? Why don't you ask them? I really don't
understand where you ever got the idea that this question had anything
at all to do with perl. Since you provide the URLs to their sites, go
there. Read. Send email to them. Don't post here.
Sheesh
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd. | cynical. It's perfectly easy to be
NSW, Australia | cynical.
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.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 2819
**************************************