[8032] in Perl-Users-Digest
Perl-Users Digest, Issue: 1657 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 16 18:06:04 1998
Date: Fri, 16 Jan 98 15:00:27 -0800
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, 16 Jan 1998 Volume: 8 Number: 1657
Today's topics:
Re: can you attach a password (Clay Irving)
Re: Chat script <rootbeer@teleport.com>
differences <jahnel@xarch.tu-graz.ac.at>
Re: differences (Clay Irving)
Re: differences (Mike Stok)
Re: EMTY FILE? (Charles DeRykus)
Re: Getting the first two chars of a string - URGENT! (Charles DeRykus)
Re: Give me reasons to use Perl for CGI (I R A Aggie)
Re: globs passed from command line (Tad McClellan)
Re: HELP !! <Y_Hu@fccc.edu>
Re: HELP !! (Andrew M. Langmead)
Re: HELP !! (Tad McClellan)
Re: Help tokenizing strings w/ embedded quoted strings (Tad McClellan)
how to mix the order of the lines in a file? (nelson chin)
Re: how to mix the order of the lines in a file? (Mike Stok)
Re: Newbie: perl scripts search floppy drive <rootbeer@teleport.com>
Re: Parsing SQL server dumps. (Tad McClellan)
Re: Pattern match of no character, any character, or sp cotal@delphi.com
Re: Perl and socket connections from PC's??? <rootbeer@teleport.com>
Re: Perl5 and Oraperl on AIX <prl2@lehigh.edu>
Problems running Perl 5 on NT 4.0/Netscape Enterprise 3 <brad_argue@dentistry.unc.edu>
Search engines and hiding directories <cbeaudry@diopitt.org>
Re: select() on a file? <doug@tc.net>
shmread from Perl (Jim Largent)
Re: source into binary code (John Stanley)
Re: source into binary code <rootbeer@teleport.com>
Statistics::Descriptive <rbowen@databeam.com>
Re: Wanted: generic macro/include pre-processor <bkiefer@hollandhart.com>
Re: Why does Perl5.0004 use a "Configure" script <tchrist@mox.perl.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 16 Jan 1998 16:24:29 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: can you attach a password
Message-Id: <69oj6d$6b2@panix.com>
In <34BF8BB2.B49BFF6D@hc.ti.com> Toby Potts <potts@hc.ti.com> writes:
>Can you attach a password to a directory or group of directories that
>not even root can get into?
Er, did you accidentally post in the Perl newsgroup? This sounds *alot*
like a sysadmin question -- Like maybe something to do with Access Control
Lists?...
--
Clay Irving <clay@panix.com> I think, therefore I am. I think?
http://www.panix.com/~clay/
------------------------------
Date: Fri, 16 Jan 1998 13:17:15 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Mike Smit <msmit@aberdare.co.za>
Subject: Re: Chat script
Message-Id: <Pine.GSO.3.96.980116131647.669I-100000@user2.teleport.com>
On Thu, 15 Jan 1998, Mike Smit wrote:
> the problem I am having is that writchat.PL is sending a page back
> giving me a 500 error.
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.
http://www.perl.com/CPAN/
http://www.perl.org/CPAN/
http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.org/CPAN/doc/manual/html/pod/
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Fri, 16 Jan 1998 22:41:07 +0100
From: Jahnel Klaus <jahnel@xarch.tu-graz.ac.at>
Subject: differences
Message-Id: <34BFD3F2.3402D988@xarch.tu-graz.ac.at>
what are the big diferences between
= , == , =~ and eq ?
Klaus
------------------------------
Date: 16 Jan 1998 16:50:31 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: differences
Message-Id: <69okn7$8j5@panix.com>
In <34BFD3F2.3402D988@xarch.tu-graz.ac.at> Jahnel Klaus <jahnel@xarch.tu-graz.ac.at> writes:
>what are the big diferences between
>= , == , =~ and eq ?
Read the documentation that comes with Perl. Specifically, perlop
Perl operators and precedence
http://www.perl.com/CPAN/doc/manual/html/pod/perlop.html
--
Clay Irving <clay@panix.com> I think, therefore I am. I think?
http://www.panix.com/~clay/
------------------------------
Date: 16 Jan 1998 16:58:17 -0500
From: mike@stok.co.uk (Mike Stok)
Subject: Re: differences
Message-Id: <69ol5p$25o$1@stok.co.uk>
In article <34BFD3F2.3402D988@xarch.tu-graz.ac.at>,
Jahnel Klaus <jahnel@xarch.tu-graz.ac.at> wrote:
>what are the big diferences between
>= , == , =~ and eq ?
These should be covered in any reasonable pelr book, such as Learning
Perl, but...
= does assignment e.g. $a = 5;
== and eq are comparison operators that treat the things on either side
of them as numbers or strings respectively and return value which
can be used as a boolean e.g.
if ($string eq 'foo') { ... }
if ($namber == 25.3) { ... }
be aware of perl's ability to convert scalars between number and string
form on the fly, and the way a computer's representation of floating
point values can make testing for equality difficult.
=~ is a topicaliser. Some operations like match, substitute and
translate work on $_ by default, =~ allows you to make them work
on something else e.g.
$string =~ s/Java/Perl/g;
will operate on $string.
Hope this (hurried 'cos I have a bus to catch) reply helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: Fri, 16 Jan 1998 19:09:38 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: EMTY FILE?
Message-Id: <EMw583.5CM@bcstec.ca.boeing.com>
In article <fl_aggie-1601981309340001@aggie.coaps.fsu.edu>,
I R A Aggie <fl_aggie@thepentagon.com> wrote:
>In article <EMuA37.FHq@bcstec.ca.boeing.com>, ced@bcstec.ca.boeing.com
>(Charles DeRykus) wrote:
>
>+ In article <34BE1434.F478E6F0@xarch.tu-graz.ac.at>,
>+ Jahnel Klaus <jahnel@xarch.tu-graz.ac.at> wrote:
>+ > How can i test a file weather its empty or not (but not with the testing
>+ > of the file size)
>
>
> if (-z $file) {
> print "zero size for file: $file\n";
> }
>
> This is more efficient if the file is a significant non-zero sized file.
>
> Page 85 of the Blue Camel has a list of the various and sundry file test
> operators.
>
I agree but there was the stipulation "not with the testing of the
file size".
--
Charles DeRykus
------------------------------
Date: Fri, 16 Jan 1998 19:15:10 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Getting the first two chars of a string - URGENT!
Message-Id: <EMw5HA.5JB@bcstec.ca.boeing.com>
In article <34BF285E.7E7E@nortel.ca>, Ben Holness <bholness@nortel.ca> wrote:
>Hi all,
>
>If anyone knows how to return the first two chars of a string, please
>could you let me know as soon as possible.
>
>The situation is as follows:
>
>I have a variable ($temp) which holds a string similar to "4R65" or
>"Q6E2" etc.
>
>I would like to be able to get just the first two chars of the string,
>ie "4R" or "Q6" (as in the examples above).
>
One possibility: perldoc -f substr
HTH,
--
Charles DeRykus
------------------------------
Date: Fri, 16 Jan 1998 17:27:39 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Give me reasons to use Perl for CGI
Message-Id: <fl_aggie-1601981727400001@aggie.coaps.fsu.edu>
In article <34BEC365.B734D7F8@voyager.atc.fhda.edu>, Hann SO
<hso@voyager.atc.fhda.edu> wrote:
+ I'm teaching CGI at a community College. Would you please give me
+ reasons why I should use Perl and not C, C++ or TCL?
CGI.pm.
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
Date: Fri, 16 Jan 1998 09:00:25 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: globs passed from command line
Message-Id: <9msn96.5n1.ln@localhost>
Ben Glazer (ben.glazer@mail.utexas.edu) wrote:
: I'm trying to pass a possibly-wildcarded filename from the command
: line, so I start off like this:
: @files = glob $ARGV[0]; # glob filenames from command line
: But if I don't pass in the wildcard in double quote marks, perl
: apparently resolves it into a single filename which it then passes to
: $ARGV[0].
perl doesn't do that. The shell expands globs _before_ calling
perl.
: How can I avoid this restriction?
Protect your wildcarded strings from the shell with quotes
or backslashes.
: I want to be able to say
: perl mew.pl *.txt
You can't (with a normal shell anyway).
perl mew.pl '*.txt'
or
perl mew.pl \*.txt
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 16 Jan 1998 15:42:32 -0500
From: Ying Hu <Y_Hu@fccc.edu>
Subject: Re: HELP !!
Message-Id: <34BFC638.167E@fccc.edu>
Wayne Patton wrote:
>
> I have what appears to be a simple problem but I cant figure it out. I
> have the following data file:
>
> a|b|c|d|e|f|g
>
> Text file with fields delimited by "|". My code so far:
>
> ================================
> #!/usr/local/bin/perl
> #
> $Efile="/usr/local/data/exception.data";
> unless (open (In,"<$Efile"))
> {
> die "Could not open $Efile\n";
> };
> while (<In>) {
> chop($_);
> @Fields=split "\|" ;
@Fields=split /\|/;
> print "$Fields[0]\n";
> }
> close(In);
> ======================================
>
> The problem: It wont split on the "|" How do I split on "|" ???
>
> --
> ---------------
> Wayne Patton, Email: wbpatto@wmccmsvr.ssr.hp.com
------------------------------
Date: Fri, 16 Jan 1998 22:25:56 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: HELP !!
Message-Id: <EMwEB8.JGx@world.std.com>
Wayne Patton <wbpatto@wmccmsvr.ssr.hp.com> writes:
> @Fields=split "\|" ;
Change this to:
@Fields=split /\|/;
and it should work.
split() expects its first parameter to be a regular expression. When
it is passed a string, it converts it to a regular expression. When
the first parameter uses the double quote operator, however, perl does
interpolation and backslash interpolation before it passes the results
to split(). So perl sees the sequence "\|" in double quotes, sees the
backslash, and sees that that the character following the backslash is
not one of the characters listed in the double quote operator section
in the perlop man page. (of course, the compiler doesn't check the
perlop man page, more likely the person who wrote the perlop man page
checked the source to the perl compiler to see what it was doing.) In
a double quoted string when a backslash is encountered and the
character isn't one of the special chracters, the backslash is removed
and the following character is treated literaly.
What you did is almost like saying:
@Fields=split /|/;
which is a null pattern.
--
Andrew Langmead
------------------------------
Date: Fri, 16 Jan 1998 15:58:49 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: HELP !!
Message-Id: <p6lo96.7g3.ln@localhost>
Wayne Patton (wbpatto@wmccmsvr.ssr.hp.com) wrote:
: I have what appears to be a simple problem but I cant figure it out.
You also have another problem.
You negelected to put a subject in your Subject: header.
*Many* folks never read your post because they could not tell
what it was about from the Subject: ...
: I
: have the following data file:
: a|b|c|d|e|f|g
: Text file with fields delimited by "|". My code so far:
: ================================
: #!/usr/local/bin/perl
You should *always* use the -w switch you know...
: #
: $Efile="/usr/local/data/exception.data";
: unless (open (In,"<$Efile"))
: {
: die "Could not open $Efile\n";
: };
That part looks OK (except you should work $! into the die() text),
but the usual perl idiom is:
open (IN,"<$Efile") || die "Could not open $Efile $!\n";
^^ ^^
^^ filehandles all upper case, be convention ^^
^^ get helpful info
about why it failed
Seems a lot more clear that way (to me anyway).
: while (<In>) {
: chop($_);
chomp() is much safer if what you want to do is remove the line ending.
: @Fields=split "\|" ;
^^^^^
You might think of looking up a function that you are having
trouble with... ;-)
'perlfunc' says:
"=item split /PATTERN/"
You did not give it a /PATTERN/
You gave it a string.
@Fields=split /\|/ ;
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 16 Jan 1998 16:32:46 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Help tokenizing strings w/ embedded quoted strings
Message-Id: <e6no96.4n3.ln@localhost>
Sheldon E. Smith (ssmith@galina.enet.dec.com) wrote:
: I have several paragraphs that I want to break into words. Splitting on
: white-space seems the obvious choice. The problem is the paragraphs have
: embedded quoted strings, and I'd like the entire quoted string as a single
: element.
[snip]
: I've tried experimenting with s/"[^"~]+"/ , but I can't find the right
: combination of backslashes or whatever.
It's quite a bit less straightforward than that...
: I figure if I can get it to work once, I can put the whole thing into a
: loop. On the other hand, is there some much more elegant method if doing
: this in Perl?
Yes. Do it like the Perl FAQ says to do it:
"How can I split a [character] delimited string except when
inside [character]? (Comma-separated files)"
The FAQ give code for comma separated split except when inside
double quotes.
I "replaced" all of the commas with a space in that code.
[ complicated by the fact that it uses the s///x modifier, I really
replaced ',' with '[ ]', except for the on comma that was already
in a character class
]
Seems to work OK:
---------------------------
#!/usr/bin/perl -w
$text = 'The quick, brown fox. "A quoted string" Two, four, six, eight';
@new = ();
push(@new, $+) while $text =~ m{
"([^\"\\]*(?:\\.[^\"\\]*)*)"[ ]? # groups the phrase inside the quotes
| ([^ ]+)[ ]?
| [ ]
}gx;
push(@new, undef) if substr($text,-1,1) eq ' ';
foreach (@new) {print "$_\n"}
---------------------------
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 16 Jan 1998 20:54:08 GMT
From: butta1@bu.edu (nelson chin)
Subject: how to mix the order of the lines in a file?
Message-Id: <69ohdg$dd$1@news1.bu.edu>
How do i mix the rows of data in a file in a random order using
perl?
eg,
line 1.
line 2.
line 3.
line 4.
becomes
line 2.
line 4.
line 1.
line 3.
------------------------------
Date: 16 Jan 1998 16:08:09 -0500
From: mike@stok.co.uk (Mike Stok)
Subject: Re: how to mix the order of the lines in a file?
Message-Id: <69oi7p$203$1@stok.co.uk>
In article <69ohdg$dd$1@news1.bu.edu>, nelson chin <butta1@bu.edu> wrote:
>How do i mix the rows of data in a file in a random order using
>perl?
If your original file has which all end in \n and is small enough to read
into memory then you could do something like
@lines = <INPUT>;
print OUTPUT splice (@lines, rand (@lines), 1) while @lines;
in the body of your code.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: Fri, 16 Jan 1998 14:42:20 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: bspiker@wiesbaden.netsurf.de
Subject: Re: Newbie: perl scripts search floppy drive
Message-Id: <Pine.GSO.3.96.980116143313.669L-100000@user2.teleport.com>
On Thu, 15 Jan 1998 bspiker@wiesbaden.netsurf.de wrote:
> everytime I run a perl script, there is a search on my system
> including a floppy drive serach, and I haven't a clue why.
This question and answer comes up every month or two, so it should be in
the Perl Win32 FAQ...
http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html
...but I can't find it there, so I'm copying this to the FAQs maintainer.
I'm told that this happens when some (non-Perl) program has foolishly
installed itself in the registry as being on a floppy drive. You should
run the registry editor (regedit.exe) and remove any unnecessary
occurences of 'A:', which is usually all of them. (I believe that Russell
Odom was the person who told me of this fix. But let me know if I've
botched the description.)
Since Perl can work with the registry directly, it would be nice if
somebody could make a utility which would do this for users. Such a
utility should ship with Win32 Perl, IMHO. I'd write it myself, but I
don't have any Win32 machines handy. :-)
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Fri, 16 Jan 1998 16:13:36 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Parsing SQL server dumps.
Message-Id: <g2mo96.7i3.ln@localhost>
b kiefer (bkiefer@hollandhart.com) wrote:
: SQL server can output to a file, but the file is 80 characters wide (or any
: width you specify).
: Whats the best way to find the end of the text and the beginning of the
: white space?
You have done your part to ensure that the 'F' in FAQ remains accurate.
You don't really have to do that.
If you don't ask it yet again, someone else will.
;-)
You can just go get the answer from the Perl FAQ, part 4,
yourself in about 20-30 *seconds*...
"How do I strip blank space from the beginning/end of a string?"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 16 Jan 1998 15:01:17 -0600
From: cotal@delphi.com
Subject: Re: Pattern match of no character, any character, or space (word boundary)
Message-Id: <884984012.1064566799@dejanews.com>
In article <qz$9801151942@qz.little-neck.ny.us>,
Eli the Bearded <*@qz.to> wrote:
>
> In article <884895682.461111315@dejanews.com>, <cotal@delphi.com> wrote:
> > I need a SIMPLE way to match all 3 of the following;
> >
> > as/400 as 400 as400
>
> m:as[/ ]?400:
>
> You want a [] character class and the ? zero-or-one of operator.
as[/ ]?400 matches as/400
as[ /]?400 matches as400 and as/400
What works for all three is: as[ /\s]?400 where \s means whitespace
as[\s\S]?400 is another way to pick these up, matching with any or no
character between as and 400.
thanks elijah et al. for getting me on the right track.
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Fri, 16 Jan 1998 14:43:55 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: JohnCurtis <johncurtis@aol.com>
Subject: Re: Perl and socket connections from PC's???
Message-Id: <Pine.GSO.3.96.980116144319.669M-100000@user2.teleport.com>
On 15 Jan 1998, JohnCurtis wrote:
> There doesn't seem to be any way to control the
> flushing of the output on the socket under VB ....
Replace VB with Perl. :-)
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 16 Jan 1998 20:49:58 GMT
From: "Phil R Lawrence" <prl2@lehigh.edu>
Subject: Re: Perl5 and Oraperl on AIX
Message-Id: <01bd22c0$4ea763a0$3e03b480@mm>
Thriveni Bhakta <thriveni@prodigy.net> wrote in article
<69ofn4$ivq$1@newssvr08-int.news.prodigy.com>...
> Can't find loadable object for module DBI in @INC (/usr/local/llib/perl5
)
> BEGIN failed--compilation aborted at /usr/local/lib/perl5/Oraperl.pm line
> 25.
> Line 25 in /usr/local/lib/perl5/Oraperl.pm is
> use DBI 0.84;
>
> There is a DBI.pm module existing in the directory where Oraperl.pm
> exists. I dont know what the 0.84 stands for.
It stands for the version. Open up DBI.pm and look for this line near the
top:
$DBI::VERSION = '0.90'; # or whatever version it is for you.
Make sure you have at least version 0.84.
Also, you may want to consider moving to DBD::Oracle instead of Oraperl.pm.
Oraperl.pm is just a wrapper around DBD::Oracle to allow old perl4 scripts
that used oraperl (small 'o') to still work. However, from what I
understand, the functions available to you through Oraperl.pm are now set
and will not increase or change, so you will not be able to benefit from
any new things introduced in DBI. Current DBI version = '0.91'.
------------------------------
Date: Fri, 16 Jan 1998 15:18:19 -0500
From: Brad Argue <brad_argue@dentistry.unc.edu>
Subject: Problems running Perl 5 on NT 4.0/Netscape Enterprise 3.0
Message-Id: <34BFC08B.795FCD37@dentistry.unc.edu>
I have a good deal of experience running Perl scrips on UNIX web
servers, but have recently become responsible for a NT 4.0 server
running Netscape Enterprise 3.0. I installed Perl 5 for Win32 and am
able to get simple scripts to run via the command line. I am also able
to get batch files in my cgi-bin to run via a Netscape browser.
However, whenever I try to run a simple .pl script from the browser, it
returns the error:
----------
Server Error
This server has encountered an internal error which prevents it from
fulfilling your request. The most likely cause is a misconfiguration.
Please ask the administrator to look for messages in the server's error
log.
----------
The error log reports:
[16/Jan/1998:15:00:57] failure: for host 152.2.159.238 trying to GET
/cgi-bin/test.pl, send-cgi reports: could not send new process (Error
Number is unknown)
[16/Jan/1998:15:00:57] failure: cgi_send:cgi_start_exec
d:\enterprise\cgi-bin\test.pl failed
----------
Permissions on the cgi-bin directory are set so that anyone can execute
and the Enterprise server is set to recognize all files in the cgi-bin
as cgi scripts. The suffix 'pl' is mapped to the content-type
'application/x-perl' in the Global Mime Types file on the web server.
What am I missing here?
Many thanks.
Brad Argue
brad_argue@dentistry.unc.edu
------------------------------
Date: Fri, 16 Jan 1998 16:50:38 -0500
From: "Charles Beaudry" <cbeaudry@diopitt.org>
Subject: Search engines and hiding directories
Message-Id: <69okl0$f4p$1@news6.ispnews.com>
I'm running a perl search engine on my site but want to hide files that are
only used for frames. The search.pl script (ver 1.02) I'm using returns a
title page with the number of hits on the keyword search and dates of
modification.
Is there a way to hide those pages used for frames, either by adding
something to the html files or by placing them in a directory that would not
be searched by the engine.
If it is a question of adding a line of code to the perl script itself, what
would it be? or would it be a modified version of the "@files" line? the
current line reads:
@files = ('*htm','*html','*/*htm');
If I wanted to hide a directory called "/frames", what would I need to do?
Any help would be useful.
Charles.
cbeaudry@diopitt.org
------------------------------
Date: 16 Jan 1998 16:16:31 -0500
From: Douglas McNaught <doug@tc.net>
Subject: Re: select() on a file?
Message-Id: <m2hg74p1ao.fsf@ono.tc.net>
Edward Henigin <ed@texas.net> writes:
> I'm working on a program which is going to have multiple
> UNIX domain sockets open, along with a plain file. I'd like to
> select() on all of them at once.
>
> The problem I'm encountering is that the plain file is
> *always* being flagged as having data ready to be read from it.
> Right now, as I'm working on it, it's a zero-byte file. When
> I go to sysread() from it, it always returns 0 bytes read.
> This makes the program chew cpu, because I'm depending on the
> timeout on select() to pause the program for me, and since
> the plain file always thinks there's something to be read...
> well you know, my select loop is always running, never waiting.
The select() function always returns true for plain files, because you
will never block on a read (you'll either get EOF or some data).
You'll have to keep track of the file's mtime, select() on your
sockets with a timeout (1s, 5s, whatever), stat() the file again and
see if the mtime has changed, and so on.
There's also a FAQ entry entitled "How do I do a 'tail -f' in Perl?"
that you might find helpful.
-Doug
--
sub g{my$i=index$t,$_[0];($i%5,int$i/5)}sub h{substr$t,5*$_[1]+$_[0],1}sub n{(
$_[0]+4)%5}$t='encryptabdfghjklmoqsuvwxz';$c='fxmdwbcmagnyubnyquohyhny';while(
$c=~s/(.)(.)//){($w,$x)=g$1;($y,$z)=g$2;$w==$y&&($p.=h($w,n$x).h($y,n$z))or$x==
$z&&($p.=h(n$w,$x).h(n$y,$z))or($p.=h($y,$x).h($w,$z))}$p=~y/x/ /;print$p,"\n";
------------------------------
Date: 16 Jan 1998 22:04:59 GMT
From: jim.largent@lmco.com (Jim Largent)
Subject: shmread from Perl
Message-Id: <69olib$kod@butch.lmms.lmco.com>
I have several executables that create shared memory segments. I want to
write a short perl script to attach to those segments and dump them.
I've been trying to do this, but the Perl book is rather thin on shared
memory topics. When I try the shmread it keeps failing and I get invalid
argument. Anyone have a simple example of how to attach to shared memory
and read it? I must be leaving something out.
Thanks
------------------------------
Date: 16 Jan 1998 21:25:38 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: source into binary code
Message-Id: <69oj8i$8v$1@news.orst.edu>
In article <69oh1s$jvf$1@csnews.cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> wrote:
>In comp.lang.perl.misc, stanley@skyking.OCE.ORST.EDU (John Stanley) writes:
>:If writing perl code were the way I wanted to make a living, I guess I
>:couldn't do very well at it by giving it away, now could I?
>
>That's entirely wrong. They are simpy hired to write something, under
>condition that it be giveawayable, or reusable by the writer. You get
>paid for a service: writing the code.
In other words, they aren't giving what they write away for free, they
get paid for the code. What the company does with it after that is
another matter. What the author does with it, if he still owns the
rights to it after selling it once, is another matter. The fact remains
that he was paid for it, with whatever conditions he accepted when he
was paid.
>Think of it as an freelance author publishing a story or article.
>It's still his story -- they just have right of first publication.
They gave him money in exchange for the right to publish it. Maybe the
problem is you are using an unusual definition of "free".
>I know both individuals and entire many(>50)-person companies who operate
>this way. It's perfectly viable.
Yes, getting paid to write code is a viable option for making a living.
Giving it away for free is not.
------------------------------
Date: Fri, 16 Jan 1998 13:21:13 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Dan Boorstein <dboorstein@ixl.com>
Subject: Re: source into binary code
Message-Id: <Pine.GSO.3.96.980116131848.669J-100000@user2.teleport.com>
On Thu, 15 Jan 1998, Dan Boorstein wrote:
> taken from the merriam webster dictionary:
>
> security - "measures taken to guard against espionage or sabotage,
> crime, attack, or escape"
>
> obscure - "not readily understood or clearly expressed"
>
> i'm not submitting that compiling is good security, only that it is
> security.
Please don't troll.
> isn't key based cryptography security through obscurity?
No.
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Fri, 16 Jan 1998 17:14:23 -0500
From: Rich Bowen <rbowen@databeam.com>
Subject: Statistics::Descriptive
Message-Id: <34BFDBBF.2F08@databeam.com>
I am trying to use the package Statistics::Descriptive. I am using the
sample script that comes with the package:
#!/perl/bin/perl
use Statistics::Descriptive;
$stat = new Statistics::Descriptive;
$stat -> AddData(1,2,3,4);
print $mean=$stat->Mean();
I get the error message Can't locate object method "new" via package
"Statistics::Descriptive" at stattest.pl line 3.
The sub new is very obviously there in the module, so apparently I am
missing something.
This is on a BSD machine running perl version 5.004_04. When I
installed the package, everything appeared to be working just fine - no
errors during the make, make test, make install
Anyone had any more success than I with this?
--
##################################################
# Rich Bowen #
# Web Services Engineer - DataBeam Corporation #
# rbowen@databeam.com #
##################################################
------------------------------
Date: 16 Jan 1998 22:00:36 GMT
From: "b kiefer" <bkiefer@hollandhart.com>
Subject: Re: Wanted: generic macro/include pre-processor
Message-Id: <01bd22ca$844207e0$1c1c2f81@bkiefer.hh.com>
Mike Stok <mike@stok.co.uk> wrote in article <69ocdf$1n6$1@stok.co.uk>...
> In article <slrn6bv312.fr5.pd@world.std.com>,
> Peter Davis <pd@world.std.com> wrote:
> >So, does anyone know of a macro processor that could be used for this?
> >It would basically have to expand macros and nested macros, include
> >files, and, perhaps handle conditionals.
There is a Perl PreProcessor provided by iMatix at:
http://www.imatix.com
It may do what you are hoping for.
bekiefer
------------------------------
Date: 16 Jan 1998 20:53:24 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Why does Perl5.0004 use a "Configure" script
Message-Id: <69ohc4$jvf$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Matthew Eldridge <eldridge@graphics.stanford.edu> writes:
:I've come to know and love the gnu autoconf stuff. Nothing finer
:than typing "./configure" and having it race through, figuring
:out everything under the sun.
:
:Without starting a religious war, or stepping on too many toes,
:why does Perl5 use "Configure" which spends a huge amount of
:time answering questions it could trivially answer itself?
:I mean the wheel needn't be reinvented, just use autoconf,
:right?
Why don't just use ./configure for Perl!?
autoconf has its problems. If it breaks, you're screwed.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
Drive defensively. Buy a tank.
------------------------------
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 1657
**************************************