[12143] in Perl-Users-Digest
Perl-Users Digest, Issue: 5743 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 21 13:07:49 1999
Date: Fri, 21 May 99 10:00:21 -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 Fri, 21 May 1999 Volume: 8 Number: 5743
Today's topics:
-> Folkert Meeuw: Write errors and correction <fmee@lfi.uni-hannover.de>
Re: CGI : transferring a whole file (Larry Rosler)
DBD-Iformix Problem <std6804@et.fh-osnabrueck.de>
DBD/MySQL (Steven Fletcher)
DBI::DBD trough the net... <fruffet@kaptech.com>
Re: File::Copy & HTTPD::UserAdmin/GroupAdmin not workin (Paananen Tero)
Re: Has anyone ever used "Scilab" with PERL? <cassell@mail.cor.epa.gov>
Help! Object implementation problem with Embperl <smaring@gte-es.com>
Re: MacPerl and QuarkXPress??? (Chris Nandor)
Re: Need help (Bernhard Muenzer)
Re: Need Perl interpreter <dgris@moiraine.dimensional.com>
Re: Perl "constructors" <jdporter@min.net>
perl and Oracle8 ujm@edv.ch
perl and Oracle8 ujm@edv.ch
Re: Perl compiler...If or when <tchrist@mox.perl.com>
Re: Perl compiler...If or when <cassell@mail.cor.epa.gov>
Re: Perl Unicode/Multibyte Support (Ilya Zakharevich)
Re: PERLFUNC: ref - find out the type of thing being re (Peter Scott)
Re: Q: Problem with readdir on AIX (NICHOLAS DRONEN)
Re: Refresh a document in frame <juex@my-dejanews.com>
Re: stripping text with regex <droby@copyright.com>
Re: Usin IF gives Internal Server Error?? <andy@focus-consulting.co.uk>
Utterly poor perl!! (using index) <ralawrence@my-dejanews.com>
variable = current URL <airman@inreach.com>
What is the meaning of '.' in @INC? <vincent_vanbiervliet@be.ibm.com>
while ( <FILE> && /match/ ) <eijkhout@prancer.cs.utk.edu>
Re: while ( <FILE> && /match/ ) (Greg Andrews)
Re: while ( <FILE> && /match/ ) (Andrew Allen)
Re: XML::XQL (Arved Sandstrom)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 19 May 1999 16:21:33 +0200
From: Folkert Meeuw <fmee@lfi.uni-hannover.de>
Subject: -> Folkert Meeuw: Write errors and correction
Message-Id: <3742C8ED.65FAAEE7@lfi.uni-hannover.de>
Hi Dear Friendly Readers,
instead of a new problem, a correction to the yesterday postings.
#!/usr/local/bin/perl -w
# 1.8 Listings
open (IN, "friends") or die "couldn't open friends $!";
@friends = <IN>;
close IN;
chomp @friends;
print "Whats your name:\n";
$name = <STDIN>;
chomp $name;
foreach $friend (@friends)
{
if ($name eq $friend)
{
print "Hallo $name, good old boy\n";
}
else
{
print "Hallo, $name\n";
}
}
so far so good !
But elsewise, when I write in too: use strict;
save the scrpit again and I type in a shell: perl -d 1.8.pl
to run it, the run of the script failed.
I don't know why, I'm a newby in perl.
NG Folkert Meeuw
------------------------------
Date: Fri, 21 May 1999 09:45:52 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: CGI : transferring a whole file
Message-Id: <MPG.11af2d995d0ca6bf989ad7@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed. Rewritten so the things referenced
come *before* the comments about them. Why do your tools make it so
damned easy to do it wrong???]
In article <37456122.2F9EC84A@inreach.com> on Fri, 21 May 1999 06:35:30
-0700, LEB <airman@inreach.com> says...
> bernard menez wrote:
> > Hi all, I want to write a CGI script that would send back a binary file.
To a browser. So the output should be to STDOUT, not to a file!
> > My problem is that I want to send it as a whole ... I do not want
> > something
> > like this :
> > @lines=<file>;
> > foreach $line (@lines)
> > { print "$line"; }
Simple variable shouldn't be quoted.
> > I'm using a windows environment. If I was using Unix, I guess I could do
> > something like :
> > $data='cat file';
> > print "$data";
Simple variable shouldn't be quoted.
...
> open (OUT, ">/images/main_bnr.gif") || &error("Can't open
> /images/main_bnr.gif");
STDOUT is open already.
> open (IN, "</newdir/dirname/main_bnr.gif") || &error("Can't transfer to
> /newdir/dirname/main_bnr.gif");
binmode STDOUT;
binmode IN;
These are *essential* in the Windows environment, and *should* be used
even in environments where they are not needed, for potential
portability. I am crusading to get this incorporated in all the Perl
documentation as The Way To Do It, so people won't continue to overlook
this need when it is critical.
> print OUT <IN>;
This does line-at-a-time I/O on a file that has no lines!
If the file is small enough to fit conveniently in memory, then this
will do it:
{ local $/; print <IN> }
If the file is very large, then this way (8192 is arbitrary):
print while read IN, $_, 8192;
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 19 May 1999 11:32:21 +0200
From: carsten <std6804@et.fh-osnabrueck.de>
Subject: DBD-Iformix Problem
Message-Id: <37428525.1D3566B8@et.fh-osnabrueck.de>
I have succesfully installed DBI.
Now I want to install DBD-Informix.
I use SuSE-Linux 6.0
But I get the error:
perl Makefile.PL
Configuring DBD::Informix version 0.60...
You are using DBI version 1.08 and Perl version 5.00503
Remember to actually read the README file!
Using INFORMIX-ESQL Version 7.24.UC5 from /usr/informix
DBD::Informix doesn't check whether ODBC or Informix-CLI software
is installed any more. It uses a home-brew odbctype.h instead.
Testing whether your Informix test environment will work...
cc: /usr/informix/lib/libnetstub.so: linker input file unused since
linking not done
cc: /usr/informix/lib/libnetstub.so: linker input file unused since
linking not done
/usr/informix/lib/esql/libixos.so: undefined reference to `crypt'
collect2: ld returned 1 exit status
Failed to link test program esqltest
------------------------------
Date: Fri, 21 May 1999 16:18:10 GMT
From: flec@flec.co.uk (Steven Fletcher)
Subject: DBD/MySQL
Message-Id: <37458446.534089460@internal.news.shellnet.co.uk>
Hi all;
I've been doing a small email interface for the Keystone system
(http://www.stonekeep.com/) in perl that'll take emails and add them
into an SQL table that keystone uses.
I've stumbled across a weird problem that I don't know the answer for
when using DBI. I have 2 variables, $subject and $o_tech, in a line like
this:
my $sth = $dbh->prepare( q{ INSERT INTO slips (o_tech, problem)
VALUES($o_tech, $subject) });
And I'm getting the following back:
BD::mysql::st execute failed: parse error near '$o_tech, $problem) ' at
line 1 at /4.pl line 23, <STDIN> chunk 11.
Can't execute statement: parse error near '$o_tech, $problem) ' at line
1 at /4.pl line 23, <STDIN> chunk 11.
Database handle destroyed without explicit disconnect, <STDIN> chunk 11.
Am I doing something really dumb here, as if I try to enslose the
$o_tech or $problem vars in either a ' or ", it puts them into the
database as the text line, $o_tech for example.
Thanks a bundle for any assistance anyone can provide!
Steven Fletcher - steven@shellnet.co.uk
Shellnet - http://www.shellnet.com
------------------------------
Date: Fri, 21 May 1999 17:48:58 +0200
From: =?iso-8859-1?Q?Fr=E9d=E9ric?= Ruffet <fruffet@kaptech.com>
Subject: DBI::DBD trough the net...
Message-Id: <3745806A.754ED424@kaptech.com>
Hello everybody,
Here is a little problem I encounter :
I was programming an application in perl wich access Oracle 7.3.4
through DBI::DBD. No (big) problem. When, suddently, DBA decided to get
the new Oracle 8.0.5. It could have been no problem for me, except that
the new Database, is no more on the server I used to work with. I mean
that till then perl scripts and Oracle database were on the same
machine. Now, I have perl script on my old machine, and the new DB is on
a distant server I can access through our Intranet. What configuration
must I set up to access this distant database. For now, all I needed to
do, was to set my environment variables, and to connect with the connect
instruction of the DBI package.
Must I change my script ? Must I change the DB configuration ? Must I go
and find a new job ?
Thanks for any help,
Fred
------------------------------
Date: 21 May 1999 16:27:26 GMT
From: p116711@ampeeri.ee.tut.fi (Paananen Tero)
Subject: Re: File::Copy & HTTPD::UserAdmin/GroupAdmin not working together?
Message-Id: <7i41he$1lp$1@baker.cc.tut.fi>
p116711@ampeeri.ee.tut.fi (Paananen Tero) writes:
>Anybody have *any* idea why this little script won't
>actually delete the .htpasswd.new and .htgroup.new files?
You guys are no help! :)
Anyway, found the answer myself. Script working now.
-TPP
>#!/usr/local/bin/perl
>use HTTPD::GroupAdmin;
>use HTTPD::UserAdmin;
>use File::Copy;
>my $create_group = '.htgroup.new';
>my $real_group = '.htgroup';
>my $create_user = '.htpasswd.new';
>my $real_user = '.htpasswd';
>@TextGA = (DBType => 'Text',
> DB => $create_group,
> Server => 'apache',
> Name => 'test',
> Locking => 0,
> Debug => 'true');
>@TextUA = (DBType => 'Text',
> DB => $create_user,
> Server => 'apache',
> Name => 'test',
> Locking => 0,
> Debug => 'true');
>my $group = new HTTPD::GroupAdmin @TextGA;
>my $user = new HTTPD::UserAdmin @TextUA;
>while (<STDIN>)
>{
> my ($userid, $passwd) = split( /\t/ );
> $user->add( $userid, $passwd );
> $group->add( $userid );
>}
>$user->commit();
>$group->commit();
$user = undef;
$group = undef;
>print move( $create_group, $real_group ), "\n";
>print move( $create_user, $real_user ), "\n";
------------------------------
Date: Fri, 21 May 1999 09:24:01 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: tom22@verio.com
Subject: Re: Has anyone ever used "Scilab" with PERL?
Message-Id: <374588A1.8C4697EC@mail.cor.epa.gov>
[courtesy cc sent to poster]
Tom wrote:
>
> Hi,
>
> I would like to use PERL for signal processing operations and
> simulations but it does not appear to have modules which do FFT's,
> filter design, etc. I have used Scilab, a free mathematics package which
> is well suited to DSP. I know that it is possible to interface Scilab to
> "C" but I was wondering if anyone has interfaced PERL to Scilab instead.
Well, if it's possible to interface it to C (no quotes), it is
equally feasible to interface it to Perl (not all caps). But
you'd want to do the number-crunching in Scilab instead of in
Perl.
I haven't seen a Scilab module, but that doesn't mean there
isn't one. There is a Math::ematica module to interface with
Steve Wolfram's Mathetica package.
If you go to CPAN, you'll see that there are a host of Math::*
modules, some of which may do some of what you want.
PDL (the Perl Data Lanaguage) provides a numerical analysis
environment. PDL::Slatec provides an interface to the
linpack+eispack lib.
Then there's Math::Fourier (the FFT you were looking for),
Math::BigInt, Math::Matrix, Math::MatrixReal,
Math::MatrixCplx, ......
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 21 May 1999 16:01:25 GMT
From: Steve Maring <smaring@gte-es.com>
Subject: Help! Object implementation problem with Embperl
Message-Id: <37458350.1E1C02F3@gte-es.com>
I'm sure this is a basic implementation problem on my part. When I try
to instantiate my test class in an
Embperl page I get the following error:
Can't locate object method "new" via package "Test" at
/data/www/test.epl line 7.
###### start Test.pm################
package Test;
use strict;
sub new {
my $proto = shift;
my $class = ref($proto) || $proto;
my $self = {};
$self->{TESTKEY} = "testvalue";
bless ($self, $class);
return $self;
}
###### end Test.pm ################
###### start test.epl ###############
<HTML>
<BODY>
[*
use Test;
my $test = Test->new();
*]
TESTKEY is: [+ $test->{TESTKEY} +]
</BODY>
</HTML>
###### end test.epl ################
Thanks.
-Steve Maring
Tampa, FL
------------------------------
Date: Fri, 21 May 1999 16:53:30 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: MacPerl and QuarkXPress???
Message-Id: <pudge-2105991253330001@192.168.0.77>
In article <3745545B.95698573@falukuriren.se>, Mats Pettersson
<mats.pettersson@falukuriren.se> wrote:
# I'm currently trying to do a apple-script for QuarkXPress. However
# expressions isn't apple-scripts greatest strength, so i thought i should
# try MacPerl.
#
# I couldn't find any info how to intergrate apple-script with perl or if
# it is possible in any way.
#
# Anybody tried scripting Quark with perl, or if somone could point me to
# any similar information.
The MacPerl book and MacPerl mailing lists are good places to start. The
easiest solution is to call MacPerl from AppleScript or vice versa:
tell app "MacPerl"
set result to Do Script "MacPerl::Reply 'foobar'"
end
Or:
my $result = MacPerl::DoAppleScript(<<EOS);
tell app "Finder"
open startup disk
end
EOS
Or whatever. You can do Apple events directly from MacPerl, but it gets
much more complicated (though I am trying to make it easier).
See links to all this stuff on my site at:
http://pudge.net/macperl/
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: Fri, 21 May 1999 15:39:17 GMT
From: bmuenzer@compuserve.com (Bernhard Muenzer)
Subject: Re: Need help
Message-Id: <eI$ieB6o#GA.343@nih2naae.prod2.compuserve.com>
[ Newsgroups clipped ]
"Suzy" <postbus@suzy.demon.nl> wrote:
>In exchange the input is:
>Name: Maria
>Initials: MJ
>Last name: Steen-van Buizen
>Common Name: Steen-van Buizen van der, MJ Maria
>
>what we want is:
>Name: Maria
>Initials: MJ
>Last name: Steen-van Buizen
>Infix: van der
>
>The problem is I can't separate the words in common name for infix. Infix is
>an output file. A script has to solve that.
>One of the solutions is to delete everything behind the comma and delete the
>last name. But how to do that in Perl??
while (<>) {
$last_name=$1 if /^Last name: (.*)/i;
if ( /^Common Name:/i ) {
print "Infix: $1\n" if /$last_name (.*),/i;
} else {
print $_;
}
}
--
/* Gesetzestext gesucht? http://www.compuserve.de/recht/gesetze/ */
int m,u,e=0;float l,_,I;main(){for(;1840-e;putchar((++e>907&&942>e?
61-m:u)["\n)moc.isc@rezneumb(rezneuM drahnreB"]))for(u=_=l=0;79-(m=
e%80)&&I*l+_*_<6&&26-++u;_=2*l*_+e/80*.09-1,l=I)I=l*l-_*_-2+m/27.;}
------------------------------
Date: 21 May 1999 10:06:08 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Need Perl interpreter
Message-Id: <m3btfetnkf.fsf@moiraine.dimensional.com>
quikscor@ix.netcom.com (anonymous) writes:
> Where's the best place to get a Perl interpreter for Windows 98?
Interpreters'R'Us, just off of Arapahoe and I-25 20 miles
south of downtown Denver. It's the little building with
the giant stuffed camel in front of it.
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Fri, 21 May 1999 16:39:42 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Perl "constructors"
Message-Id: <7i428e$27c$1@nnrp1.deja.com>
In article <7hsnvv$rvp$1@nnrp1.deja.com>,
armchair@my-dejanews.com wrote:
> I'm all for that. But the "exception handling" of Perl is not covered
in
> introductory books and is not easily picked up from what is referred
to
> as "the manual".
% grep "exception-handling" *.pod
perlfaq8.pod:Perl's exception-handling mechanism is its eval() operator.
You can
> And is that how you code? Is that the Perl way? Or is returning undef
> the Perl way?
Perl supports many programming styles. If it's coercion or hand-holding
you want, Perl is not a good choice.
But I personally never use return values as a way to indicate
success/failure.
--
John Porter
Put it on a plate, son. You'll enjoy it more.
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Fri, 21 May 1999 16:55:34 GMT
From: ujm@edv.ch
Subject: perl and Oracle8
Message-Id: <37458fe9.1377460@news.access.ch>
We load data into Oracle 8/NT using perl/ODBC.
We now get a ORA-03113 error (end-of-file on communication channel) on
the SECOND SQl statement in each program
- this happens for any SQL statement, i.e SELECT, UPPDATE etc.
We can use other tools on the same machine with success (TOAD, SQl
worksheet, ODBC Test).
We habve reinstalled perl and ODBC copied from working machines -
still doesn't work.
We have tested the program on identical machines, it works fine.
I have no idea where even to start looking!
Any help appreciated!
Urs J. Misteli
ujm@edv.ch
------------------------------
Date: Fri, 21 May 1999 16:57:44 GMT
From: ujm@edv.ch
Subject: perl and Oracle8
Message-Id: <3745907f.1527957@news.access.ch>
We load data into Oracle 8/NT using perl/ODBC.
We now get a ORA-03113 error (end-of-file on communication channel) on
the SECOND SQl statement in each program
- this happens for any SQL statement, i.e SELECT, UPPDATE etc.
We can use other tools on the same machine with success (TOAD, SQl
worksheet, ODBC Test).
We habve reinstalled perl and ODBC copied from working machines -
still doesn't work.
We have tested the program on identical machines, it works fine.
I have no idea where even to start looking!
Any help appreciated!
Urs J. Misteli
ujm@edv.ch
------------------------------
Date: 21 May 1999 10:02:25 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl compiler...If or when
Message-Id: <37458391@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Corus <corus@my-dejanews.com> writes:
:I don't hide my *personal* reason for wanting a compiler. (One without
:the decompiler) [SCREWED UP WRAPPING BY BROKEN NEWSREADER]
:It is to hide my code from evil eyes. Or at least make it considerably
:harder to get at. [SCREWED UP WRAPPING BY BROKEN NEWSREADER]
:If someone has the skills to succesfully de-compile code that wasn't
:intended to be "decompileable", then they probably would equally have
:the skill to not have resort to doing it.
1. Revise your notion of evil.
2. Get a real newsreader.
What is it about this horrible Microsoft world that is so cupiditous?
Follow the leader, I guess.
Avarice:1 Science:0
--tom
--
Those who do not fight the demons within themselves are destined to fight them
outside themselves...
------------------------------
Date: Fri, 21 May 1999 09:42:48 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Perl compiler...If or when
Message-Id: <37458D08.67A6F5A0@mail.cor.epa.gov>
Tom Christiansen wrote:
>
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc,
> Corus <corus@my-dejanews.com> writes:
> > [some text I am heartlessly eliding]
>
> 1. Revise your notion of evil.
> 2. Get a real newsreader.
>
> What is it about this horrible Microsoft world that is so cupiditous?
> Follow the leader, I guess.
>
> Avarice:1 Science:0
Tom, your Freudian slip is showing. :-)
Unfortunately, this isn't merely a M$ issue. Recall when most
of the software being pirated was Mac games? People who
would never consider photocopying the entire Encyclopedia
Brittanica seem to have no qualms whatsoever about snitching
an electronic copy of the nearest equivalent. There are now
entire countries which have no concept of intellectual
property.. and I suspect the U.S. is dangerously close to
joining that collective.
But I agree with your position.
Having a compiled executable hardly saves anyone in
such a case. Microsoft Office is all compiled C++
bloatware^H^H^H^H^H^H^H^H^H executables, and it's one of
the hottest theifware products in the world. Compiling
a piece of software does *not* keep people from snitching
it. Putting a dongle on your machine does not keep
people from snitching it. Putting copy protection in
your software does not keep people from snitching it.
There are skriptkiddies whose sole purpose in life is
making illegally available the latest version of anything,
including Microsoft Smells for Dogs (tm). :-)
Code compilation could have advantages in a few places,
but not in security.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 21 May 1999 16:35:52 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl Unicode/Multibyte Support
Message-Id: <7i4218$ple$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Matt Sergeant
<matt-news@sergeant.org>],
who wrote in article <37452248.272384F9@sergeant.org>:
> > Keep in mind that apparently *nobody* did ever tried to use it
> > (judging by the obvious bugs I see in the implementation, and a
> > complete absense of bug reports).
>
> Probably due to the fact that it's not in the perl people use yet. For
> example, judging by the TPI survey, almost 40% of perl users are on NT,
> for which there is no Beta-perl binary build available. I'm sure in
> reality very few people are using 5.005_[5..9]\d
>
> Once it becomes the standard perl, expect lots of bug reports from the
> XML people... :)
It is going to be too little too late. I have seen reports that XML
people shy from Perl now.
Ilya
------------------------------
Date: 21 May 1999 16:14:21 GMT
From: psl@euclid.jpl.nasa.gov (Peter Scott)
Subject: Re: PERLFUNC: ref - find out the type of thing being referenced
Message-Id: <7i40ou$oiv@netline.jpl.nasa.gov>
[courtesy cc of this posting sent to cited author via email]
In article <37433776@cs.colorado.edu>, Tom Christiansen <tchrist@mox.perl.com> writes:
> In comp.lang.perl.misc, lr@hpl.hp.com (Larry Rosler) writes:
> :How does one get LVALUE?
>
> $name = "Fred Flintstone";
> $rl = \substr($name, 5, 5);
> $$rl = "Cobble";
> print "$name\n";
> Fred Cobblestone
Interesting. I did some playing around with this on 5.004_04 on Solaris
2.5.1 and found some results I didn't understand:
my $name = 'Fred Flintstone';
my $rl = \substr($name, 5, 5);
$$rl = "Cobble";
print "$name\n";
$name = 'Atom Ant';
$$rl = "Cobble";
print "$name\n";
$name = 'Pepe le Pew';
$$rl = "Cobble";
print "$name\n";
Fred Cobblestone
Atom Cobb
Pepe Cobblew
I don't understand the clipping in the second two.
I know, I know, "Don't do that"...
--
Peter Scott, psl@euclid.jpl.nasa.gov
------------------------------
Date: Fri, 21 May 1999 16:54:19 GMT
From: mirabai@io.frii.com (NICHOLAS DRONEN)
Subject: Re: Q: Problem with readdir on AIX
Message-Id: <%cg13.305$g3.187430400@news.frii.net>
Mathias Ochsendorf (mathiaso@xlink.net) wrote:
: Hi,
: I have problems with directory related perl functions on AIX 4.2:
: When I use readdir to find a given file, there are sometimes very
: strange outputs:
: >o44config905o0
: instead of >config
: I tried to install the latest version of Perl perl5.005_03,
: but it failed:
: >op/readdir..........FAILED test 3
: >lib/dirhand.........FAILED tests 2-4
: >lib/dosglob.........FAILED tests 2-3
: >lib/filefind.t ......FAILED tests 1-2
: Can anyone give me a hint ??
I had some problems with readdir in perl on AIX
4.2.1. until I upgraded bos.rte.libc.
------------------------------
Date: Fri, 21 May 1999 09:43:47 -0700
From: "J|rgen Exner" <juex@my-dejanews.com>
Subject: Re: Refresh a document in frame
Message-Id: <7i42bl$1t3@news.dns.microsoft.com>
Karpat <karpat@eeh.ee.ethz.ch> wrote in message
news:37451D9F.EF784174@eeh.ee.ethz.ch...
> Could somebody help me with such small problem:
> I have two frames, the user fills a form in the first frame, on the base
> of his input I add something to the document, which is seen in the
> second frame. Can I make browser to refresh the second frame?
And ..... where's your Perl problem?
jue
--
J|rgen Exner
------------------------------
Date: Fri, 21 May 1999 15:46:30 GMT
From: Don Roby <droby@copyright.com>
Subject: Re: stripping text with regex
Message-Id: <7i3v4m$vsk$1@nnrp1.deja.com>
In article <7i2ing$dku$1@plonk.apk.net>,
"Jody Fedor" <JFedor@datacom-css.com> wrote:
>
> Don't you just love the smug answers you get here?
>
>
yes.
--
Don Roby
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Fri, 21 May 1999 17:27:28 +0100
From: Andy Mendelsohn <andy@focus-consulting.co.uk>
Subject: Re: Usin IF gives Internal Server Error??
Message-Id: <37458970.E6D4619E@focus-consulting.co.uk>
LEB wrote:
>
> When I add the IF statement as below, I start getting Internal Server
> Error.??? Any ideas? Without the IF statement, all works fine. I am
> trying to say that IF the varialble MEDIAURL is not EMPTY print the
> following line to the file.
>
Internal Server error eh?
So, I take it you're writing your perl cgi script, placing it in cgi-bin
and then just running it via a web browser?
You're not testing it from the command line first?
running it from the command line will confirm your assumption that the
problem lies with the 'IF'. Why? because you mean 'if' not 'IF'. Perl
thinks that you are calling a subroutine called IF
I suggest you read the documentation that comes with your perl release.
type :
perldoc perl
and then :
perldoc perlsyn
and then :
perldoc perlsec
> Thanks for any input.
no problem
------------------------------
Date: Fri, 21 May 1999 16:06:02 GMT
From: Richard Lawrence <ralawrence@my-dejanews.com>
Subject: Utterly poor perl!! (using index)
Message-Id: <7i4097$pp$1@nnrp1.deja.com>
Here is some utterly poor code to take each line from a file txt.txt
and see if that line contains the words on the command line ie.
prog.pl fish -- will list all lines with fish in it
prog.pl fish chips -- will list all lines with fish AND chips in it
Two problems:
1. Its case sensitive - the only way I can think of making it case
insensitive is by copying both bits of text to temp variables,
lowercasing them and then compairing but that is HORRIBLE. Can anyone
suggest a better solution?
2. Is there any better way to do this code? In the end there won't be
the input from the command line, just an array of words (like
@requests).
Thanks for any help.
Rich
---begin perl---
#!/usr/bin/perl -w
use strict;
my @requests;
my $len;
my $flag;
my $i;
my $line;
@requests = split(/ /, $ARGV[0]);
$len = @requests;
open (DATA, "txt.txt") || die "can't open txt.txt: $!";
while (<DATA>)
{
$line = $_; # do i need to do this or will $_ stay the same?
$flag = 1;
$i = 0;
while ($i < $len && $flag == 1)
{
if ((index $line, $requests[$i]) == -1)
{
$flag = 0;
}
$i++;
}
if ($flag == 1)
{
print "***** $line";
}
}
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Fri, 21 May 1999 09:47:30 -0700
From: LEB <airman@inreach.com>
Subject: variable = current URL
Message-Id: <37458E22.42198164@inreach.com>
Does anyone know how to get the value of the current url for a window?
i.e. $url = $ENV(CURRENT_URL) or something?
Thanks
------------------------------
Date: Fri, 21 May 1999 18:07:14 +0200
From: "Vincent Vanbiervliet" <vincent_vanbiervliet@be.ibm.com>
Subject: What is the meaning of '.' in @INC?
Message-Id: <3745757c@news.uk.ibm.net>
I have this in my @INC:
==BEGIN==
d:\Perl\lib
d:\Perl\site\lib
.
===END===
I was expecting that the '.' (dot) was refering to the current directory
(I'm on a Winxx system), and thus a require would work with any files in the
directory of my current script.
This works on the command line, but not with my webserver. For example, if I
use a require in /cgi-bin/asubdir/ascript.pl, and I have that 'required'
file in /cgi-bin/asubdir/, it doesn't work.
Why not?
------------------------------
Date: 21 May 1999 11:58:24 -0400
From: Victor Eijkhout <eijkhout@prancer.cs.utk.edu>
Subject: while ( <FILE> && /match/ )
Message-Id: <omyaiipg7z.fsf@prancer.cs.utk.edu>
Ok, so that doesn't work. Why?
Right now I'm writing
$_=<FILE>;
while ( /match/ ) { .... ; $_=<FILE>; }
which is ugly.
(Perl is weird, but I cn see myself getting to like it.)
--
Victor Eijkhout
"What i understood he said was that it is a sick society that allows
children to go to school dressed in black trenchcoats."
[phil, on Charlton Heston's speech to the NRA]
------------------------------
Date: 21 May 1999 09:12:58 -0700
From: gerg@shell1.ncal.verio.com (Greg Andrews)
Subject: Re: while ( <FILE> && /match/ )
Message-Id: <7i40ma$abr$1@shell1.ncal.verio.com>
Victor Eijkhout <eijkhout@prancer.cs.utk.edu> writes:
>Ok, so that doesn't work. Why?
>
>Right now I'm writing
>
>$_=<FILE>;
>while ( /match/ ) { .... ; $_=<FILE>; }
>
>which is ugly.
>
Yes it is. Since you don't explain what else you're
doing beyond reading the line and testing for a match,
I have to make a guess at what will work for you.
How about:
# read lines from the file
while (<FILE>) {
# skip the lines that don't match
next unless /match/;
# process the lines that do match
.
.
.
}
# you get here only when you run out of lines in the file
or:
# read lines from the file
while (<FILE>) {
# exit the loop on the first line that doesn't match
last unless /match/;
# process the lines that do match
.
.
.
}
# you get here when you find a non-matching line
# or when you run out of lines in the file
-Greg
------------------------------
Date: 21 May 1999 16:33:39 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: while ( <FILE> && /match/ )
Message-Id: <7i41t3$kqf$3@fcnews.fc.hp.com>
Victor Eijkhout (eijkhout@prancer.cs.utk.edu) wrote:
: Ok, so that doesn't work. Why?
: Right now I'm writing
: $_=<FILE>;
: while ( /match/ ) { .... ; $_=<FILE>; }
: which is ugly.
while(<FILE>) actually means while(defined($_=<FILE>)), but if you add
stuff to it, you break it (kind of like alfredo sauce).
So you really want
while($_=<FILE> and /match/) {...
(you could use &&, but then you'd need more parentheses...)
: (Perl is weird, but I cn see myself getting to like it.)
Good start. Pretty soon that "but" will turn into a "thus".
Andrew
------------------------------
Date: Fri, 21 May 1999 13:28:23 -0300
From: Arved_37@chebucto.ns.ca (Arved Sandstrom)
Subject: Re: XML::XQL
Message-Id: <Arved_37-2105991328230001@dyip-118.chebucto.ns.ca>
In article <ebohlmanFC0LyG.436@netcom.com>, Eric Bohlman
<ebohlman@netcom.com> wrote:
> Steve Farris <nlymbo@mindspring.com> wrote:
> : I looked at it, and got it to work up to a point, but the real problem
> : is that I don't know which method allows access to the *data* inside
> : the tags returned by the query. For instance,
>
> [snip]
>
> : OK, at this point, @result will contain hash references, one for each
> : author tag found. the problem i am having is getting at the actual
> : data contained in the author tag. It's a serious OO deficiency on my
> : part, but one i am trying to overcome. Gracias para todo ayuda!
>
> Those hash references are references to DOM nodes, so you use the DOM
> methods to get at the data. Therefore, you need to read the docs for
> XML::DOM.
At this point you probably want simple verification that you're getting
stuff back. :-) As Eric said it's all DOM now. Take each element of your
result array, and print out the effects of the toString() method.
Arved
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5743
**************************************