[8158] in Perl-Users-Digest
Perl-Users Digest, Issue: 1776 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 31 04:07:17 1998
Date: Sat, 31 Jan 98 01:00:32 -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 Sat, 31 Jan 1998 Volume: 8 Number: 1776
Today's topics:
Re: Beginner needs help... (Abigail)
Re: can variables be generated on the fly <tchrist@mox.perl.com>
Re: can variables be generated on the fly <tchrist@mox.perl.com>
Re: can variables be generated on the fly <cdkaiser@delete.these.four.words.concentric.net>
Re: Don't use signal handlers (was Re: Child processes) (Ilya Zakharevich)
Re: Don't use signal handlers (was Re: Child processes) <tchrist@mox.perl.com>
Re: Don't use signal handlers (was Re: Child processes) <tchrist@mox.perl.com>
Re: easy question about ARGV (Craig Berry)
Re: easy question about ARGV (Martin Vorlaender)
Re: Enlightenment: regexes: fun with /x <rjk@coos.dartmouth.edu>
Re: Error executing Perl script (Martin Vorlaender)
Re: Forcing 7-digit number? (Craig Berry)
Re: Forcing 7-digit number? (Abigail)
Re: generating a variable on the fly (Martin Vorlaender)
Help in finding Control Characters in a string. (milagro)
Re: module variable scope <tchrist@mox.perl.com>
Re: Pattern matching poser (Abigail)
Re: Perl 5.001 (NT Resource Kit) on NT4 SP3 / IIS3.0 (Martin Vorlaender)
Please don't hit me! <rory@hart.wattle.id.au>
Re: removing a line from a file <tchrist@mox.perl.com>
SelfLoader question (jeremy howard todd)
Threads: Can't get the Thread (Thread_52 under Malcom B <mishra.aditya@emeryworld.com>
Re: TYP21D (was: substitute...) <rjk@coos.dartmouth.edu>
Re: Word -> HTML <gts@blueneptune.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 31 Jan 1998 07:45:00 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Beginner needs help...
Message-Id: <6aukps$m35$2@client2.news.psi.net>
Cathi Miller (singah@netutah.com) wrote on 1613 September 1993 in
<URL: news:34D11C09.7BE8A570@singah.com>:
++ Hi there.
++ I would like to learn perl, but I'm a bit confused.
++ If I understand correctly, I need a compiler and stuff.
Well, not a compiler as you think it is. Perl comes with a buildin
compiler, so there's no separate compiling you need to do.
++ I downloaded a "kit" from perl.com, but it is in a file format (.gz)
++ that I can't use. Downloaded a zipped version twice with no better luck.
Which file format you want depends on your setup, so I can't answer
that. You only need to download one file, that contains everything
you need. Look for 'latest.tar.gz' (or some other extension).
++ I could really use some help aquiring the components I need to start
++ learning and writing perl.
++ I had intended to get "Perl Cookbook" too.
The Perl Cookbook is still being written. You are far better off
by starting with "Learning Perl", the Llama book.
++ Also having a hard time
++ finding a newsgroup that posts in english.
This newsgroup is mainly in English. Be sure to read the FAQ and
the manuals that come with Perl. (Tons of *FREE* and excellent
documentation).
Abigail
--
perl -wle '$_ = 1; (1 x $_) !~ /^(11+)\1+$/ && print while $_ ++'
------------------------------
Date: 31 Jan 1998 04:53:11 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: can variables be generated on the fly
Message-Id: <6auann$h8c$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited and despammed author via email]
In comp.lang.perl.misc,
Cameron Kaiser <cdkaiser@concentric.net> writes:
:Why? There's nothing in the New Testament aka Programming Perl that calls
:symbolic references depreciated. Hard references are probably better, but
:symbolic references are convenient, logical and effective. And they act
:just as you would expect them to.
Oh? Did you ever realize that they only work on global variables.
This is virtually useless.
And use strict refs hates them, for good reason. They happen by
accident too easily.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"I just hope I'm never promoted to the level of my incontinence."
--Larry Wall
------------------------------
Date: 31 Jan 1998 04:53:51 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: can variables be generated on the fly
Message-Id: <6auaov$h8c$3@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, mike@stok.co.uk (Mike Stok) writes:
:You can use perl 5's soft references e.g.
Only on globals. Good programmers don't use many globals.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"You can't have filenames longer than 14 chars.
You can't even think about them!"
--Larry Wall in Configure from the perl distribution
------------------------------
Date: 31 Jan 1998 07:59:46 GMT
From: Cameron Kaiser <cdkaiser@delete.these.four.words.concentric.net>
Subject: Re: can variables be generated on the fly
Message-Id: <6aulli$dv4@examiner.concentric.net>
Tom Christiansen <tchrist@mox.perl.com> writes:
>Oh? Did you ever realize that they only work on global variables.
>This is virtually useless.
I just discovered this, p.255: "Only package variables are visible to
symbolic [soft] references. Lexical variables ... aren't in a package
symbol table." Oh well. They're still convenient, though, for dirty hacks,
which is all I seem to be writing these days. How many fleas does the
camel assign me for this indiscretion? :-)
--
Cameron Kaiser
cdkaiser at concentric dot net (it hasn't helped the spam yet though)
*** visit the Spectre Server at www.sserv.com
*** C64 software lives! www.computerworkshops.home.ml.org
------------------------------
Date: 31 Jan 1998 05:13:37 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Don't use signal handlers (was Re: Child processes)
Message-Id: <6aubu1$lau$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Chip Salzenberg
<chip@pobox.com>],
who wrote in article <6atlrv$cfu$1@cyprus.atlantic.net>:
> According to ilya@math.ohio-state.edu (Ilya Zakharevich):
> >Not only this, but also semantic change (the handlers will be delayed,
> >what is not always possible - consider SIGCHLD and SIGSEGV).
>
> There's no point in writing a SEGV handler in Perl.
There is a lot of points in writing a SEGV handler in Perl, one is
used in (say) Perl debugger.
> The semantics of SIGCHLD _were_ handled in the patch -- they required
> special coding, which was done.
Maybe. I did not read the patch, but I vaguely remember some discussion that
it is not possible to cover the semantics of SIGCHLD. I do not
remember what was the result of discussion.
> What's missing isn't tuits, but approval.
Without tuits to fix the broken semantics (say, I favor
$SIG{INT} = [ postponed => \&postponed_handler,
immediate => \&immediate_handler];
which would mean "postpone the signal on the first arrival, if the
second arrives before the first one is served, call immediate_handler")
one may wait for approval quite some time.
Ilya
------------------------------
Date: 31 Jan 1998 04:15:44 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Don't use signal handlers (was Re: Child processes)
Message-Id: <6au8hg$foh$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, chip@pobox.com writes:
:Second, for applications that need signal handlers, it is entirely
:safe to write an extension (a standard procedure for Perl coding) that
:includes a signal handler written in C.
Show us.
If you can't even handle SIGCHLD, then all is lost. SIGALRM
and SIGINT are also important. Perhaps SIGCONT and SIGWINCH.
Basically, you can throw away Perl for systems work. It's back
to dumb awk crud.
I won't do that. I'll take that rare core dump if I have to. And
you know what? I never get one, but then I am very careful.
I have daemons running forever, constantly spawning and SIGCHLDing,
and they never mysteriously vanish. I have others than require SIGALRMs.
These run for not just days, but weeks and months. No problems.
That's good enough for me. *BECAUSE OTHERWISE I WOULDN'T HAVE THEM*.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
Why would you WANT to port C news to your PC? Wouldn't it be smarter
and about as cost-effective to port your PC over to the trashcan and buy
a real computer that runs a real operating system like Unix? --Brian Kantor (brian@ucsd.edu)
------------------------------
Date: 31 Jan 1998 04:25:18 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Don't use signal handlers (was Re: Child processes)
Message-Id: <6au93e$foh$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, chip@pobox.com writes:
:>:Don't use Perl signal handlers. Ever.
:>Now, kindly explain to the innocent bystanders
:>when, where, and why that position is untenable.
:Never. I'm quite serious.
Did you know that every time you drive off in your car, there's
provably a finite chance that some drunk will snatch your life away?
Why does that stop you from getting in your car?
No. It means you drive carefully and try to get better
protection. But not getting in the car is simply not
an option. It's called acceptable risk.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"Noalias must go. This is non-negotiable." --dmr
------------------------------
Date: 31 Jan 1998 07:02:44 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: easy question about ARGV
Message-Id: <6auiak$767$1@marina.cinenet.net>
Joseph N. Hall (joseph@5sigma.com) wrote:
: I would say don't even pick that nit. Using double quotes
: on ordinary strings is perfectly acceptable style. It's
: "$filename" that is worth arguing about.
Yeah, it's certainly the least important issue I raised. In my own code,
I try always to use '' except when doing variable interpolation or char
escapes; that removes one (small) level of "what's going on here?"
processing when re-reading my code at 3am chasing bugs. :-)
---------------------------------------------------------------------
| 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: Sat, 31 Jan 1998 07:09:01 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: easy question about ARGV
Message-Id: <34d2bffd.524144494f47414741@radiogaga.harz.de>
CS44 Personel (dwu@svcam.amd.com) wrote:
: I'm reading in a file from one location on my unix system.
: And printing the contents to another location. Heres my code.
: open (guesthandle2 , "/usr/printtwo.html"):
You probably meant that filename to be ">/usr/printtwo.html", didn't you?
: open (guesthandle2 , "/var/blah/printfrom.log");
>From what's following, the handle here is meant to be guesthandle3, I guess?!
And once again, it's time for the Phoenix chant:
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
: while (<guesthandle3>) {
: print guesthandle2;
: (location for needed instruction)
: }
: Anyway i want to save the last line printed from the file
: printfrom.log.
: I have tried @a = @ARGV;
: and then print @a at the end of the program.
Read the perlvar POD about what @ARGV is for. It isn't useful here
(or did I miss something?).
How about
my $line;
open (GUESTHANDLE2 , ">/usr/printtwo.html") or die "Oops: $!":
open (GUESTHANDLE3 , "</var/blah/printfrom.log") or die "Oops, too: $!";
while (<GUESTHANDLE3>)) {
print GUESTHANDLE2;
$line = $_;
}
close(GUESTHANDLE3);
close(GUESTHANDLE2);
? On exit from the loop, $line will contain the last line printed.
cu,
Martin
--
| Martin Vorlaender | VMS & WNT programmer
Ceterum censeo | work: mv@pdv-systeme.de
Redmondem delendam esse. | http://www.pdv-systeme.de/users/martinv/
| home: martin@radiogaga.harz.de
------------------------------
Date: Sat, 31 Jan 1998 01:33:03 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: Enlightenment: regexes: fun with /x
Message-Id: <34D2C59F.A0A0AAD3@coos.dartmouth.edu>
Abigail wrote:
>
> Chipmunk (rjk@coos.dartmouth.edu) wrote on 1613 September 1993 in
> <URL: news:34D160DE.2C75D525@coos.dartmouth.edu>:
> ++ Question:
> ++ Rx is a regex with whitespace and/or comments.
> ++ R is Rx with the comments and embedded whitespace removed.
> ++ Find a useful Rx such that /Rx/x works, but /R/ does not.
>
> Oh, if that's your definition of the relation of R and Rx, there's
> a much simpler one:
>
> Compare:
>
> $_ = "aab";
> print "[1] ", pos, "\n" if /a/g;
> print "[2] ", pos, "\n" if / /x;
>
> and:
>
> $_ = "aab";
> print "[1] ", pos, "\n" if /a/g;
> print "[2] ", pos, "\n" if //;
>
> They will give different results.
Neat. And for a different reason than my answer used.
>From Programming Perl, 2ed, pg 70:
If the PATTERN evaluates to a null string, the last successfully
executed regular expression not hidden within an inner block (...)
is used instead.
So, the pattern in // evaluates to a null string, but the one in
/ /x doesn't. Which leads one to wonder just what / /x is matching.
Nicely done!
Chipmunk
------------------------------
Date: Sat, 31 Jan 1998 07:15:18 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Error executing Perl script
Message-Id: <34d2c176.524144494f47414741@radiogaga.harz.de>
Hans Van Lint (hvanlint@lodestar.be) wrote:
: I made a script file for a customer and put it online on our provider's
: server and it worked fine.
: Our customer has put it online on his provider's server and when they try to
: execute the script from there they get the following error:
: ExecCGI Error : No valid exec mapping found.
Note: It does not say "Perl Error"...
: Does anyone know what this error means and how it can be fixed??
Probably someone who knows the web server software used will know.
It seems that perl is not installed as a CGI script language.
But this is not perl's problem...
cu,
Martin
--
| Martin Vorlaender | VMS & WNT programmer
Ceterum censeo | work: mv@pdv-systeme.de
Redmondem delendam esse. | http://www.pdv-systeme.de/users/martinv/
| home: martin@radiogaga.harz.de
------------------------------
Date: 31 Jan 1998 07:06:31 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Forcing 7-digit number?
Message-Id: <6auihn$767$2@marina.cinenet.net>
Anthony Boyd (anthony@outshine.com) wrote:
: Clearly, the time is being used to seed the random number. I cannot find
: an example of how to get a random number that will vary independent of the
: time, although the man pages and books all say it's possible. Anyone have
: a pointer?
What version are you running? I believe 5.004_04 (the latest released
version) both removes the need for an explicit call to srand and uses a
better default seed generator than the current time.
---------------------------------------------------------------------
| 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: 31 Jan 1998 07:50:35 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Forcing 7-digit number?
Message-Id: <6aul4b$m35$3@client2.news.psi.net>
Anthony Boyd (anthony@outshine.com) wrote on 1614 September 1993 in
<URL: news:6attbo$a0e$1@news.ncal.verio.com>:
++ Jason Christian <jason@primal.ucdavis.edu> wrote:
++ > On 31 Jan 1998, Anthony Boyd wrote:
++ >
++ > > Programming Perl says on p 222 that printf should give me padding with
++ > > zeros for numbers. I think my shortcoming is not understanding the
++ > > various format options -- perhaps %7d is incorrect? Perhaps I need to
++ > > convert from a scalar, which might be interpreted as a string?
++ >
++ >man sprintf
++
++ Thanks, I feel stupid. I tried to have due dilligence, reading
++ Programming Perl & Learning Perl first. Another question, (checked the
++ books & man page, but maybe I don't understand it):
++
++ I'm running the script more than once per second. I was _hoping_ that the
++ random number would cause IDs assigned in the same second to be unique.
++ Instead, they're the same:
++
++ $ userid.pl
++ 8862077421852111
++ $ userid.pl
++ 8862077421852111
++
++ Clearly, the time is being used to seed the random number. I cannot find
++ an example of how to get a random number that will vary independent of the
++ time, although the man pages and books all say it's possible. Anyone have
++ a pointer?
Did you actually read the man page? What did the entry on srand say?
Either upgrade to perl5.004, or call srand with appropriate arguments.
Abigail
--
perl -wle '$, = " "; sub AUTOLOAD {($AUTOLOAD =~ /::(.*)/) [0];}
print+Just (), another (), Perl (), Hacker ();'
------------------------------
Date: Sat, 31 Jan 1998 05:09:45 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: generating a variable on the fly
Message-Id: <34d2a409.524144494f47414741@radiogaga.harz.de>
[This has nothing to do with modules. F'up set to comp.lang.perl.misc]
Vjekoslav Balas (eedvab@eed.ericsson.se) wrote:
: This may be a silly question, just thought maybe with perl it was possible
: as it is so good with parsing etc:
: Can a varibale be generated - this syntax is not correct but shows idea I'm
: on about:
: $a="var1";
: $"$a"="value of generated variable";
: (supposed to read something like
: $var1="value of generated variable";
This is called a symbolic reference. See the perlref POD.
If you
don't use strict 'refs'; and
dereference a (package, not lexical) variable and
that variable does not contain a hard reference
then
the value of the variable is taken to be the name of a variable.
For example,
no strict 'refs';
$a = 'var1'; # provided $a isn't declard with my()
$$a = 'value of generated variable'; # this sets $var1
$name = 'bam';
${$name x 2} = 'foo'; # this sets $bambam
cu,
Martin
--
| Martin Vorlaender | VMS & WNT programmer
Ceterum censeo | work: mv@pdv-systeme.de
Redmondem delendam esse. | http://www.pdv-systeme.de/users/martinv/
| home: martin@radiogaga.harz.de
------------------------------
Date: Sat, 31 Jan 1998 03:39:23 -0500
From: milagro@beanfield.com (milagro)
Subject: Help in finding Control Characters in a string.
Message-Id: <milagro-ya02408000R3101980339230001@news.erols.com>
Hi
I am searching a string for a series of Control Characters (Non-Printing).
I need to find the position of the Control Characters I find in the string.
Currently all I can find out is IF the characters are in the sting. Could
someone give me some help in how to find WHERE the control Characters are
found in the string? Thanks very much. Here is the a snip of the code I
have done already.
foreach $rec (@records)
{
$count++;
if ($rec =~/\000|\001|\002|\003|\004|\005|\006|\007|\008|\009|
\010|\011|\013|\014|\016|\017|\018|\019|\020|\021|\022|\023|\024|
\025|\026|\027|\028|\029|\030|\031|\032|\033|\034|\035|\036/)
{
print "Bad Character at Record Number $count: ";
#need to find out WHERE (numeric position) the bad characters are in the
$rec string.
}
Thanks very much
Mike Shavel
mshavel@erols.com
------------------------------
Date: 31 Jan 1998 04:57:18 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: module variable scope
Message-Id: <6auave$h8c$4@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, jdporter@min.net writes:
:Certainly a point worth remembering. Now, is there an easy way
:(i.e. not over the head of novice) to access variables in the
:package of the caller? Or should we simply say that this is
:bad practice?
Both. caller() can give you the package, but not the scope,
which means it only works on global variables. That's lame.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
There are still some other things to do, so don't think if I didn't fix
your favorite bug that your bug report is in the bit bucket. (It may be,
but don't think it. :-) Larry Wall in <7238@jpl-devvax.JPL.NASA.GOV>
------------------------------
Date: 31 Jan 1998 07:34:10 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Pattern matching poser
Message-Id: <6auk5i$m35$1@client2.news.psi.net>
Tom Phoenix (rootbeer@teleport.com) wrote on 1614 September 1993 in
<URL: news:Pine.GSO.3.96.980130191318.24986I-100000@user1.teleport.com>:
++ On 29 Jan 1998, Terry von Gease wrote:
++
++ > Given two regular expressions, is there any way to determine that there
++ > exists any string that will match both patterns? In other words, is
++ > there an intersection?
++
++ There's not guaranteed to be a string that matches even one of them, of
++ course! But my hunch is that a program could determine such a string
++ analytically, or prove that no such string exists. Writing the program (or
++ proving that no such program exists) is left as an exercise. :-)
Perl regex are not quite regular expressions, but the question if
the intersection of two regular sets contains zero, a finite or
an infinite number of strings is answerable.
In [1], theorem 3.3 says "regular sets are closed under intersection",
and the construction of a DFA for such an intersection is given.
Theorem 3.7 then says:
The set of sentences accepted by a FA M with n states is:
1) nonempty iff the FA accepts a sentence of length than n.
2) infinite iff the FA accepts some sentence of length l,
where n <= l < 2n.
Context free grammers however aren't closed under intersection,
see theorem 2.27 in [2].
Note that you can easily construct the intersection of two
regexes. Given /RE1/ and /RE2/, /\A(?=.*RE1).*RE2/s matches
the intersection.
[1] John E. Hopcroft & Jeffrey D. Ullman: "Introduction to Automata
Theory, Languages and Computation". Addison-Wesley, 1979.
ISBN 0-201-02988-X
[2] Alfred V. Aho & Jeffrey D. Ullman: "The Theory of Parsing,
Translations, and Compiling. Volume I: Parsing".
Prentice-Hall, 1972. ISBN 0-13-914556-7.
Abigail
--
perl -weprint\<\<EOT\; -eJust -eanother -ePerl -eHacker -eEOT
------------------------------
Date: Sat, 31 Jan 1998 08:13:43 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Perl 5.001 (NT Resource Kit) on NT4 SP3 / IIS3.0
Message-Id: <34d2cf27.524144494f47414741@radiogaga.harz.de>
Mik Porter (mik@mcgb.co.uk) wrote:
[...]
: I'm running IIS3 with ASP on NT4 SP3.
[...]
: If I POST from a form I get an HTTP Unsupported return, and if I use GET I
: get an access error stating that the directory cannot be read from.
: I've also tried in the default scripts directory under IIS with the same
: results.
: What am I doing wrong??
RTFM error.
The chapter about registry variables in IIS' "Installation and Administration
manual" has details on installing perl as a scripting language for IIS.
Also, www.perl.com has several links to pages describing how-to.
cu,
Martin
P.S.: Please consider to post your next question regarding IIS to
comp.infosystems.www.servers.ms-windows, as comp.lang.perl.misc
has enough traffic without off-topic things like this.
--
| Martin Vorlaender | VMS & WNT programmer
Ceterum censeo | work: mv@pdv-systeme.de
Redmondem delendam esse. | http://www.pdv-systeme.de/users/martinv/
| home: martin@radiogaga.harz.de
------------------------------
Date: Sat, 31 Jan 1998 19:30:44 +1100
From: Rory Hart <rory@hart.wattle.id.au>
Subject: Please don't hit me!
Message-Id: <34D2E133.276BA701@hart.wattle.id.au>
I know this may be a stupid question, is there anyway to compile a perl
program and make an executable? I have the feeling there is but I'm not
sure and, if there is is there one for linux x86? I can really do it on
any other system because the people I want to show it to are the makers
or Red Hat linux and might not be too impressed if I compile it on a
windows machine!
Thanks, Seeya.
------------------------------
Date: 31 Jan 1998 04:51:14 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: removing a line from a file
Message-Id: <6auak2$h8c$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, Chad R Cordero <ccordero@wiley.csusb.edu> writes:
:I am trying to remove a name from a list of names separated by newline
:in a file. I tried adapting an example of removing words in a string
:using splice:
:
: open(FILE, "+>file");
The horror! What does >file do? Eh? Where did you read to do that?
Gads.
Please please please read perlfaq5, second question.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
OK, enough hype.
--Larry Wall in the perl man page
------------------------------
Date: 31 Jan 1998 08:25:09 GMT
From: jhtodd@students.uiuc.edu (jeremy howard todd)
Subject: SelfLoader question
Message-Id: <6aun55$ags$1@vixen.cso.uiuc.edu>
Okay, so I have my required subroutines, etc. way up at the top of
my file, then the __DATA__ literal, and then the rest of the optional
subroutines.
My question is, suppose a script references one of the optional
subroutines. Does perl then parse and compile -all- the code after the
__DATA__ marker, or only until it reaches the desired function?
In other words, is there any advantage to sorting the subroutine
definitions after __DATA__ in decreasing order of likelihood of use, or
will it have the same result to group them together in, say, alphabetical
order, or grouped by function, etc.?
Thanks (:
-jht
--
Jeremy Todd Computer Programmer _,/
jhtodd@uiuc.edu ITCS On-line Development <__ \_.---.
http://www.cen.uiuc.edu/~jhtodd/ College of ACES, UIUC \_ / \
Zupfe Boy and Night Owl (And Kangaroo Aficianado) \)\ /\.\
=========================================================== // \\
"M-O-O-N, that spells moon" - Tom Cullen ,/' `\_,
------------------------------
Date: Fri, 30 Jan 1998 14:50:11 -0800
From: "Mishra, Aditya" <mishra.aditya@emeryworld.com>
Subject: Threads: Can't get the Thread (Thread_52 under Malcom Beattie's dir on CPAN)module to build
Message-Id: <6atjnt$1usm@ljcqs003.cnf.com>
I wanted to use Threads with perl.
I have built perl5.004_56 on UNIX(SunOs)
I followed all directions for building perl -Dusethreads etc as outlined in
the INSTALL/README/README.threads files.
Perl builds properly.
However when I build the Thread extension I get errors from Thread.xs.
Do I need to do something very specific to get this Module to build ?
Any Help would be appreciated.
Thanks
Adi
------------------------------
Date: Sat, 31 Jan 1998 01:06:37 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
To: Dave Till <davet@angel.uunet.ca>
Subject: Re: TYP21D (was: substitute...)
Message-Id: <34D2BF6C.5C6B20C1@coos.dartmouth.edu>
[posted and mailed]
Dave Till wrote:
>
> Tom Grydeland writes:
>
> >The author completely fails to grasp the difference between the null string
> >"" and the undefined value.
>
> To a certain extent, there is no real difference between
> how undefined variables and variables containing the null string are treated.
> For example, uninitialized variables are assumed to contain the null string;
> in other languages, you can't use a variable in an expression context unless
> you've first assigned something to it. (I've found Perl much easier to
> use than Expect/Tcl/Tk in this regard -- not that I like the
> idea of referencing unassigned variables, but at least you can do it when
> you have to.)
You still haven't gotten it, have you?
Unitialized variables are *not* assumed to contain the null string in Perl.
(Okay, to be fair, it is assumed, by people such as yourself, who happen
to be mistaken.)
An example:
~> perl -w
$a = undef;
$a =~ /./;
$b = "";
$b =~ /./;
__END__
Use of uninitialized value at - line 2.
~>
And another:
~> perl -w
$a = undef;
print '$a is ', (defined($a) ? "defined" : "not defined"), "\n";
$b = "";
print '$b is ', (defined($b) ? "defined" : "not defined"), "\n";
__END__
$a is not defined
$b is defined
~>
And another:
~> perl -w
@a = ("abc", "def", "", "ghi");
while ($_ = shift @a) {
print '@a element ', $a++, ": $_\n";
}
print "\n";
@b = ("abc", "def", "", "ghi");
while (defined($_ = shift @b)) {
print '@b element ', $b++, ": $_\n";
}
__END__
@a element 0: abc
@a element 1: def
@b element 0: abc
@b element 1: def
@b element 2:
@b element 3: ghi
~>
BTW, if you don't like referencing unassigned variables, maybe you should
look up the -w command line switch.
> In my experience, there aren't all that many cases in which the distinction
> between "" and the undefined value are important. Other users' mileage
> may vary. (If anyone out there knows of obvious pitfalls that beginning
> Perl programmers unaware of the distinction between "" and undefined
> risk falling into, please let me know.)
That's great. Let's hope that the people who learn Perl from your book never
need to program something outside the bounds of your own experience.
Chipmunk
------------------------------
Date: Fri, 30 Jan 1998 23:02:12 -0800
From: "Tom Stephenson" <gts@blueneptune.com>
Subject: Re: Word -> HTML
Message-Id: <6auhqp$1ef$1@sjs-news-01.blueneptune.com>
Microsoft offer a tool that converts word to html.
See their web site www.microsoft.com
I don't remember for sure but I think the tool is free.
(It came with my office97 version of word)
good luck,
Tom S.
Carry Megens wrote in message <34D09E18.337C@nym.sc.philips.com>...
>Patrick Husi wrote:
>>
>> Hi,
>>
>> I'm looking for a converter from Word format (i.e. .doc files) to HTML,
>> preferably for Perl or Java. Anyone ??
>>
>> Thanks
>> Patrick
>
>See the LAOLA homepage:
>
>http://user.cs.tu-berlin.de/~schwartz/pmh/
>--
>Carry Megens Designflow Services M 2.039 !!!
>Philips Semiconductors Consumer IC (0o0)
>Gerstweg 2 6534 AE Nijmegen \U/
>Nijmegen the Netherlands
------------------------------
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 1776
**************************************