[17304] in Perl-Users-Digest
Perl-Users Digest, Issue: 4726 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 25 21:05:34 2000
Date: Wed, 25 Oct 2000 18:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <972522311-v9-i4726@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 25 Oct 2000 Volume: 9 Number: 4726
Today's topics:
Re: [Newbie]: Perl and Cron <ianb@ot.com.au>
ANNOUNCE: Text::Autoformat 1.03 (Damian Conway)
Confused about behavior of sort command with function r (Thomas M. Payerle)
Re: headword search <elephant@squirrelgroup.com>
Re: IO::Socket, HTTP POST vs. GET <jihad.battikha@sharewire.com>
Linux: Perl readline... <fe8x025@public.uni-hamburg.de>
Re: Linux: Perl readline... (Martien Verbruggen)
Malformed header resulting from use of mkdir() <secursrver@hotmail.com>
Re: numbering matches drtsq@my-deja.com
Re: numbering matches <All@n.due.net>
object oriented Perl consultant needed kathlenew@my-deja.com
object oriented Perl consultant needed kathlenew@my-deja.com
Re: Oracle Script File (Malcolm Dew-Jones)
Re: Passing data to a script(from a form) <elephant@squirrelgroup.com>
Re: Perl DBI installation <hxshxs@my-deja.com>
Re: Perl extension in C on Win98 <Jonathan.L.Ericson@jpl.nasa.gov>
Re: Perl extension in C on Win98 <david@nomail.please>
Perl on NT <fe8x025@public.uni-hamburg.de>
Re: Perl on NT <adalessandro@odione.com>
Re: Perl on NT (Martien Verbruggen)
Perl, CGI and rsh/rcp in Unix <jcipale@hotmail.com>
Re: socket flushing problem <bomr@lin01.triumf.ca>
Re: Spaces to tab <Jonathan.L.Ericson@jpl.nasa.gov>
Re: Spaces to tab <skuo@mtwhitney.nsc.com>
Re: Spaces to tab <lr@hpl.hp.com>
usenet to web gateway <jk@sinatra.inka.de>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 26 Oct 2000 11:02:51 +1100
From: Ian Boreham <ianb@ot.com.au>
Subject: Re: [Newbie]: Perl and Cron
Message-Id: <39F774AB.8CF384DE@ot.com.au>
Sébastien Ferrandez wrote:
> Thanks for anybody's kind piece of advice but unfortunately I get the same
> error messages...argh ! going crazy on that one ! :)
Is there more in the error message? I must admit I've never seen that exact
one.
When your cron job is run, can it find your "use"d modules in @INC? Maybe the
environment is different. Is the cron job being run as the same user? (I
normally get different errors for this problem, but your version of perl
might not be the same as mine. What is it, incidentally?)
Try a simple script that just prints @INC, and also does a "find" for the
modules you require in that list.
Regards,
Ian
------------------------------
Date: 25 Oct 2000 23:15:55 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: ANNOUNCE: Text::Autoformat 1.03
Message-Id: <svernco0aj6471@corp.supernews.com>
Keywords: perl, module, release
==============================================================================
Release of version 1.03 of Text::Autoformat
==============================================================================
NAME
Text::Autoformat - Automatic and manual text wrapping and reformating
DESCRIPTION
Text::Autoformat provides intelligent formatting of
plaintext without the need for any kind of embedded mark-up. The module
recognizes Internet quoting conventions, a wide range of bulleting and
number schemes, centred text, and block quotations, and reformats each
appropriately. Other options allow the user to adjust inter-word
and inter-paragraph spacing, justify text, and impose various
capitalization schemes.
The module also supplies a re-entrant, highly configurable replacement
for the built-in Perl format() mechanism.
AUTHOR
Damian Conway (damian@conway.org)
COPYRIGHT
Copyright (c) 1997-2000, Damian Conway. All Rights Reserved. This module
is free software. It may be used, redistributed and/or modified under
the terms of the Perl Artistic License (see
http://www.perl.com/perl/misc/Artistic.html)
==============================================================================
CHANGES IN VERSION 1.03
- Tweaked test.pl and POD
- required 5.005
(module uses funky stuff that's broken in earlier perls - sorry Dave)
- added break_TeX subroutine to take advantage of TeX::Hyphen
if it's installed.
- documented "sticky" config mode
- Changed semantics of footer generation slightly (see doc)
- fixed niggle in widow handling under full justification
- Added pagenum option to control page numbering
- Added three-part hash specification option for headers and footers
(thanks Chaim)
- Added separator handling to autoformat -- also fixes
underlining of heading (thanks very much Simon)
==============================================================================
AVAILABILITY
Text::Autoformat has been uploaded to the CPAN
and is also available from:
http://www.csse.monash.edu.au/~damian/CPAN/Text-Autoformat.tar.gz
==============================================================================
------------------------------
Date: 25 Oct 2000 19:36:03 -0400
From: payerle@Glue.umd.edu (Thomas M. Payerle)
Subject: Confused about behavior of sort command with function returning list
Message-Id: <8t7qp3$j1t@bofh.physics.umd.edu>
Keywords: perl sort
I encountered some rather unexpected behavior from Perl's sort command when
trying to sort the return values of a subroutine returning a list. Since
the perl language interface is usually quite intuitive, I was wondering if
someone could enlighten me as to perl is not behaving as I would have
expected (or alternatively, why I should have been expecting what it did:)
A small sample code snippet below:
----------------------------------------------
sub get_list ()
{ return ( "a", "b", "d", "c" );
}
sub print_list (@)
{ my @list=@_;
my $str = join " ", @list;
print "$str\n";
}
my @list1 = get_list;
print "list1: "; print_list @list1;
print "sort(list1): "; print_list sort(@list1);
print "get_list: "; print_list get_list;
my @list2 = sort(get_list); #Why doesn't this work???
print "\nlist2=sort(get_list)\n";
print "list2: "; print_list @list2;
print "sort(get_list): "; print_list sort(get_list);
@list2 = sort(get_list()); #Why doesn't this work???
print "\nlist2=sort(get_list())\n";
print "list2: "; print_list @list2;
print "sort(get_list()): "; print_list sort(get_list());
@list2 = sort(&get_list);#Why does this work???
print "\nlist2=sort(\&get_list)\n";
print "list2: "; print_list @list2;
print "sorted(\&get_list): "; print_list sort(&get_list);
---------------------------------------------------------------
which produces the output
list1: a b d c
sort(list1): a b c d
get_list: a b d c
list2=sort(get_list)
list2: get_list
sort(get_list): get_list
list2=sort(get_list())
list2:
sort(get_list()):
list2=sort(&get_list)
list2: a b c d
sorted(&get_list): a b c d
I would have expected the line
@list2=sort(get_list) to result in @list2 containing ("a","b","c","d"), not
"get_list". I am also baffled as to the result of adding empty parentheses
to make get_list look more like a function call, or why putting the & before
the subroutine name makes it work.
I'm guessing it has something to do with the optional comparison subroutine/
block for sort, but was wondering if anyone would be kind enough to help
me understand more clearly what is going on here?
Thanks in advance.
--
Tom Payerle
Dept of Physics payerle@physics.umd.edu
University of Maryland (301) 405-6973
College Park, MD 20742-4111 Fax: (301) 314-9525
------------------------------
Date: Thu, 26 Oct 2000 11:55:53 +1000
From: jason <elephant@squirrelgroup.com>
Subject: Re: headword search
Message-Id: <MPG.146239f797f3f2d989854@localhost>
[ removed the defunct comp.lang.perl newsgroup ]
AndreasKleiner wrote ..
>I have a program which takes multi-line input and produces multi-line
>output. I have to run it in the background - as it compiles some info
>into the memory which takes some seconds - and now and then feed it with
>input and read and interpret the output - with some perl-skript of
>course.
>
>Under which headwords do I have to look for a solution:
start with perlipc .. it gives you a bunch of options depending on your
precise requirements
perldoc perlipc
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Wed, 25 Oct 2000 19:00:26 -0400
From: Jihad Battikha <jihad.battikha@sharewire.com>
Subject: Re: IO::Socket, HTTP POST vs. GET
Message-Id: <39F7660A.5F634658@sharewire.com>
> ...the $client socket seems to block and I'm never able to grab the
> POST data (I'm testing with MSIE and NN)...
More info about problem:
I noticed that while the $client handle/socket is blocked waiting to
suck in the POST entity header (the encoded POST data), if I hit the
"STOP" button on the browser, the data finally arrives but, of course,
is not useful since the browser is no longer waiting for a response and
the connection is closed.
--
Jihad Battikha <jihad.battikha@sharewire.com>
Sharewire, Inc. --- http://www.sharewire.com/
- Free forms, programs, and content for web sites.
- No assembly required.
Disclaimer:
Before sending me commercial e-mail, the sender must first agree
to my LEGAL NOTICE located at: http://www.highsynth.com/sig.html
------------------------------
Date: Thu, 26 Oct 2000 02:12:05 +0200
From: Alex Fitterling <fe8x025@public.uni-hamburg.de>
Subject: Linux: Perl readline...
Message-Id: <lss7t8.861.ln@sokrates2.hagenbeck.uni-hamburg.de>
Hi
I don't know what's going wrong.. (maybe you could tell me)
I have a perlscript which should read a file line by line.
So I do:
open the file with...
open(TEST,"<file.txt")
and do somekind of
$LINE=readline(FILE); #where FILE is a file handle
so each repetition of line above, should go one line further
and $LINE should differ than, depend on each entry on every line... bu
it didn't work... what is wrong ? Is the way I open the file not legal
? hm...
tia,
Alex
------------------------------
Date: Thu, 26 Oct 2000 00:33:52 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Linux: Perl readline...
Message-Id: <slrn8veuvd.a0g.mgjv@verbruggen.comdyn.com.au>
On Thu, 26 Oct 2000 02:12:05 +0200,
Alex Fitterling <fe8x025@public.uni-hamburg.de> wrote:
> Hi
>
> I don't know what's going wrong.. (maybe you could tell me)
I don't think I can. I can give you some pointers to find out yourself
though, and maybe fix the code that you aren't showing us.
> I have a perlscript which should read a file line by line.
\begin[pick]{nit}
Perl program or Perl script. The language is called Perl, the program
that compiles and runs the sources is called perl.
# perldoc perlfaq1
\end{nit}
> open the file with...
>
> open(TEST,"<file.txt")
open(TEST, 'file.txt') or die "Cannot open file.txt: $!";
Always check the success of open(), and most other system calls. The <
is superfluous, and I just happen to like single quotes in this
context (where there is no interpolation) better. Others disagree with
me on that.
> and do somekind of
>
> $LINE=readline(FILE); #where FILE is a file handle
While readline is fine, most people programming in Perl tend to use
the diamond operator <>. as the readline documentation states:
# perldoc -f readline
[snip]
This is the internal function implementing the
`<EXPR>' operator, but you can use it directly.
The `<EXPR>' operator is discussed in more detail
in the I/O Operators entry in the perlop manpage.
$line = <STDIN>;
$line = readline(*STDIN); # same thing
Which looks better to you?
while (<TEST>)
{
# Do something with $_
}
or
while (my $line = <TEST>)
{
# do something with $line
}
close TEST;
You may also want to read:
# perldoc perlop
(section on I/O operators)
# perldoc -f chomp
# perldoc perlsysn
(describes while)
# perldoc -f open
# perldoc -f close
in fact, browse through the whole of the function list:
# perldoc perlfunc
And as well:
# perldoc perldoc
# perldoc perl
# perldoc perlfaq
# perldoc perltoc
If you really want to use readline:
open(TEST, 'data') or die $!;
while (my $line = readline TEST)
{
print $line;
}
close TEST;
Martien
--
Martien Verbruggen |
Interactive Media Division | Unix is the answer, but only if you
Commercial Dynamics Pty. Ltd. | phrase the question very carefully
NSW, Australia |
------------------------------
Date: Thu, 26 Oct 2000 00:57:03 GMT
From: "Ed Grosvenor" <secursrver@hotmail.com>
Subject: Malformed header resulting from use of mkdir()
Message-Id: <zjLJ5.24854$rD3.1657245@newsread2.prod.itd.earthlink.net>
Hi. I'm having a little problem with mkdir in Apache on Windoze 98. Yeah,
I know, but I share this computer with my brother and he didn't like
Slackware very much. Anyway, here's what I'm doing:
$dir is dynamically assigned based on user input.
print("mkdir() ", mkdir("$dir", 0777), "\n");
As a result I get an error saying:
Malformed header from script. Bad header=mkdir() 1
The same thing happens with chdir(). The strange thing is that the script
actually works. The directory is created and the file that is to be created
later in the script is created within that directory. Unfortunately, I get
this error. What I'm wondering is if there is any way to get Perl (or
Apache...or Windows...whichever entity has such a problem with this funtion)
to ignore the malformed header.
So you know, this is a CGI script called from a Web form. The script is
supposed to then perform this action (create a directory and a file within
it) and then generate the HTML form that will allow the user to edit the
file within the new directory.
The script works other than the error. My debugger doesn't catch anything
on it and I could swear I'm doing everything right. If anyone has any
ideas, please, please let me know. I would appreciate it. Have a great
day!
------------------------------
Date: Wed, 25 Oct 2000 23:22:58 GMT
From: drtsq@my-deja.com
Subject: Re: numbering matches
Message-Id: <8t7q0b$810$1@nnrp1.deja.com>
Thank you everyone!
In article <WYEJ5.144$7rc.170962432@news.frii.net>,
cfedde@fedde.littleton.co.us (Chris Fedde) wrote:
> In article <8t70ve$gtf$1@nnrp1.deja.com>, <drtsq@my-deja.com> wrote:
> >I am trying to number matches in a string, by that I mean I want to
insert a
> >number prior to each match. So, given $animals="dog cat rat cat
mouse llama
> >cat cat rat", and if I want to number each "cat" I'd end up with
> >$animals="dog 1) cat rat 2) cat mouse llama 3) cat 4) cat rat". The
nearest
> >FAQs I could find was in perlfaq4 was "How do I change the Nth
occurrence of
> >something?" and "How can I count the number of occurrences of a
substring
> >within a string?" but thats not really what I want. Any suggestions?
> >Thanks...
> >
>
> $animals="dog cat rat cat mouse llama cat cat rat\n";
> $animals =~ s/(cat)/++$i.") $1"/eg;
> print $animals;
>
> yealds
>
> dog 1) cat rat 2) cat mouse llama 3) cat 4) cat rat
>
> hth
> --
> This space intentionally left blank
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 26 Oct 2000 00:14:47 GMT
From: "Allan M. Due" <All@n.due.net>
Subject: Re: numbering matches
Message-Id: <XHKJ5.36242$P82.4722429@news1.rdc1.ct.home.com>
"Allan M. Due" <Allan@due.net> wrote in message
news:8t780q$80q$1@slb1.atl.mindspring.net...
: <drtsq@my-deja.com> wrote in message news:8t70ve$gtf$1@nnrp1.deja.com...
: : I am trying to number matches in a string, by that I mean I want to insert
a
: : number prior to each match. So, given $animals="dog cat rat cat mouse
llama
: : cat cat rat", and if I want to number each "cat" I'd end up with
: : $animals="dog 1) cat rat 2) cat mouse llama 3) cat 4) cat rat". The
nearest
: : FAQs I could find was in perlfaq4 was "How do I change the Nth occurrence
: of
: : something?" and "How can I count the number of occurrences of a substring
: : within a string?" but thats not really what I want. Any suggestions?
:
: my %count;
: my $animals="dog cat rat cat mouse llama cat cat rat catamount";
:
: @count{split(/ /,$animals)} = map 1,split(/ /,$animals);
: $animals =~ s/ (cat)(?= )/' '.$count{$1}++.")$1"/eg;
: print $animals;
:
: just to make it a tad more generic, leaving first and last animals as an
: exersize for the OP.
Meanwhile, back at the ranch......
it occurs to me, duh, what's with all that. Lets just do:
my (%count);
my $animals="dog cat rat cat mouse llama cat cat rat catamount";
$animals =~ s/ (cat|rat)(?= )/' '.++$count{$1}.")$1"/eg;
print $animals;
if that was what the OP wanted, which I don't know. So, on with the
show......
AmD
--
$email{'Allan M. Due'} = ' All@n.Due.net ';
--Random Quote--
'Where such things here as we do speak about? Or have we eaten on the insane
root that takes the reason prisoner?'
Banquo in MacBeth
------------------------------
Date: Wed, 25 Oct 2000 22:02:16 GMT
From: kathlenew@my-deja.com
Subject: object oriented Perl consultant needed
Message-Id: <8t7l92$3ve$1@nnrp1.deja.com>
Object Oriented Perl programmer needed for
contract position (4+ months) for wireless
project. Location in Portland, OR:
Senior Perl Developer needed to assist in the
enhancements of existing Web and Wireless
products. The ideal candidate will have the
following skills: OO Perl (not Perl scripting),
HTML, CSS, JavaScript, Oracle, SQL, DBI, Unix
(Solaris), HDML, WML is a plus.
Please e-mail Kathlene at kwhinnery@prodx.com
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 25 Oct 2000 22:02:16 GMT
From: kathlenew@my-deja.com
Subject: object oriented Perl consultant needed
Message-Id: <8t7l94$3vf$1@nnrp1.deja.com>
Object Oriented Perl programmer needed for
contract position (4+ months) for wireless
project. Location in Portland, OR:
Senior Perl Developer needed to assist in the
enhancements of existing Web and Wireless
products. The ideal candidate will have the
following skills: OO Perl (not Perl scripting),
HTML, CSS, JavaScript, Oracle, SQL, DBI, Unix
(Solaris), HDML, WML is a plus.
Please e-mail Kathlene at kwhinnery@prodx.com
Posted 10/25/00--please consider not valid after
11/8/00
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 25 Oct 2000 15:56:49 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Oracle Script File
Message-Id: <39f76531@news.victoria.tc.ca>
Erik van Roode (newsposter@cthulhu.demon.nl) wrote:
: In comp.lang.perl.misc Barry D. Ballard <barry.ballard@autodesk.com> wrote:
: > Does anyone know how to get the DBI module with the DBD for Oracle to
: > run an Oracle script file? I've tried a number of time and a number of
: > different ways, but so far it errors out with an invalid SQL statement
: > on the execute command when I try running the script.
: > Is the only way to open the script separately and run line by line?
: You can only run one statement at a time. You might be able to wrap
: your script in an PL/SQL block, which can be executed as a whole. See
: the DBI and DBD::Oracle documentation for more information.
Also note that SQLPlus has various commands and capabilities that are
specific to SQLPlus, and not available through another interface.
Therefore an Oracle script file thats runs fine from SQLplus will not
necessarily run from within DBI no matter what you do.
DESC is one such command, so are all the things like SPOOL.
------------------------------
Date: Thu, 26 Oct 2000 11:39:34 +1000
From: jason <elephant@squirrelgroup.com>
Subject: Re: Passing data to a script(from a form)
Message-Id: <MPG.1462364b1fa399a7989853@localhost>
gopringle@my-deja.com wrote ..
>I was wondering if you all could help me see the light.
>
>I'm testing a script that receives and argument(computer/server name)
>from the command line and outputs the "APPLICATION" log of that machine.
>
>c:>Inetpub\cgi-local>perl showevt.pl kp-papers03
>
>-------------------------------------------------------------
> Thu Oct 19 17:06:39 2000 MSDTC 4 KP-GAM-W098
>-------------------------------------------------------------
> Thu Oct 19 17:06:39 2000 MSDTC 4 KP-GAM-W098
>-------------------------------------------------------------
> Thu Oct 19 17:06:40 2000 MSDTC 4 KP-GAM-W098
> .
> .
> .
>
>***(If the machine name is not specified the log of the current machine
>is dumped.)***
>
>Up to this point everything works fine. The problem that I'm having
>is that I get a blank page whenever I try to pass the name of the server
>to the script from a webpage/form.
>
>According to what I have read so far I can pass an argument to a script
>from a form by inseting a "?" and the argument after the url that
>contains the script on the html code.
>
><a HREF="http://localhost/inetpub/cgi-local/showevt.pl?server">
>
>
>I would appreciate any help regarding this matter. I'm
>attaching the perl and html code to see if you can catch any errors
>that I might be making.
read the documentation on the CGI.pm module that you're using in your
program .. it has countless examples of how to read parameters in
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Thu, 26 Oct 2000 00:16:04 GMT
From: Howard <hxshxs@my-deja.com>
Subject: Re: Perl DBI installation
Message-Id: <8t7t3u$aii$1@nnrp1.deja.com>
Here is the actuall error message, I don't know what is wrong, please
help.
==================================
# make test
PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -
I/usr/local/lib/perl5/5.6.0/i686-linux -I/usr/local/li
b/perl5/5.6.0 -e 'use Test::Harness qw(&runtests $verbose); $verbose=0;
runtests @ARGV;' t/*.t
t/basics............ok
t/dbidrv............ok
t/examp.............ok
t/meta..............ok
t/proxy.............ok 4/111Can't call method "ping" on unblessed
reference at t/proxy.t line 87.
t/proxy.............dubious
T
est returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-2, 5-111
F
ailed 109/111 tests, 1.80% okay
t/shell.............ok
t/subclass..........ok
Failed Test Status Wstat Total Fail Failed List of failed
------------------------------------------------------------------------
-------
t/proxy.t 255 65280 111 109 98.20% 1-2, 5-111
Failed 1/7 test scripts, 85.71% okay. 109/290 subtests failed, 62.41%
okay.
make: *** [test_dynamic] Error 29
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 25 Oct 2000 16:37:53 -0700
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: Perl extension in C on Win98
Message-Id: <39F76ED1.39C0712F@jpl.nasa.gov>
David A Ireland wrote:
> I'm trying to create an elementary Perl extension in C using Perl 5.005_05
> (ActivePerl Build 522) under Windows 98se. I'm following the instructions
> for
> the very basic "Hello World" example in the perlxstut manual.
>
> When I try C:>perl makefile.pl
> I get the messages:
> -----
> Checking if your kit is complete...
> Looks good
>
> General failure reading device
> Abort, Retry, Fail?
> -----
> And then all sorts of nasty problems that generally require a reboot.
>
> Any advice?
I use Cygwin (http://sources.redhat.com), which is a great development
environment for Windows. Perl and XS modules compile cleanly (but I
can't seem to build embeded perl programs). (Hope I didn't start an OS
flamewar here!)
Jon
--
Knowledge is that which remains when what is
learned is forgotten. - Mr. King
------------------------------
Date: Thu, 26 Oct 2000 00:53:41 GMT
From: "David A Ireland" <david@nomail.please>
Subject: Re: Perl extension in C on Win98
Message-Id: <pgLJ5.15142$Ab3.80883@news-server.bigpond.net.au>
Thanks, Jon,
I didn't intend to load a new system, but may yet do if this can't be easily
solved.
Somewhere I've seen advice on the ActivePerl module that involves making
changes to the ExtUtils library so that Makefile works correctly on Win 98,
but I couldn't make sense of it - at least not enough to risk messing with
the libraries.
David Ireland
"Jon Ericson" <Jonathan.L.Ericson@jpl.nasa.gov> wrote in message
news:39F76ED1.39C0712F@jpl.nasa.gov...
> David A Ireland wrote:
> > I'm trying to create an elementary Perl extension in C using Perl
5.005_05
> > (ActivePerl Build 522) under Windows 98se. I'm following the
instructions
> > for
> > the very basic "Hello World" example in the perlxstut manual.
> >
> > When I try C:>perl makefile.pl
> > I get the messages:
> > -----
> > Checking if your kit is complete...
> > Looks good
> >
> > General failure reading device
> > Abort, Retry, Fail?
> > -----
> > And then all sorts of nasty problems that generally require a reboot.
> >
> > Any advice?
>
> I use Cygwin (http://sources.redhat.com), which is a great development
> environment for Windows. Perl and XS modules compile cleanly (but I
> can't seem to build embeded perl programs). (Hope I didn't start an OS
> flamewar here!)
>
> Jon
> --
> Knowledge is that which remains when what is
> learned is forgotten. - Mr. King
------------------------------
Date: Thu, 26 Oct 2000 01:48:38 +0200
From: Alex Fitterling <fe8x025@public.uni-hamburg.de>
Subject: Perl on NT
Message-Id: <mgr7t8.741.ln@sokrates2.hagenbeck.uni-hamburg.de>
Hello.
Is Perl in NT (4.0) integrated, or has it to be installed additionally
?
Alex
------------------------------
Date: Wed, 25 Oct 2000 20:01:56 -0400
From: "Arthur Dalessandro" <adalessandro@odione.com>
Subject: Re: Perl on NT
Message-Id: <svet3sf41s8mac@corp.supernews.com>
It is seperate, you can find active perl @ http://www.activestate.com
-art
"Alex Fitterling" <fe8x025@public.uni-hamburg.de> wrote in message
news:mgr7t8.741.ln@sokrates2.hagenbeck.uni-hamburg.de...
> Hello.
>
> Is Perl in NT (4.0) integrated, or has it to be installed additionally
> ?
>
> Alex
>
------------------------------
Date: Thu, 26 Oct 2000 00:03:18 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Perl on NT
Message-Id: <slrn8vet63.a0g.mgjv@verbruggen.comdyn.com.au>
On Thu, 26 Oct 2000 01:48:38 +0200,
Alex Fitterling <fe8x025@public.uni-hamburg.de> wrote:
> Hello.
>
> Is Perl in NT (4.0) integrated, or has it to be installed additionally
> ?
Are you asking whether it comes as part of the OS? No. And if it did,
I'd be very afraid to use it.
http://www.activestate.com/
Martien
--
Martien Verbruggen |
Interactive Media Division | Freudian slip: when you say one thing
Commercial Dynamics Pty. Ltd. | but mean your mother.
NSW, Australia |
------------------------------
Date: Wed, 25 Oct 2000 17:20:47 -0700
From: "joe cipale" <jcipale@hotmail.com>
Subject: Perl, CGI and rsh/rcp in Unix
Message-Id: <8t7tcv$dhs@news.or.intel.com>
Here is a question for some of the real Perl/CGI gurus out there.
I have several sites spread throughout our corporate intranet that I perform
dataming on.
This data mining is controlled by configuration files setup at each
site/host. These hosts exist
in North/South America, Europe and the Middle East.
I am putting together a website that will allow the engineer who is
responsible for keeping
the data up-to-date if the config files need to be changed/updated. I can
open a copy of a
config file that exists on my local HD by:
open(PART_FILE, "~my_account/data_dir/file.txt");
What I want to do, is use rsh or rcp to grab data ON COMMAND as the engineer
goes to
the website. I have tried:
1) open(PART_FILE, `rsh myhost@data.com cat
/data_mining/data_path/file.txt`);
and
2) $part.inp = `rsh myhost@data.com cat /data_mining/data_path/file.txt`;
If I use Method #1:
The page displays okay, but the data I am expecting to see is blank. I
display the data
this way:
@B = <PART_FILE>;
while ($line = shift(@B)) {
print $line;
}
Is there something that I am missing, or, worse yet, something I am trying
to do that Perl
will not allow me to do???
Thanks for your help and response.
Joe Cipale
If I use Method #2:
I get an Internal Server Error and a 'Contact Server Admin' message.
------------------------------
Date: 26 Oct 2000 00:38:23 GMT
From: "Rod B. Nussbaumer" <bomr@lin01.triumf.ca>
Subject: Re: socket flushing problem
Message-Id: <8t7udu$hvv$1@nntp.itservices.ubc.ca>
Uri Guttman <uri@sysarch.com> wrote:
>>>>>> "RBN" == Rod B Nussbaumer <bomr@lin01.triumf.ca> writes:
> RBN> Okay, I've read loads of stuff about doing TCP socket IO in perl,
> RBN> and have a fair grasp of the basic concepts. I've managed to
> RBN> write/modify some simple client & server testbeds, and now that
> RBN> I'm trying to do something useful, I've bumped into a problem
> RBN> I can't solve for myself.
>use IO::Socket to replace much of your code below.
Uri:
Thanks for your prompt reply.
Okay, I've done what you suggest; code sample below. Still, the
non line oriented packet refuses to to be flushed out.
>read perlipc and focus on the socket parts.
Been there, done that. The thing I noted is that the output
to socket functions in perl are based on the write() system
calls. In the C version I am attempting to duplicate, it is
exactly the write() function that is employed, and it works
reliably (although, I now question whether it *necessarily*
should be reliable). At any rate, it seems to me that if
write() called from C works, there's got to be a way to get
write() called form Perl to works on the same host.
Boy, I'd really like to get past this stumper!
#! /bin/perl -w
#
# Socket function test: client side version 2
# - using IO::Socket instead of Socket.
#
#
#
# ===============================================================
use strict;
use IO::Socket;
my ($Address,$Port) = @ARGV;
my $Count = hex(30);
my $Input;
my $Struct = pack( "CCS3C", 34, $Count, hex('7555'), hex('5575'), 34 );
my $Sock = IO::Socket::INET->new( PeerAddr => $Address,
PeerPort => $Port,
Proto => 'tcp'
) || die "IO::Socket \"$Address ($Port)\" : $!\n";
$Sock->autoflush(1);
print "Socket connected\n";
while( 1 ){
if( eof( STDIN ) ){
last;
}
if( defined( $Input = <STDIN> ) ){
print $Sock $Input; # line oriented, flushed for sure...
print $Sock $Struct; # should be sent too...
$Count++;
}
#
# The companion server just echoes everything we send it...
#
if( defined( $Input = <$Sock> ) ){
print "rec\'d : $Input"; # $Struct comes back on next iteration!
}
}
print "Closing Socket...\n";
close($Sock);
print "...bye\n";
exit(0);
------------------------------
Date: Wed, 25 Oct 2000 14:15:47 -0700
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: Spaces to tab
Message-Id: <39F74D83.24911AE9@jpl.nasa.gov>
equilibrium1@my-deja.com wrote:
> I'm trying to come up with a regex pattern that will evaluate the space
> at the beginning of the line up to the non-whitespace characters in
> such a way that 4 spaces are converted to tab characters and any extra
> space characters left over are converted to null.
> So far I have this:
> $line=~s/( {4}/\t/g;
The g modifier won't be necessary if you are processing line-by-line.
Also that ( looks like a typo.
> But this converts any spaces after the beginning whitespace as well,
You should anchor to the beginning of the line (with ^).
> and it doesn't convert 2 or 3 spaces into null. In other words, I am
No doubt there is a way to do this in one regex, but you might find that
a series of regex filters will be easier to read and debug.
> trying to format some ASP code, but wish to leave the code (all the
> characters after the initial white space) alone. Any suggestions?
It could be useful to post a small dataset with expected output.
Jon
--
Knowledge is that which remains when what is
learned is forgotten. - Mr. King
------------------------------
Date: Wed, 25 Oct 2000 17:10:10 -0700
From: Steven Kuo x7914 <skuo@mtwhitney.nsc.com>
To: equilibrium1@my-deja.com
Subject: Re: Spaces to tab
Message-Id: <Pine.GSO.4.21.0010251708110.23534-100000@mtwhitney.nsc.com>
On Wed, 25 Oct 2000 equilibrium1@my-deja.com wrote:
> I'm trying to come up with a regex pattern that will evaluate the space
> at the beginning of the line up to the non-whitespace characters in
> such a way that 4 spaces are converted to tab characters and any extra
> space characters left over are converted to null.
> So far I have this:
> $line=~s/( {4}/\t/g;
>
> But this converts any spaces after the beginning whitespace as well,
> and it doesn't convert 2 or 3 spaces into null. In other words, I am
> trying to format some ASP code, but wish to leave the code (all the
> characters after the initial white space) alone. Any suggestions?
Try:
$line =~ s!^( *)!"\t" x int(length($1)/4)!e;
--
Steve
Not yet ready for perl golf...
------------------------------
Date: Wed, 25 Oct 2000 17:07:31 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Spaces to tab
Message-Id: <MPG.1461159d4989e72098ae6f@nntp.hpl.hp.com>
In article <8t7ghi$vlr$1@nnrp1.deja.com> on Wed, 25 Oct 2000 20:41:24
GMT, equilibrium1@my-deja.com <equilibrium1@my-deja.com> says...
> I'm trying to come up with a regex pattern that will evaluate the space
> at the beginning of the line up to the non-whitespace characters in
> such a way that 4 spaces are converted to tab characters and any extra
> space characters left over are converted to null.
> So far I have this:
> $line=~s/( {4}/\t/g;
^
???
> But this converts any spaces after the beginning whitespace as well,
> and it doesn't convert 2 or 3 spaces into null. In other words, I am
> trying to format some ASP code, but wish to leave the code (all the
> characters after the initial white space) alone. Any suggestions?
Perhaps this is all you need:
$line =~ s/^ {4,}/\t/;
(Replace a sequence of 4 or more spaces at the beginning of the string
by a tab.)
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 26 Oct 2000 02:30:24 +0000
From: Joerg Kammerer <jk@sinatra.inka.de>
Subject: usenet to web gateway
Message-Id: <39F79740.CD48DB23@sinatra.inka.de>
Has anybody seen something similar in perl?
--
Government spending? I don't know what it's all about. I don't know
any more about this thing than an economist does, and, God knows, he
doesn't know much.
-- Will Rogers
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 4726
**************************************