[8809] in Perl-Users-Digest
Perl-Users Digest, Issue: 2426 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Apr 27 09:07:31 1998
Date: Mon, 27 Apr 98 06:00:55 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 27 Apr 1998 Volume: 8 Number: 2426
Today's topics:
"Slurp"? <jimmer@charm.net>
Re: 'each' and recursion, do they mix? <jll@skynet.be>
Any sock (client/server) module ? andrewl@tnl.com.au
Re: Appending Lines 1&2, 3&4, ETC., (Craig Berry)
Cant call method prepare without package or object refe <GKEERMAN@VDAB.BE>
Re: Cant call method prepare without package or object <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: Defending Perl <fecund@fatnet.net>
finding a PERL compiler for Open-VMS (Alpha) <computer@saad.org.il>
Re: How strong is the perl crypt function ? <dformosa@st.nepean.uws.edu.au>
Re: http Reg Exp (Kevin Reid)
If you solve this your are FANTASTIC! and it's somethin stevenf@pcdynamics.nl
Re: image size for jpg and/or gif <admin@hatsoft.com>
Looking for example of IO::Socket for UDP Server <enaiman@ndsisrael.com>
Re: matching man page lines (John Erjavec V)
Memory leak when embedding perl <panning@thomtech.com>
o-modifier <robban@it-konsult.com>
Re: Perl-only distribution (was Re: How do I build Linu <lamber45@EGR.msu.edu>
Re: Perl-only distribution <lamber45@EGR.msu.edu>
Porting Perl script to machine w/out perl! <yashesh@eecs.berkeley.edu>
Problems with Perl performance on AS400 <lwoolsey@innovative.ca>
Re: QUESTION: How do I print file contents to screen? (Paul)
Runtime Error in Perl <seo@sorona.se>
Undefined pTk's mainloop in package ikarn@otenet.gr
WEIRD PROBLEM IE4 <thijs@esense.nl>
weird problem with ie4 <thijs@esense.nl>
Re: Win32 & Process listing <igor.k@usa.net>
win32::registry (queryvalue) <seo@sorona.se>
Re: win32::registry (queryvalue) <jdporter@min.net>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 27 Apr 1998 08:33:30 -0400
From: root <jimmer@charm.net>
Subject: "Slurp"?
Message-Id: <ogxnla05.fsf@jimmer.charm.net>
I vaguely remember seeing a technique once where an entire input file
is read in with a single command, carriage returns and all. My poor
memory also seems to think it was called "slurping" the file, but I
cannot find any reference to it in the camel book, the newsgroup, or
the FAQ. Is there such a thing. If so, how is it done (and what is
it really called)?
Thank you.
--
John Guthrie
------------------------------
Date: Mon, 27 Apr 1998 11:48:48 +0200
From: Jean-Louis Leroy <jll@skynet.be>
Subject: Re: 'each' and recursion, do they mix?
Message-Id: <VA.000000a4.0f7c0ed0@jll>
> Probably you did not think about it, did you? WHERE do you want to
> keep this info?
Hey, I'm not a p5p yet :o)
> You have either keep it in %hash
The problem would be solved if that information was local-izable
> in one of Perl's internal stacks
Why not?
> Or associated to the chunk of code.
That would cause problem with multithreading, wouldn't it?
> First choice is the current one, the other two will give non-intuitive
> behaviour in *most* of the cases.
Hmm, could you give example(s)? OTOH, the current behavior is
counterintuitive even when recursion is not used: the only way you can
be sure of what 'each' returns is to say 'keys' or 'values' to the hash
beforehand.
I wonder how much 'each' is actually used.
> Without creating a new *iterator* object (which will keep this info)
That would be useful. And I'd want one for arrays as well.
> And then you suddently
> discover that you need to know what to do with iterator if the hash
> changes...
We could simply say, ` la Camel p. 159: "You must not add elements to
the hash while there exist iterators on it".
Can you tell us why the 'obvious' method is twice faster than using
'each'? I still have a hard time believing it. Or, perhaps, my benchmark
is flawed?
Jean-Louis Leroy
http://ourworld.compuserve.com/homepages/jl_leroy
------------------------------
Date: Mon, 27 Apr 1998 02:09:58 -0600
From: andrewl@tnl.com.au
Subject: Any sock (client/server) module ?
Message-Id: <6i1b06$f2o$1@nnrp1.dejanews.com>
Hi,
Is there a simple way to write simple client/server sock perl script ?
Like tcp/dp.
I would like to write a client script to send and execute a command
on the server. The server will validate the command before execute,
and maybe send some feedback back to the client.
I can write these very easy using tcl/dp. Maybe no more than 20 lines
of code for each client and server script.
Thanks
Andrew
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 27 Apr 1998 06:06:48 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Appending Lines 1&2, 3&4, ETC.,
Message-Id: <6i179o$1uc$1@marina.cinenet.net>
Dan Boorstein (danboo@negia.net) wrote:
: if i'm understanding this correctly, you simply want to 'chomp' (safer
: than 'chop') odd numbered lines. if so, do so:
:
: while(<DATA>) {
: $. % 2 && chomp; # '$.' is the current input line number
: print;
: }
A perhaps more common and transparent way to express the second line would
be:
chomp unless $. % 2;
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Mon, 27 Apr 1998 12:31:19 +0200
From: Keerman Gino <GKEERMAN@VDAB.BE>
Subject: Cant call method prepare without package or object reference
Message-Id: <35445E76.B135888E@VDAB.BE>
I have a problem with the execution of a perl program that calls a perl
module. as argumeents I give the database handle connection that is made
in the program. When I use that parameter in the perl module the
complains about Cant call method "prepare" without package or object
reference.
Can somebody help me please?
Please mail me at Jan.Casteels@advalvas.be
Thans a lot
------------------------------
Date: 27 Apr 1998 12:55:25 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Cant call method prepare without package or object reference
Message-Id: <7xg1izh6ua.fsf@beavis.vcpc.univie.ac.at>
Re: Cant call method prepare without package or object
reference, Keerman <GKEERMAN@VDAB.BE> said:
Keerman> I have a problem with the execution of a perl
Keerman> program that calls a perl module. as argumeents I
Keerman> give the database handle connection that is made in
Keerman> the program. When I use that parameter in the perl
Keerman> module the complains about Cant call method
Keerman> "prepare" without package or object reference.
Keerman> Can somebody help me please?
Not if you don't post the code that is causing the problem.
If you don't want to post the real code, write a small
example program that exhibits the incorrect or unexpected
behaviour, and post that. Show what you expected to happen,
and what actually happened.
tony
------------------------------
Date: Sun, 26 Apr 1998 23:35:38 -0700
From: "yary h." <fecund@fatnet.net>
Subject: Re: Defending Perl
Message-Id: <3544273A.6986@fatnet.net>
My company has a largish product that involves a few perl scripts.
We're most likely gonna conver the installer to perl & pTk. Installing
perl isn't a big deal- a shell script to copy the executable into
a bin directory, and to copy the libraries somewhere, and to set
the PERL5LIB environment variable. Yes, INC ends up with some
extra directories, but that's not a problem so long as PERL5LIB is
set. And that's easy enough for a shell script to do.
Aside: is it really necessary to recompile perl? I haven't tried
this, but it looked like editing the config module would be enough.
-y
------------------------------
Date: Mon, 27 Apr 1998 15:12:39 -0700
From: Computer Division - Kibbutz Saad <computer@saad.org.il>
Subject: finding a PERL compiler for Open-VMS (Alpha)
Message-Id: <354502D7.BB7@saad.org.il>
I'm looking for a "free" compiler to use on my Open-VMS system running
on Digital's Alpha chip. Can anyone direct me to a site for PERL or
other language?
Thanks.
David
------------------------------
Date: 27 Apr 1998 10:45:36 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: How strong is the perl crypt function ?
Message-Id: <893673936.202279@cabal>
In <6scFmyvFZZB@wharp.rhein-main.de> haert@wharp.rhein-main.de (Michael Haertfelder) writes:
[...]
>But how strong is this really ? In other words: How many hours does it
>take for an expert with a Pentium 300MHZ machine and the best known crypto
>analysis program to decrypt such data ?
The first thing that must be said is that cyrpt(3) (the crypt function in
perl) is a one way hash not a encryption device in the normal sence.
The crypt(3) function in perl is based on DES. There are programs out
there wich try to guess the value of crypt.
>Is it possible to apply this function to whole files ?
Yes but it dosn't realy make sence to do so. If you wish to unrevsable
encode a document in that mannor its probly better to make use of
something like SHA or MD5 (Has securaty problems?)
--
I'm a perl programer if you need perl programing hire me.
Please excuse my spelling as I suffer from agraphia see the url. Support NoCeM
http://www.cit.nepean.uws.edu.au/~dformosa/Spelling.html http://www.cm.org/
I'm sorry but I just don't consider 'because its yucky' a convincing argument
------------------------------
Date: Mon, 27 Apr 1998 08:29:27 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: http Reg Exp
Message-Id: <1d83bnv.l44l1a12bskbtN@slip-32-100-246-191.ny.us.ibm.net>
Chris Lambrou <archive@cglis.com> wrote:
> $msg =~ s!(ftp|https?)://([^\s]+)!<a href="$1://$2">$1://$2<\/a>!gsi;
>
> 90% this works. The problem is that the above will match text that
> starts with
> ftp/http/https followed by :// up to the next white space character,
> so this breaks down if the URL is followed by a non word character such
> as comma, a ">" or something else.
>
> Any ideas how to fix it?
>
> Thanks in advance.
$msg =~ s!(ftp|https?)://([^\s]*[^\s>,])!<a href="$1://$2">$1://$2<\/a>!gsi;
^^^^^^^^
difference here
As someone else pointed out, commas and >s are legal in a URL, but they are not likely to occur at
the end of the URL.
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: Mon, 27 Apr 1998 03:47:13 -0600
From: stevenf@pcdynamics.nl
Subject: If you solve this your are FANTASTIC! and it's something real simple (I think)
Message-Id: <6i1gmh$nlc$1@nnrp1.dejanews.com>
I everyone!
Check out the HTML code.
-----------
<HTML>
<HEAD>
<TITLE>Test</TITLE>
</HEAD>
<BODY>
<form method=POST action="/cgi-bin/test.pl">
<input type="Submit" name="submit" value="Submit">
<input type=hidden name="picture" value="test.gif">
<input type=hidden name="text1" value="This is a cool picture">
<input type=hidden name="text2" value="It's a 325td BMW ">
</form>
</BODY>
</HTML>
---------------
What I want it to do is, that it has to pas on the variables to the perl/cgi
program.
So that it will make a new HTML page with the picture and some text.
This shouldn't be to difficult, but I'm very very new to Perl.
If you could give me a very small example of how the perl program should look
like I will be very graitfull!
If you can help me could you please send it to my email address because I
can't read the newsgroup from my PC at work!
My email : stevenf@pcdynamics.nl
Thank you very very much!
Seeya,
Steven.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Mon, 27 Apr 1998 01:37:56 -0700
From: "Henry Wolff" <admin@hatsoft.com>
Subject: Re: image size for jpg and/or gif
Message-Id: <35444395.0@news.greatbasin.net>
Since I could not for some reason get the Image::Size module to make I did
some research and came up with a good script which I modified to do just the
jpeg and gif sizes. It ain't pretty but it works.
# Use As:
# print "Content-type: text/html\n\n";
# &JPEG_size("beach.jpg"); or &GIF_size("beach.gif");
# print "Height: $h<br>";
# print "Width: $w<br>";
#################################################
# Subroutines
#
#################################################
# This is a little hack to determine the width and height in pixels of
# a JPEG image. It is a hack because it assumes that some markers
# exist which in fact don't. This should really cause no problems, however.
# Original written by Marcus E. Hennecke <marcush@leland.stanford.edu>
sub JPEG_size
# Define marker types
local($M_SOF0) = 0xC0;
local($M_SOF15) = 0xCF;
local($M_SOI) = 0xD8;
local($M_EOI) = 0xD9;
local($M_SOS) = 0xDA;
local($M_COM) = 0xFE;
local($l,$d);
local($fn) = @_;
if (!open(IMAGE, $fn)) {
print "Could not open file \"$fn\"!\n";
return "";
}
# Check the first few bytes to see if this is a JPEG file. From the docs:
#
# o you can identify a JFIF file by looking for the following sequence:
# X'FF', SOI, X'FF', APP0, <2 bytes to be skipped>, "JFIF", X'00'.
local($c1) = &read_1_byte;
local($c2) = &read_1_byte;
if ($c1 != 0xFF || $c2 != $M_SOI) {
print("\"$fn\" is not a JPEG file!\n");
close(IMAGE);
return "";
}
# Go through the markers in the header. Stop when height and width are
# determined or when end of header is reached
while (1)
# Get the next marker
local($db) = 0;
$c1 = &read_1_byte;
while ($c1 != 0xFF)
$db++;
$c1 = &read_1_byte;
}
while ($c1 == 0xFF) {
$c1 = &read_1_byte;
}
if ($db) { print("Warning: garbage data found in JPEG file \"$fn\"\n"); }
# What type marker are we looking at?
# Note that this first if statement is actually not quite correct.
# It assumes that the markers SOF0 to SOF15 all exist and are in
# order. In reality, they are in order, but SOF4, SOF8, and SOF12
# do not exist. Nevertheless, these markers should not normally
# appear in a JPEG file and so this if statement works.
if ($c1 >= $M_SOF0 && $c1 <= $M_SOF15)
# Do we have width and height?
($l,$d,$h,$w) = unpack("nCnn", &read_n_bytes(7));
$l = &ushort($l);
$h = &ushort($h);
$w = &ushort($w);
close(IMAGE);
return "";
} elsif ($c1 == $M_SOS || $c1 == $M_EOI) {
# Did we reach header end?
close(IMAGE);
return "";
} else {
# Otherwise, skip this variable
$l = &ushort(unpack("n", &read_n_bytes(2))) - 2;
if ($l < 0)
print("Erroneous JPEG marker length in file \"$fn\"!\n");
close(IMAGE);
return "";
}
&read_n_bytes($l);
}
}
}
#
# Determine the size of a GIF file
#
sub GIF_size {
local($fn) = @_;
if (!open(IMAGE, $fn)) {
print "Could not open file \"$fn\"!\n";
return "";
}
$read = &read_n_bytes(6);
if ($read ne "GIF87a" && $read ne "GIF89a") {
print "\"$fn\" is not a GIF file!\n";
close(IMAGE);
return "";
}
# Examine the Logical Screen Descriptor
local($lsw, $lsh, $pf, $bg, $par) = unpack("vvCCC", &read_n_bytes(7));
# Is it followed by a Global Color table?
if ($pf & 0x80) {
# Skip the Global Color Table
local($GCTsize) = $pf & 0x07;
&read_n_bytes(3 * (2 << $GCTsize));
}
# Go through the markers in the header. Stop when height and width are
# determined or when end of header is reached
while (1) {
# Get the next marker
$c = &read_1_byte;
if ($c == 0x21) { # This is an Extension.
# Read the label.
$c = &read_1_byte;
# Read the remainder of this Extension Block and while we're at it,
# read all possible Data Sub-blocks as well.
while ($blksize = &read_1_byte)
&read_n_bytes($blksize);
}
} elsif ($c == 0x2c) {
#
# This is the most holy of all... The Image Descriptor.
#
local($lp,$tp,$pf) = unpack("vvvvC", &read_n_bytes(9));
$w = &ushort($w);
$h = &ushort($h);
close(IMAGE);
return "";
} else {
close(IMAGE);
return "";
}
}
}
# Reads one byte. If EOF is reached, terminates with an error message.
sub read_1_byte {
return ord(getc(IMAGE));
}
# Reads N bytes. If EOF is reached, terminates with an error message.
sub read_n_bytes {
local($n) = @_;
local($ch);
read(IMAGE, $ch, $n) == $n || print("Premature EOF in GIF file
\"$fn\"!\n");
return $ch;
}
# Make a signed short unsigned.
sub ushort {
local($n) = @_;
$n += 65536 if ($n < 0);
return $n;
}
#################################################
Henry Wolff
Send Some Virtual Postcards - FREE
http://www.hatsoft.com/webcard/index.html
Jonathan Feinberg wrote in message ...
>[posted and mailed]
>"Henry Wolff" <admin@hatsoft.com> writes:
>
>> I am working on my postcard scripts and I need to be able to check the
>> height and width of jpg and gif files before allowing people to submit
>> pictures for their use in the postcards.
>
>You want the Image::Size module, available at CPAN.
>
> http://www.perl.com/CPAN-local/
>
>--
>Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: 27 Apr 1998 12:25:22 GMT
From: "Ephrayim \"EJ\" Naiman" <enaiman@ndsisrael.com>
Subject: Looking for example of IO::Socket for UDP Server
Message-Id: <01bd71d4$d34ebc80$77140a0a@enaimanlt.ilndc.com>
I've looked around and can't find an example of a UDP Server (e.g. echo)
using IO::Socket. If anybody knows where one is, please point me there.
Thanx,
--
Ephrayim "EJ" Naiman
enaiman@ndsisrael.com
------------------------------
Date: 27 Apr 1998 05:17:52 GMT
From: jev@pconline.com (John Erjavec V)
Subject: Re: matching man page lines
Message-Id: <6i14e0$ovo$1@bell.pconline.com>
Ronald J Kimball (rjk@coos.dartmouth.edu) wrote:
:> > No, not really. What I am trying to do is match lines like:
:> >
:> > SYBPERL(1) 26/Mar/98 SYBPERL(1)
:> > and like:
:> > User Contributed Perl Documentation User Contributed Perl Documentation
:>
:> How much variation is there in the strings permissible between the paired
:> strings? What is the shortest allowable length of one of the paired text strings?
:>
:> /^\s+(\S.{3,})\s+\S*\s*\1\s*$/
:
:Looks like that regexp won't work, due to lines like:
:
:DATE(1) User Contributed Perl Documentation DATE(1)
:
:
:However, I thought of another way to speed it up a bit.
:
:/^\s*(\S.{2,37}\S)\s.*\1\s*$/
:
:BTW, the initial \s+ should be \s*. Otherwise it won't even match any of the examples.
Oops. My mistake. I know that the man page formatting puts at least one
space before the headers, hence the \s+ (in an effort to speed things up).
That was a problem with my editing, and not the regex.
Thanks for the input. I'll play around with the ideas you gave, and let
you know the results.
-JEV
--
John Erjavec V PGP fingerprint:
jev@pconline.com 7593 1B5A AE11 C0FE BA09 EB5E 8DE9 D2E5 BF5B 87AD
http://www.pconline.com/~jev/index.html
------------------------------
Date: Mon, 27 Apr 1998 13:03:33 +0100
From: "Peter Anning" <panning@thomtech.com>
Subject: Memory leak when embedding perl
Message-Id: <6i1s58$nqh$1@ttis.thomtech.com>
Has anyone got experience with embedding perl in C/C++?
I have followed the perlembedd man page and have successfully embedded a
perl interpreter into my 'C' program. This involves a the follwoing steps:
perl_parse(myperl)
perl_run(my_perl)
perl_destruct(my_perl)
perl_free(my_perl)
every time I run this sequence, the perl script runs fine, but the
paerl_parse stage takes a chunk of memory which is never returned, even
though I invoke perl_destruct and perl_free.
Any experience in this field would be much appreciated.
Peter Anning
------------------------------
Date: 27 Apr 1998 08:52:00 GMT
From: "Robert Friberg" <robban@it-konsult.com>
Subject: o-modifier
Message-Id: <01bd71b9$2578bcc0$c82da8c0@robban.ittek.org>
Hi,
The following piece of code is run at worst case 80000 times, therefore
I'm interested in having the regexp compiled only once. The @words
array is assigned only once but $#words varies.
for $w (@words){
$failed++ and last unless /$w/i;
}
Does anyone have a trick for this?
I could put a limit to the number of words allowed and loop that
many times with explicit adressing but it feels definitly wrong:
for ($i=0; $i < 5 and $i < $#words; $i++) {
if ($i==0) { /$words[0]/io }
elsif ($i==1) { /$words[1]/io }
elsif ($i==2) { /$words[2]/io }
elsif ($i==3) { /$words[3]/io }
elsif ($i==4) { /$words[4]/io }
else { $failed++; last }
}
Question #2
Is there a more perlish equivalent of the following?
$d{'max'} = $maxhits if $d{'max'} > $maxhits;
/Robban
------------------------------
Date: Mon, 27 Apr 1998 04:05:58 -0400
From: David Lee Lambert <lamber45@EGR.msu.edu>
Subject: Re: Perl-only distribution (was Re: How do I build Linux from stratch?? (w/o distribution of course!!))
Message-Id: <Pine.GSO.3.96.980427040230.20489B-100000@area51>
On 26 Apr 1998, Peter Samuelson wrote:
> Anyway, libc _does_ use sh for popen() and system() (but these are not
> "unexpected" -- everybody knows they use the shell so in secure
> programming you avoid them like gets()). Those calls can make use of
> advanced functionality in the shell, unlike the Perl glob() situation,
> so in order not to break things you pretty much have to have a fully
> functional sh, for whatever definition of "fully functional".
My school's library has a couple of copies of an inch-thick book entitled
'POSIX.2' (I think the IEEE publishes it) -- would that count?
--
m/lamber45\100(egr|pilot)\.msu\.edu/ and print <<MHM16x20
David Lee Lambert -- Just another perl hacker
webstuph at http://web.egr.msu.edu/~lamber45
MHM16x20
------------------------------
Date: Mon, 27 Apr 1998 03:14:10 -0400
From: David Lee Lambert <lamber45@EGR.msu.edu>
Subject: Re: Perl-only distribution
Message-Id: <Pine.GSO.3.96.980427030749.20489A-100000@area51>
On 27 Apr 1998, Martien Verbruggen wrote:
> In article <m31zukrmdi.fsf_-_@windlord.stanford.edu>,
> Russ Allbery <rra@stanford.edu> writes:
> > In comp.lang.perl.misc,
> > Shimpei Yamashita <shimpei+usenet+.mil+.gov@BOFH.patnet.caltech.edu> writes:
> >
> >> More importantly, libc also calls /bin/sh in several locations (most
> >> notably in some of the exec() family of calls), so you will also need to
> >> patch libc.
> >
> > I believe /bin/sh is only used in system() and popen() (and perhaps a few
> > other places). exec*() should only be running the binary that you
> > specifically told it to run.
>
> To avoid confusion about perl builtins and system calls:
>
> The perl functions:
>
> # perldoc -f exec
> [snip]
> The exec() function executes a system command I<AND NEVER RETURNS> -
> use system() instead of exec() if you want it to return. It fails and
> returns FALSE only if the command does not exist I<and> it is executed
> directly instead of via your system's command shell (see below).
> [snip]
>
> # perldoc -f system
> Does exactly the same thing as "exec LIST" except that a fork is done
> first, and the parent process waits for the child process to complete.
> [snip]
>
> The system calls (on Solaris, might be different on others:
>
> # man execvp
> [snip]
> If the new process file is not an executable object file,
> execlp() and execvp() use the contents of that file as standard
> input to the shell. In a standard-conforming application (see
> standards(5)), the exec family of functions use /usr/bin/ksh
> (see ksh(1)); otherwise, they use /usr/bin/sh (see sh(1)).
> [snip]
Under Linux (at least, according to the comments in the kernel source in
fs/exec.c), the kernel takes care of #! processing within itself.
Perhaps it calls /bin/sh if it can't figure out which interpreter to use,
but on most current Linux distributions /bin/sh is a symlink to /bin/bash.
My idea is to make a file /bin/plsh (for example), to which /bin/sh will
be linked in my distribution.
--
m/lamber45\100(egr|pilot)\.msu\.edu/ and print <<MHM16x20
David Lee Lambert -- Just another perl hacker
webstuph at http://web.egr.msu.edu/~lamber45
MHM16x20
------------------------------
Date: Mon, 27 Apr 1998 01:21:56 -0700
From: Yashesh Shroff <yashesh@eecs.berkeley.edu>
Subject: Porting Perl script to machine w/out perl!
Message-Id: <35444024.1D6757B2@eecs.berkeley.edu>
Hi!
I have a perl script which I would like to use on another x86 Win95
machine. However, I won't be allowed to install perl on that machine
just for this one script! Is there a way I can port this script (it is
actually a tk widget) application ? Maybe I can compile it somehow?
The only other alternative is to write a C++ based code in Visual C++
and build a GUI for what Tk-perl is doing right now. Currently I have
the script running on win NT 4.0 which has G. Sarathy's perl binaries
installed.
Any suggestions?
Thanks,
regards,
yashesh<no-spAM!>@eecs.berkeley.edu
------------------------------
Date: Mon, 27 Apr 1998 08:34:23 -0400
From: "Les Woolsey" <lwoolsey@innovative.ca>
Subject: Problems with Perl performance on AS400
Message-Id: <6i1uhd$fji$1@nr1.ottawa.istar.net>
I have a simple Perl program which reads a file and extracts some data from
it. It runs great on a PC under Win NT. But running it on the AS400 is a
pig. It gets the right answers but exhibits strange performance
characteristics. It runs for about 20 seconds then locks up and does nothing
for about 20 second then repeats that cycle until the program finishes.
Anybody have any idea of what's going on or how to fix it?
Les
------------------------------
Date: Mon, 27 Apr 1998 05:05:12 GMT
From: paul@cytech.net (Paul)
Subject: Re: QUESTION: How do I print file contents to screen?
Message-Id: <354411bf.3697075@nntp.bestweb.net>
On Sun, 26 Apr 1998 05:45:11 -0400, "David Joyce"
<djoyce@netunlimited.net> wrote:
>How do I print the contents of a file to screen? For instance, I have a
>log-file .txt file that I want to print out
>to screen, along with any entries I have just appended. Do I use <STDOUT>?
>
Ok, so I got flamed a lot for my non-error checking, so here's the
correct version:
open(FILEH, "whatever.txt") or die("Couldn't open file: $!");
while (<FILEH>) {
print;
}
close(FILEH);
Regards,
Paul.
------------------------------
Date: Mon, 27 Apr 1998 09:51:10 +0200
From: "Andreas Olsson" <seo@sorona.se>
Subject: Runtime Error in Perl
Message-Id: <354438a6.0@d2o26.telia.com>
I have huge problem when parsing SGML documents:
This is what I want to do:
I want to go through a SGML document and extract the complicated, sometimes
nested structures such as lists, equations and tables: The script puts the
structures (numbered as <objsrcN></objsrcN> in one file and then links back
to main document with <objdestN> or into another <objsrc!N> obj. Here's my
problem.
When parsing small documents the script executes with no problem, but raises
Runtime Error when parsing bigger documents. There seems to be a 2^16 limit
for matching.
I would be really grateful for ideas or any help.
Niclas Lindberg.
niclas@nillgraf.se
If you have any suggestions please mail me, because I don't have news on my
computer. Thank you very much.
The sourcecode:
$globaladress = 0;
@taglist=("table-group","list","equation","figure");
$tagor=$taglist[0];
foreach $actualtag (@taglist){
$tagor=$tagor."\|".$actualtag;
}
sub adressing {
$globaladress++;
my ($eexpr)=@_;
print OUTPFOBJ
"<OBJSRC$globaladress>\n$eexpr\n</OBJSRC$globaladress>\n\n";
return "<OBJDEST$globaladress>";
}
for ($src) {
while (m#<$tagor#gsi){
foreach $actualtag (@taglist) {
s#(<$actualtag([^<]*?(?:(?!<$tagor).)*?)</$actualtag>)##&adressing($1)gse;
}
}
} # End for
------------------------------
Date: Mon, 27 Apr 1998 06:32:39 +0300
From: ikarn@otenet.gr
Subject: Undefined pTk's mainloop in package
Message-Id: <3543FC57.2E6D6352@otenet.gr>
I want to put a GUI to anexisting(working) perl code. I have a simple
radiolist
pTk code, that runs fine by itself.
I now call in the main of the existing perl code
&option_menu::radlist();
where radlist is the radiolist code, turned into a subroutine and
put in package option_menu
The result is that perl complains:
Undefined subroutine &option_menu::MainLoop at myscript.pl line 999
I do not understand why perl complains abut mainloop and does not do
likewise about
other pTk-specific functions, like button, frame etc (and what to do
about this problem)
Thanks in advance for any help
Spiros Alexiou
alexiou@moka.ccr.jussieu.fr
------------------------------
Date: 27 Apr 1998 09:09:52 GMT
From: "Mathijs Oosterom" <thijs@esense.nl>
Subject: WEIRD PROBLEM IE4
Message-Id: <01bd71bb$ed547480$a44a6dc2@earl.esense.nl>
Hi all,
I have a weird problem with a Perl-script in whem I use Internet Explorer
4.
I programmed some scripts that search in databases. Because the search
result must be displayed in a frame, another script picks up the query
data, generates the frameset and passes the query to the search script (by
submitting a full url: script.cgi?data).
This is all working fine, in all Netscape-versions as well as in Explorer
3. But in Explorer 4 it just doesn't work!!! How is this possible. I know
Bill doesn't like me, but this is going too far :)).
Can anybody please help me?
Thanx in advance,
Thijs.
------------------------------
Date: 27 Apr 1998 12:11:27 GMT
From: "Mathijs Oosterom" <thijs@esense.nl>
Subject: weird problem with ie4
Message-Id: <01bd71d5$480fa700$a44a6dc2@earl.esense.nl>
Hi all,
I have a very weird problem with Internet Explorer 4.
I wrote a database script in Perl. Because the search results have to be
placed in a frame, another scripts picks up the query, creates the frameset
and activates the search script by an url. In the other frame a banner is
shown.
This is all working fine, in all Netscape versions as well as in Internet
Explorer 3. But in Explorer 4 the search result is alway empty. Just like
if the first script can't pass the data to the second script or something.
But scripts should be independant from browsers, shouldn't they.
Does anybody know anything of such problems with Explorer 4? Or could I be
doing something wrong in my scripts?
Thanx in advance,
Thijs.
------------------------------
Date: Sun, 26 Apr 1998 23:55:49 -0700
From: "Igor Krivokon" <igor.k@usa.net>
Subject: Re: Win32 & Process listing
Message-Id: <6i19ut$8pj$1@news.ncal.verio.com>
Kevin Flanagan wrote in message <6i11vu$6s7$1@ha2.rdc1.ne.home.com>...
>
>
>If you need to do this in a perl script that's one thing, but if you just
>need to
>see from the command line then check for PS and PSTAT. They are command line
>programs that I've had hanging around for so long I can't remember where
>they came from.
>
Yes, pstat comes with NT Resource Kit, as well as tlist and pulist.
Never heard about ps, though (on NT, at least :)
Igor Krivokon
<igor.k@usa.net>
------------------------------
Date: Mon, 27 Apr 1998 11:39:43 +0200
From: "Andreas Olsson" <seo@sorona.se>
Subject: win32::registry (queryvalue)
Message-Id: <35445216.0@d2o26.telia.com>
I wonder why the function QueryValue doesn't work under WinNT4.
My code:
$HKEY_LOCAL_MACHINE->Open("SOFTWARE", $hkey) || die "Can't open registry";
$hkey->Open("Mykey", $skey) || die "Can't open registry";
$skey->Open("MySubKey", $lkey) || die "Can't open registry";
$lkey->QueryValue("Value1", $val1) || die "Error";
$lkey->QueryValue("Value2", $val2) || die "Error";
Please help me.
My email is : niclas@nillgraf.se
------------------------------
Date: Mon, 27 Apr 1998 12:34:01 GMT
From: John Porter <jdporter@min.net>
Subject: Re: win32::registry (queryvalue)
Message-Id: <35447CA4.7607@min.net>
Andreas Olsson wrote:
>
> I wonder why the function QueryValue doesn't work under WinNT4.
Don't wonder; just use QueryValueEx.
hth,
John Porter
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 2426
**************************************