[13602] in Perl-Users-Digest
Perl-Users Digest, Issue: 1012 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 7 11:05:40 1999
Date: Thu, 7 Oct 1999 08:05:08 -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: <939308707-v9-i1012@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 7 Oct 1999 Volume: 9 Number: 1012
Today's topics:
Re: (?p{}) was [Re: Backreference in Regex Code Block?] <ltl@rgsun5.viasystems.com>
Re: (?p{}) was [Re: Backreference in Regex Code Block?] (Bart Lateur)
Broken Pipe? <Nick@ucecom.com>
Re: buffers and serial ports (Bbirthisel)
Re: Caliing method by reference with arrow operator <siv@helpco.kiev.ua>
Re: Das GlasPerlenspiel <bowman@montana.com>
Re: Das GlasPerlenspiel <ltl@rgsun5.viasystems.com>
Data Inheritance and XS <crdevilb@mtu.edu>
Error: Runtime Exception <-- on longrunning sub <baal@c2i.net>
help for a perl script <wye@cse.psu.edu>
Re: How to write bits and bytes to files (Leon Brocard)
Re: How to write bits and bytes to files? <simon@profero.com>
html strip regexp error (ton)
Magic #! line problem (Anno Siegel)
Re: Memory leak in assignment <dan@tuatha.sidhe.org>
Newbie Perler Needs simple parse help... <bkovac@gmx.net>
Re: non blocking joins of Threads? <dan@tuatha.sidhe.org>
Re: odd or even numbers? <ak@dasburo.de>
Passwords <namecity@my-deja.com>
Re: Perl and GTK <goralg@friko2.onet.pl>
Perl Doc.. <bkovac@gmx.net>
Re: Perl Error as CGI under Apache/2 reedjd@bitsmart.com
Re: reading binary data files <greenej@my-deja.com>
Re: Test if file contains certain text (Alexandre Amelin)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 7 Oct 1999 14:21:46 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: (?p{}) was [Re: Backreference in Regex Code Block?]
Message-Id: <7tia9q$rfn$2@rguxd.viasystems.com>
Kenneth Bandes <kbandes@home.com> wrote:
:>lt lindley wrote:
:>>
:>> Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
:>> :>[A complimentary Cc of this posting was sent to lt lindley
:>> :><lee.lindley@bigfoot.com>],
:>> :>who wrote in article <7th182$gac$1@rguxd.viasystems.com>:
:>> :>> This looks like a recursion that continues as long as $foo continues
:>> :>> to match. But $foo has to stop matching at some point. Why make the
:>> :>> fact that $foo must fail eventually cause the entire re to return
:>> :>> false? Make it DWIM.
:>$foo doesn't have to fail. It just has to stop recursing. That's
:>why you have the | in it. The non-recursive case succeeds but
:>still stops the recursion.
I understood that. I just don't see why I should have to provide
for that case when I can't see any useful situation where you would
write it without the |.
--
// Lee.Lindley /// I used to think that being right was everything.
// @bigfoot.com /// Then I matured into the realization that getting
//////////////////// along was more important. Except on usenet.
------------------------------
Date: Thu, 07 Oct 1999 14:29:27 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: (?p{}) was [Re: Backreference in Regex Code Block?]
Message-Id: <37fdacc6.7890195@news.skynet.be>
lt lindley wrote:
>The non-recursive case succeeds but
>:>still stops the recursion.
>
>I understood that. I just don't see why I should have to provide
>for that case when I can't see any useful situation where you would
>write it without the |.
Because that may not be the case you want to check for.
Suppose you're looking for a pattern that starts with n "<"'s then one
"#", and finally n ">"'s, for example: "<<<<#>>>>".
Then the regex would become
$foo = qr{ < $foo > # Postponed $foo in brackets
| \# # Or "#"
}px;
I don't want to match "<<>>". I'm only interested in "<<#>>". Would you
deny me that possibility?
--
Bart.
------------------------------
Date: Thu, 7 Oct 1999 15:03:47 +0100
From: "Nick Liebmann" <Nick@ucecom.com>
Subject: Broken Pipe?
Message-Id: <7tiaen$le0$1@nclient9-gui.server.ntli.net>
Hi...
I get a sporadic problem in that the Unix server I am using, gives me a
'Broken pipe error'.
However, I check and rechek the script and can see nothing wrong with them..
And then the error disappears, do you think it could be a browser issue or
the method of posting.
Cheers
--
Nick Liebmann
nick@ucecom.com
http://www.ucecom.com
------------------------------
Date: 07 Oct 1999 14:19:11 GMT
From: bbirthisel@aol.com (Bbirthisel)
Subject: Re: buffers and serial ports
Message-Id: <19991007101911.29124.00000046@ng-fq1.aol.com>
Hi Jerry:
> I've written perl code that captures incoming data on a serial port.
>It seems to work fine except I just discovered there's a buffer of data
>hanging around that the code doesn't see until more data pushes it
>through. Anybody know where, in a solaris 2.6 system, this might be
>occurring and how do I get around it?
It is not specific to Solaris or serial ports.
>Here's the code. The x'01 is "start-of-data" while the x'04 is
>"end-of-data".
>
>do
>{
> $file_text .= $buffer;
> $buffer = <FEED>;
> } until ( $buffer =~ /\04/o) ;
The <FEED> reads a line of data at a time (e.g. from one
"\n" to the next unless you changed $/). Since I don't know
how big a transmission might be, or whether there might be
"garbage" between them, I can't say what the best approach
might be. But one possibility would look like:
{
local $/ = 0x04;
$buffer = <FEED>; # returns up to \004
$buffer = s/^[^\001]*?//; # strips before \001
}
# buffer can contain embedded "\n" - so a split might be
# needed downstream
Hope this helps. I had no representative data to test.
-bill
Making computers work in Manufacturing for over 25 years (inquiries welcome)
------------------------------
Date: Thu, 7 Oct 1999 17:37:09 +0200
From: "Igor V. Solodovnikov" <siv@helpco.kiev.ua>
Subject: Re: Caliing method by reference with arrow operator
Message-Id: <939307092.663565@Stalker.Alfacom.net>
Thanks! I have tried your example and it does works. Especially next line:
> print "3: ", $self->$methodref(), "\n";
I thoght i've tried such syntax but in somewhat misterious way i didnt.
One more question: What if reference isnt stored in scalar variable?
(Something like $self->{table}[0]) Can i use such reference without
assigninig it to scalar?
------------------------------
Date: Thu, 07 Oct 1999 07:45:43 -0600
From: bowman <bowman@montana.com>
Subject: Re: Das GlasPerlenspiel
Message-Id: <37FCA407.E370AA@montana.com>
Fujitsu Australia Limited wrote:
>
> There's a great article in The Perl Journal issue 14 - Building a Better
> Hash, by Dan Schmidt. It introduces the whole blessed thing:
Thanks, I'll have to check it out. I will admit my comments were a
little tounge in cheek -- I've just never hit a language that uses that
sort of light hearted terminology for its concepts.
While on the topic, though, the Camel's OO section seems to me to ramble
a bit. Most C++ books on the Camel's level, for instance, do not go into
the internals of vtable building, or the way the 'this' pointer is
handled. With Perl, the section reads more like an explanation of how to
implement classes using straight C might. On one hand, I appreciate the
additional insight into the mechanics; on the other hand an expansion on
the more goal oriented approach in the perltoot. Some people are never
happy.......
-
Bear Technology Making Montana safe for Grizzlies
http://people.montana.com/~bowman
------------------------------
Date: 7 Oct 1999 14:07:11 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: Das GlasPerlenspiel
Message-Id: <7ti9ef$rfn$1@rguxd.viasystems.com>
Fujitsu Australia Limited <andrew.yuen@fujitsu.com.au> wrote:
:>bowman wrote in message
[snip]
:> The Perl approach is very different. For
:>example- it just asks people to be considerate and follow the rules when
:>using modules, rather than having systems in place to prevent access to
:>private data.
Perl allows you to make the data truly private if you want. If you
put your data in file scoped lexicals only the methods defined in
that file will be able to access the values directly. All others
have to ask nicely.
--
// Lee.Lindley /// I used to think that being right was everything.
// @bigfoot.com /// Then I matured into the realization that getting
//////////////////// along was more important. Except on usenet.
------------------------------
Date: 7 Oct 1999 14:47:42 GMT
From: "Colin R. DeVilbiss" <crdevilb@mtu.edu>
Subject: Data Inheritance and XS
Message-Id: <7tibqe$dap$1@campus3.mtu.edu>
I am using perl/Gtk to develop an interface, and I would like to create
a subclass of Gtk::Window which would have an ``attached'' data member
of my own class. My intention is to pass Foo::Gtk::BarWindow a reference
to a Foo::Bar at creation time so that user actions on the BarWindow can
affect the Foo::Bar.
Since a Gtk::Window is really a C struct hidden behind XS, I don't see
how to add a data member to it.
Solutions I have considered:
1) making Foo::Gtk::BarWindow a new aggregate data structure which
contains both a Foo::Bar and a Gtk::Window, but then the @ISA
relationship won't work unless there is some way (that I don't know)
to pass that information up the inheritance tree.
2) in Foo::Gtk::Barwindow::new, connecting all the signals (callbacks,
for those with different toolkit experience) to closures which
include the Foo::Bar object. Right now this solution seems like
probably the best, but it would be far preferable to actually
aggregate the Foo::Bar into the BarWindow if possible.
if anyone has ever dealt with a similar situation, I would appreciate
hearing about any considered or chosen solutions.
thank you for your time.
Colin R. DeVilbiss
crdevilb@mtu.edu
------------------------------
Date: Thu, 07 Oct 1999 13:58:24 GMT
From: "[L] Vicious!" <baal@c2i.net>
Subject: Error: Runtime Exception <-- on longrunning sub
Message-Id: <4G1L3.240$G13.1041@juliett.dax.net>
I just got a strange errormessage. I made a program using Perl/Tk, and a
button which starts a sub which reads files on the HD. If I point the sub to
a directory with many files (eg. 500), my program crashes and perl shows me
the errormessage:
Error: Runtime Exception
On the other hand, if I point my sub to a small dir containing about 50
files, my program works fine. It seems that when I call the sub from a
button, my program crashes if the sub takes more than about a sec or so. But
when I called the sub with the Bind-command, this problem never occurs.
Where did I go wrong?
Thnx! d=O)
------------------------------
Date: Thu, 07 Oct 1999 09:44:40 -0400
From: Wu Ye <wye@cse.psu.edu>
Subject: help for a perl script
Message-Id: <37FCA3C8.AC14303D@cse.psu.edu>
Hi all the perl expert there,
I just start learning perl. I need some help on a simple perl script.
I want a script taking a
file name as input. The file contains some assembly code like following:
add $1,$2,$3
move $sp,$fp
sub $5,$6,$7
move $8,$9
move $p,$k
.....
I need to replace all lines begun with "move", for example:
move $sp,$fp ===> addu $sp,$0,$fp
move $8,$9 ===> addu $8,$0,$9
also, I need to replace all "$p" to "$testp".
Thanks a lot. If you reply, please send me a copy to my email
address.
-- Wu Ye
------------------------------
Date: 7 Oct 1999 13:44:32 GMT
From: acme@tigger.netcraft.com (Leon Brocard)
Subject: Re: How to write bits and bytes to files
Message-Id: <slrn7vp869.3m8.acme@tigger.netcraft.com>
Simon Wistow typed out randomly:
] Argument "`" isn't numeric in right_shift at Foo.pm line 107.
]
] Followed by a hideous mass of messages looking like
] IO::File=GLOB(0x8057c78)
Hmmmm. Well your code looks as if it might be able to do
something like you said, but unfortunately you only provided
a fragment, so it's hard to tell.
Are you sure that $self->{_bitPos} is numeric at all times?
- that's the error message you're getting.
Why don't you put the module and a test program up on the
web somewhere and point us to it?
Perl kinda needs a module for reading and writing arbitrary bits
out of files. I hope you're thinking of contributing this to
CPAN ;-)
Leon
--
Leon Brocard................................http://bath.pm.org/
leon@netcraft.com........................http://www.astray.com/
... Honey, PLEASE don't pick up the PH$@#*&$^(#@&$^%(*NO CARRIER
------------------------------
Date: Thu, 07 Oct 1999 15:32:37 +0100
From: Simon Wistow <simon@profero.com>
Subject: Re: How to write bits and bytes to files?
Message-Id: <37FCAF05.AF938699@profero.com>
> Why don't you put the module and a test program up on the
> web somewhere and point us to it?
>
> Perl kinda needs a module for reading and writing arbitrary bits
> out of files. I hope you're thinking of contributing this to
> CPAN ;-)
There is *ALOT* wrong with this at the moment. it doesn't check if you've opened
something for reading and then tried to write for it for a start, I'm still just
trying to play around with code.
Alot of this code was ripped off stuff done by Michael J Wallace at
http://www.sabren.com and the swfparse.cpp file at
http://homepages.tig.com.au/~dkl/swf/. I haven't had much time to play around
with it, the write fucntion was written at 3am while I was waiting for something
to compile but I'll do more when I have time (hopefully it's going to form the
basis of a suite of SWF IO and manipulation modules for a college project)
<example code>
my $filename = shift || die "You must supply a file name\n";
$bin = new Binary($filename) || die "File not read!\n";
$bin->getBytes(3) =~ /^FWS$/ or die "'$filename' is not valid SWF file\n";
print "\n\n---- start of headers ----\n";
print "'$filename' is a valid SWF file ... \n";
print "Version : ".unpack("C",$bin->getBytes(1))."\n";
print "File Length : ".unpack("L",$bin->getBytes(4))." bytes\n";
my $n = $bin->getBits(5);
print "Size in twips ...\n";
print "\txmin - ".$bin->getSBits($n)."\n";
print "\txmax - ".$bin->getSBits($n)."\n";
print "\tymin - ".$bin->getSBits($n)."\n";
print "\tymax - ".$bin->getSBits($n)."\n";
print "Frame Count : ".unpack("S",$bin->getBytes(2))."\n";
print "Frame Rate : ".unpack("S",$bin->getBytes(2))."\n";
print "---- end of headers ----\n\n";
</example code>
<module code>
## File::Binary ##
package Binary;
use strict;
use Exporter;
use IO::File;
use vars qw(@ISA @EXPORT_OK $DEBUG);
@ISA = qw(Exporter);
@EXPORT_OK = qw(getBytes getBits getSBits readTag write seek);
$DEBUG = 1;
########################################################################
sub new {
my ($class, $filename) = @_;
my $self = {};
my $fh = new IO::File($filename) || return; # returns undef on error
$self->{filename} = $filename;
$self->{_bitPos} = 0;
$self->{_bitBuf} = 0;
$self->{debug} = $DEBUG;
$self->{fh} = $fh;
bless $self, $class;
return $self;
}
sub getBytes {
my ($self, $bytes) = @_;
my $data;
my $fh = $self->{fh};
# sysread BIN, $data, $bytes;
read $fh, $data, $bytes;
return $data;
}
sub getBits {
my ($self, $bits) = @_;
my $data = 0; # the return value
for (;;)
{
# we want to know if we should use the whole byte.
my $s = $bits - $self->{_bitPos};
if ( $s > 0 ) {
# all these bits are ours
$data |= $self->{_bitBuf} << $s;
$bits -= $self->{_bitPos};
# get the next buffer
$self->{_bitBuf} = unpack("C",$self->getBytes(1));
$self->{_bitPos} = 8;
} else {
# this is our last byte, take only the bits we need
$data |= $self->{_bitBuf} >> ( -$s );
$self->{_bitPos} -= $bits;
# mask off the consumed bits
$self->{_bitBuf} &= 0xff >> (8 - $self->{_bitPos});
return $data;
}
}
}
# same as _GetBits, but signed
sub getSBits {
my ($self, $bits) = @_;
my $data = $self->getBits($bits);
# Is the number negative?
if ($data & (1 << ($bits - 1))) {
# Yes. Extend the sign.
$data |= -1 << $bits;
}
return $data;
}
# could do with a seek here at some point
sub seek {
return;
}
# writes bytes to the file handle
# !!! NEED TO CHECK IF WE'RE WRITING OR READING !!!
sub write {
my ($self, $d, $size) = @_;
my $fh = $self->{fh};
my $data = pack("B$size",$d);
for (;;)
{
$self->{_bitBuf} |= $data >> $self->{_bitPos};
# Do we have at least enough to fill the buffer?
if (($self->{_bitPos} + $size)>=8)
{
# Yes. Fill it, write it and go again
print ($fh, pack("B8",$self->{_bitBuf}));
$data = $data << (8- $self->{_bitPos});
$size -= $self->{_bitPos};
$self->{_bitPos} = $self->{_bitBuf} = 0;
}else{
# No. Fill up as much of the buffer as we can
$self->{_bitPos} += $size;
# ... and return
return;
}
}
}
sub close {
my ($self) = @_;
# should write out anything left in $self->{_bitBuf} aswell
$self->{fh}->close;
return;
}
# keep Perl happy
1;
</module code>
------------------------------
Date: 7 Oct 1999 13:50:33 GMT
From: no@email.com (ton)
Subject: html strip regexp error
Message-Id: <7ti8f9$8n7$1@enterprise.cistron.net>
Hi,
Via the FAQ I got this regexp to strip HTML tags:
$val =~ s{<(?:[^>'"]*|".*?"'.*?')+>}{}gsx; # mutate into nada, nothing, and niente
I'm using this statement to strip HTML from a string.
In a CGI environment.
Now I get servererrors:
/<(?:[^>'"]*|".*?"'.*?')+>/: regexp *+ operand could be empty
Can any help to fix the expression, because it's a bit abracadabra to me.
Regards,
Ton
------------------------------
Date: 7 Oct 1999 13:25:27 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Magic #! line problem
Message-Id: <7ti707$eg4$1@lublin.zrz.tu-berlin.de>
<Sandeep.Bhagwat@kla-tencor.com> wrote in comp.lang.perl.misc:
>I am trying to write a perl script for a HP-UX where the location of
>perl need not be /usr/local/perl.
>
>The script starts as follows.
>
>#!/bin/sh -- # -*- perl -*-
>
>eval 'exec perl $0 ${1+"$@"}
> if 0;
>
>BEGIN { require 5.003 }
>
>$::VERSION = sprintf "%d.%02d", "1", "45";
>
>And then it goes with the normal strings processing.
>
>The script works OK on SunOS4 and Solaris but when I try to run the
>script on HP, sh gives an error, '-- # perl: invalid flag'.
Well, HP-UX seems so have two sh's, one in /bin, and another one
in /bin/posix. The first one apparently doesn't understand the
"--" to end option processing. On the other hand, the posix shell
seems to have problems with "-*-" for some reason I don't care
to figure out.
Anyway, to make this somewhat dated technique to invoke perl
work on HP-UX, you need to change to something like
#!/bin/posix/sh -- perl -w
eval 'exec perl $0 ${1+"$@"}'
if 0;
but if you have to do that (it's not portable to Solaris), you
might as well put the correct path to perl in the hashbang line.
Oh, and i tried this on some antique version of HP-UX, so YYMV.
Anno
------------------------------
Date: Thu, 07 Oct 1999 14:19:48 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Memory leak in assignment
Message-Id: <8_1L3.80$ck6.12727@news.rdc1.ct.home.com>
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
> [A complimentary Cc of this posting was sent to Dan Sugalski
> <dan@tuatha.sidhe.org>],
> who wrote in article <vNHK3.6154$S32.14705@news.rdc1.ct.home.com>:
>> Actually, it's more like 220 Meg (Well, 260M with the list overhead). Perl
>> scalars are 22 bytes a pop, more or less, plus the size of your string
>> buffer (if it's been stringified) plus any extra magic.
> ??? Are on architecture with 11-byte words, or what? ;-)
You mean you don't develop on a TOPS-20 machine? :-P
> I think there is some discussion of overhead of Perl storage in
> perldoc perddebug
I'll go you one better. Let's take a look at sv.h:
struct sv {
void* sv_any; /* pointer to something */
U32 sv_refcnt; /* how many references to us */
U32 sv_flags; /* what we are */
};
and
struct xpviv {
char * xpv_pv; /* pointer to malloced string */
STRLEN xpv_cur; /* length of xpv_pv as a C string */
STRLEN xpv_len; /* allocated size */
IV xiv_iv; /* integer value or pv offset */
};
Actually, adding things up I see I mis-counted--it's *28* bytes per integer
scalar. Add between 4 and 20 bytes if you're building with 64-bit support.
(20 bytes if STRLEN goes to 8 bytes, 12 if it stays 4. Assuming pointers
go to 8 bytes--subtract 8 bytes if pointers stay 32-bit)
Dan
------------------------------
Date: Thu, 7 Oct 1999 16:25:17 +0200
From: "Bruno Kovac" <bkovac@gmx.net>
Subject: Newbie Perler Needs simple parse help...
Message-Id: <7tiaen$glu$1@as102.tel.hr>
Can someone help me make a simple parse....
I got ip address list.. in a file I open that.. read lines...
and now I need to strip last number in ip..
ie: 124.56.34.56
how can I remove .56 ?
tnx...
with split()?
please reply me a simple looking code and optimized... tnx
------------------------------
Date: Thu, 07 Oct 1999 14:29:05 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: non blocking joins of Threads?
Message-Id: <R62L3.81$ck6.12727@news.rdc1.ct.home.com>
Alexander Knack <ak@dasburo.de> wrote:
> hi,
> the documentation says that join waits blocking.
> how may one modify the code above, so that the join is nonblocking.
> something like
> while (! all threads finished) {
> if (thread id N finished) { do this } else { do that }
> }
You need to add in extra code--have your threads set a global indicator, or stick
objects representing themselves on a Queue that you check, or something of the sort.
There is currently no non-blocking join, and there is no way to tell (without the
explicit cooperation of your own code) if a thread's finished.
OTOH, if all you're doing is joining all the threads you spawned, it doesn't really
matter what order you join them in, since you need to get 'em all in the end
anyway.
Dan
------------------------------
Date: Thu, 07 Oct 1999 15:13:52 +0200
From: Alexander Knack <ak@dasburo.de>
To: homeless <homelessinseattle@yahoo.com>
Subject: Re: odd or even numbers?
Message-Id: <37FC9C90.490A7C40@dasburo.de>
> >: >Does anybody know if there is an easy way to check whether a scalar
> value
> >: >contains a odd or even integer?
do you mean domething like
my $odd = $x % 2;
or am i completely wrong?
--
+--------------------------------------------------------------------+
| Alexander Knack ........Entropie erfordert keine Wartung .........|
| dasburo.de ..................................................|
+--------------------------------------------------------------------+
------------------------------
Date: Thu, 07 Oct 1999 13:43:10 GMT
From: q2020262 <namecity@my-deja.com>
Subject: Passwords
Message-Id: <7ti81b$lvt$1@nnrp1.deja.com>
Hi
At present I am creating a small program that will set-up web space and
passwd, and send then send out the details in an email. Does anybody
know how to set-up a passwd in a passwd kind of way?
I've tried the passwd command but I am unable to pass the password to
it, I'm using /etc/passwd and /etc/shadow so to just add a line with a
bit of encryption in it. I've tried reading books and found nothing,
I've tried reading reading these newsgroup and they just add to the
confusion. I'm now getting desperate.
Thanks
sc
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 07 Oct 1999 15:49:08 +0200
From: "G.G." <goralg@friko2.onet.pl>
Subject: Re: Perl and GTK
Message-Id: <37FCA4D3.8FA3B545@friko2.onet.pl>
> You can check the examples in the source tarball.
> If you build the latest release (0.6123) or the version from the gnome
> cvs server you get also a reference manual in pod format.
Thanks!
But any manuals would be also usefull :-)
Grzegorz
------------------------------
Date: Thu, 7 Oct 1999 16:27:11 +0200
From: "Bruno Kovac" <bkovac@gmx.net>
Subject: Perl Doc..
Message-Id: <7tiai8$q7d$1@as102.tel.hr>
where can I get list of perl commands and help for each command?
------------------------------
Date: Thu, 07 Oct 1999 14:08:19 GMT
From: reedjd@bitsmart.com
Subject: Re: Perl Error as CGI under Apache/2
Message-Id: <7ti9ga$n5j$1@nnrp1.deja.com>
You're right, but I'm unsure how to proceed to fix it.
I have the line:
SET PERLLIB_PREFIX=f:/;c:\emx\
setup in the CONFIG.SYS file so it should set the environment variable
globally.
Still, I wrote another cgi that would just spit out the environment and
when I run it through my webserver I learn that the environment doesn't
have any of my variables setup in the CONFIG.SYS file except for PATH,
and that doesn't get me much.
So, now I'm wondering where I can set various needed perl environment
variables that Apache will be able to read them for it's CGI execution
environment.
-Jordan
In article <7te9kc$mr4$1@charm.magnus.acs.ohio-state.edu>,
ilya@math.ohio-state.edu (Ilya Zakharevich) wrote:
> [A complimentary Cc of this posting was sent to
> <reedjd@bitsmart.com>],
> who wrote in article <7te69h$r1e$1@nnrp1.deja.com>:
> > I have a CGI script running on my apache server under OS/2 that
> > currently runs beautifully. If I add a line into:
> >
> > use Shell;
> >
> > the cgi gives an error, but the perl script still runs without
problem
> > if I run it from the command line.
>
> You have your set PERLLIB_PREFIX= line in a wrong place. Your shell
> has it set, your Apache does not see it.
>
> Ilya
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 07 Oct 1999 13:01:44 GMT
From: JAG <greenej@my-deja.com>
Subject: Re: reading binary data files
Message-Id: <7ti5jh$k8c$1@nnrp1.deja.com>
# perldoc -f pack
--
# James Greene - Informatics Consulting - 79539 Loerrach, Germany
# http://www.informatics-consulting.com
# mailto:greene.NOSPAM@informatics-consulting.com
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 07 Oct 1999 15:09:50 +0200
From: aamelin@mmm.com (Alexandre Amelin)
Subject: Re: Test if file contains certain text
Message-Id: <37FC9B9D.C9F5D75A@mmm.com>
The solution is to make a grep on your file. Lioke this :
sub lookfor _text
{
open (LOG,$file) || next BCLE; # opening text file
open (SORTIE,">$sortie") || die "mkdir failed"; # Result file
# GREP THE FILE $tab[$num]contains all your sentences youare looking for
#
$code_c = 'while (<LOG>) {';
$code_c .= 'if (/';
$code_c .= join ('/i || /', @cle);
$code_c .= '/) {$tab[$num] = $_; $num++; $compteur++}}'; # LES ERREURS
SONT MIS DS @tab
eval $code_c;
die "Erreur programme de Survey ---: $@\n" if ($@);
}
Good work,
Hal
tomschenk@my-deja.com wrote:
> Hi-
>
> I know this is probably easy, and yes, I have searched to find the
> answer, but can't.
>
> So--I am trying to write a script which accepts form input from a web
> page, then checks a text file to see if that text is already in that
> file. If it isn't, I want to add it to the end of the file. I already
> know how to process the form, open the file, and write to the file, I
> just can't figure out how to see if the text is already there. The
> text file is just a list of words--that's all, one per line. Can
> someone help??? Thanks!
>
> Tom
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Opinions expressed herein are my own and may not represent those of my employer.
------------------------------
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 1012
**************************************