[13227] in Perl-Users-Digest
Perl-Users Digest, Issue: 637 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 25 11:07:16 1999
Date: Wed, 25 Aug 1999 08:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 25 Aug 1999 Volume: 9 Number: 637
Today's topics:
=?iso-8859-1?Q?can=B4t?= flock files <isabelle@unixpro.mch.pn.siemens.de>
Re: A nice tough RegEx for u to solve..? (Abigail)
A simple perl newsreader engmark@techtradeinter.se
Re: A simple perl newsreader <revjack@radix.net>
DBD-ODBC-0.20 installing problems <f.agolli@studenti.to.it>
Re: extract text <sariq@texas.net>
Re: extract text <mzh@cntw.com>
Re: extract text (Abigail)
Re: extract text (Abigail)
Re: HARASSMENT -- Monthly Autoemail <greg@gamma.eds.columbia.edu>
How to "unoverride" functions? (pgmr)
Re: How to "unoverride" functions? (Abigail)
How to Address an email using CGI <trenic@nortelnetworks.com>
Japanase characters - how do I handle them? <kevin.porter@fast.no>
Re: killing my child (Donovan Rebbechi)
Mail subroutine using postie <paulm@dirigo.com>
Re: my() vs. local() (Larry Rosler)
Re: mysql interview (Abigail)
Re: mysql interview (Abigail)
Re: newbie: need help,LEARNING FROM A BOOK (Abigail)
Re: Overwrite the middle of a file. (Abigail)
Re: Perl a Black Sheep? (Mark D. Leitch)
Re: Perl a Black Sheep? (Abigail)
Re: Perl a Black Sheep? (Abigail)
Re: Perl don't stop (Abigail)
perl port for win32 problem vladisx@usa.net
Perl running on Unix and NT??? <phil@1918.com>
Re: Perl running on Unix and NT??? (Donovan Rebbechi)
Re: Rebuild perl mpeppler@mbay.net
Re: Sorting a list of lists (Arved Sandstrom)
Want to execute remote app w/o feedback? <pmt@top.mitre.org>
Re: Why use Perl when we've got Python?! (Sitaram Chamarty)
Re: Why use Perl when we've got Python?! (Sitaram Chamarty)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 25 Aug 1999 15:35:19 +0200
From: isabelle Leroy <isabelle@unixpro.mch.pn.siemens.de>
Subject: =?iso-8859-1?Q?can=B4t?= flock files
Message-Id: <37C3F116.317751D7@unixpro.mch.pn.siemens.de>
I tried two ways to lock files but it doesnīt work, could you help me?
Thanks.
first I tried:
sub easy_lock {
open (ISA, "isa.txt") || die "Can't Open isa.txt $!\n";
flock (ISA, 2) or warn ("canīt lock right now, will try again soon\n");
close (ISA);
}
and then:
sub lock {
flock(ISA, 2) || warn ("canīt lock right now, will try again
soon\n");
# and, in case someone appended
# while we were waiting...
seek(ISA, 0, 2);
}
sub unlock {
flock(ISA, 8);
}
open (ISA, "isa.txt") || die "Can't Open isa.txt $!\n";
&lock;
&unlock;
close (ISA);
...but each time it can't flock...
------------------------------
Date: 25 Aug 1999 09:15:56 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: A nice tough RegEx for u to solve..?
Message-Id: <slrn7s7umh.lb2.abigail@alexandra.delanet.com>
Lack Mr G M (gml4410@ggr.co.uk) wrote on MMCLXXXV September MCMXCIII in
<URL:news:1999Aug25.121705@ukwit01>:
"" In article <37C3CE04.F7105410@home.com>, Paul Dobbs <pdobbs@home.com> writes:
"" |>
"" |> The desire is to grab all the text between in a large string but only
"" |> at those spots in the string where the text is between "> and </A> AND
"" |> only if the string is 40 or more characters, and then split that text
"" |> up with a single blank space.
"" |>
"" |> s/[\">]?(\S{40,})[<\/A>]?/substr($1,0,39)." ".substr($1,39)/ieg;
"" |>
"" |> What is my mistake? Why won't it stick to just the defined
"" |> section of text?
""
"" [\">]? allows for '0 or 1' occurences, and it is 0 that gets matched.
"" Remove the '?' (in fact. move *both* of them!).
"" Also, both 39's should be 40 if you want to split after 40 chars.
""
"" However:
""
"" s/[\">](\S{40})(.*?)[<\/A>]/$1 $2/g;
""
"" will do what you want (you just get the regexp to pick out the first 40
"" chars for you - and use .*? to pick up the rest in a non-greedy
"" fashion).
Except that [">] (no need to escape the ") matches a " *OR* a >. It doesn't
match a " followed by a >. Similar for [<\/A>], that matches a < or a / or
a A or a >.
Not having the "> and </A> parts captured means that they'll be removed
during the substitution. Furthermore, it was said the string needed to
be split at 40 characters, not 40 non-blanks. It remains unclear what
needs to happen with:
">30-non-blanks-here</a>">30-non-blanks-here</a>
There are 3 ">, </a> pairs here, of which only one encloses more than 40
chars. Split or not? The (\S{40})(.*?) would split the part for the first
"> to the last </a>, as (\S{40}) would match the </a>"> in the middle.
You might want something like:
s{(?<=">)(.{40})(.*)(?=</a>)}{$1 $2}gs;
But that will go from the first "> to the last </a>.
Of course, if this has anything to do with HTML, any approach remotely
resembling a single regex is going to utterly fail.
Abigail
--
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 25 Aug 1999 13:34:36 GMT
From: engmark@techtradeinter.se
Subject: A simple perl newsreader
Message-Id: <7q0rdc$nrg$1@cubacola.tninet.se>
Hello.
Does anyone out there have some small and working
piece of perlcode that shows me how to get a given
message from a given newsgroup from a given news-
server and save it to disk?
What is the minimum configuration I would need
(except a perl-compiler and an Internet-connection)?
I intend to use the program on a slackware4 system.
Thanks.
Henrik Engmark
------------------------------
Date: 25 Aug 1999 13:55:23 GMT
From: revjack <revjack@radix.net>
Subject: Re: A simple perl newsreader
Message-Id: <7q0skb$hbd$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight
engmark@techtradeinter.se explains it all:
:Hello.
:Does anyone out there have some small and working
:piece of perlcode that shows me how to get a given
:message from a given newsgroup from a given news-
:server and save it to disk?
use News::NNTPClient;
It has very clear, simple examples in it.
------------------------------
Date: Wed, 25 Aug 1999 16:25:34 +0200
From: "Fredi Agolli" <f.agolli@studenti.to.it>
Subject: DBD-ODBC-0.20 installing problems
Message-Id: <7q0uud$47p$2@menelao.polito.it>
-- Hi to everybody,
l'm trying to install DBD-ODBC-0.20 module on a Linux machine.
Running 'perl Makefile.PL' compares the messagge
' You need to indicate where your ODBC Driver Manager is installed '.
Where can l find this Driver Manager and how could l use it ?
Thank's in advance
Fredi
E-mail: f.agolli@studenti.to.it
*************************************************
------------------------------
Date: Wed, 25 Aug 1999 08:09:53 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: extract text
Message-Id: <37C3EB21.EF2AFFF1@texas.net>
[placed the response where it belongs]
michael hagberg wrote:
>
> Marcel Grunauer wrote in message <37c3de79.299991@news>...
> >wrote:
> >
> >
> >Where did you look? You've already found it: substr
> >
> >perldoc -f substr
>
> problem is, I never know the length. I DO know between which characters I
> want to extract the text from. So I want to say like
> substr(EXPR,OFFSET,FROM,TO) where form and to is the boundaries. I dont see
> how to do that with the help of substr... or am I just blind?
Sounds like a job for a regex, if you mean "get all of the text in this
string between the 'blah' and the 'other blah'.
perldoc perlre
- Tom
------------------------------
Date: Wed, 25 Aug 1999 16:37:54 +0200
From: "michael hagberg" <mzh@cntw.com>
Subject: Re: extract text
Message-Id: <7q0qhn$781$1@news3.global-ip.net>
>perldoc -f index
>
>You can combine that with substr to do your extraction.
>
yes, I know, thats what I've done. I just dont find the code that fancy and
hoped there was some nice looking shortcut to get the work done. Guess
theres not...yet. Thanks for the help anyway!
Mick
------------------------------
Date: 25 Aug 1999 09:35:02 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: extract text
Message-Id: <slrn7s7vq1.lb2.abigail@alexandra.delanet.com>
michael hagberg (mzh@cntw.com) wrote on MMCLXXXV September MCMXCIII in
<URL:news:7q0iei$34u$1@news3.global-ip.net>:
`` is there any function like the substr that makes it possible to say "extract
`` from this point to this". I've looked everywhere but cant find anything like
`` this, ie there any or should I just write the extraction myself?
And substr won't do because of?
Abigail
--
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 25 Aug 1999 09:38:21 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: extract text
Message-Id: <slrn7s800h.lb2.abigail@alexandra.delanet.com>
michael hagberg (mzh@cntw.com) wrote on MMCLXXXV September MCMXCIII in
<URL:news:7q0l57$4ln$1@news3.global-ip.net>:
|| problem is, I never know the length. I DO know between which characters I
|| want to extract the text from. So I want to say like
|| substr(EXPR,OFFSET,FROM,TO) where form and to is the boundaries. I dont see
|| how to do that with the help of substr... or am I just blind?
perldoc -f index
And next time, be more specific in explaining your problem.
Abigail
--
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 25 Aug 1999 10:20:08 -0400
From: Gregory Haley <greg@gamma.eds.columbia.edu>
Subject: Re: HARASSMENT -- Monthly Autoemail
Message-Id: <37C3FB98.D20A74A5@gamma.eds.columbia.edu>
Glenn Wittrock wrote:
> Having missed the bulk of this discussion (thankfully), I throw in the
> following
>
This has been a most tedious thread. I am far more saddened by the
tone of flame but much more so by the source of the spamming mail
in the guise of a "Guide to etiquette" -- the very medium violates the
spirit of the mission. Sadly, the original message, with good hints at
how to use the news group with the most effectiveness is totally lost
in all this.
Of course, I have always found the delete key a very effective way to
avoid unwanted mail from known or unknown sources. I also manage
several listservs, which are all moderated so that I can prevent nasty
mail from reaching my subscribers.
> 1 Mail-bomb the bastrds, any bastards who deserve it. (after one polite
> warning of course)
hmmmmm.
>
> 2 Rat them out to their isp, nothing like a threat of cut the pipeline
> to encourage etiquette.
The problem is that the spam is originating from perl.com ! !
PAX, please.
ciao!
greg.
Gregory Haley
Electronic Data Service
Columbia University
------------------------------
Date: Wed, 25 Aug 1999 13:33:37 GMT
From: a@b.com (pgmr)
Subject: How to "unoverride" functions?
Message-Id: <F96FD15C3EB999E7.7688524E8CB97C5E.AE92050F9865D6BD@lp.airnews.net>
Is there a way that I can access an original function that may have
been overridden. Specifically, in this case, I am writing a library
of utilities for a project and part of it requires some custom date
routines.
The routines normally work fine. They begin by calling localtime.
The problem arises if someone decides to say "use Time::localtime;" in
the program that uses these routines. The routines stop working since
they were written to take the scalar or list returns for the base
localtime, not the OO of the overridden function.
I have tried saying main::localtime in the subroutines which didn't
work (as I expected). I tried saying "no Time::localtime;" within the
subroutines which gave me an error about not being able to find an
unimport method in Time::localtime. Even if this had worked, it would
have been a bad solution anyway, because I cannot predict what other
modules may come down the pike that will override the function.
I'd hate to have to use syscall to get the data from the OS and do all
the work myself, since this would be unportable. I do realize that
the reason functions like localtime can be overridden is so that they
can be overridden on a system that may not support them directly, but
I am willing to deal with that if it ever becomes an issue on some
strange OS.
In case the above is not clear, I have included some trivial examples
to show the problem. I have included the subroutines directly in the
following examples, but they would be used as a require in the actual
package.
This works --
#!/usr/bin/perl
print timefunct(), "\n";
exit;
sub timefunct () {
my @now;
my $str;
@now = localtime;
$str = "$now[0]:$now[1]:$now[2]:$now[3]";
return scalar $str;
}
This does not work --
#!/usr/bin/perl
use Time::localtime
print timefunct(), "\n";
exit;
sub timefunct () {
my @now;
my $str;
@now = localtime;
$str = "$now[0]:$now[1]:$now[2]:now[3]";
return scalar $str;
}
Any help would be greatly appreciated.
------------------------------
Date: 25 Aug 1999 09:44:43 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How to "unoverride" functions?
Message-Id: <slrn7s80ce.lb2.abigail@alexandra.delanet.com>
pgmr (a@b.com) wrote on MMCLXXXV September MCMXCIII in
<URL:news:F96FD15C3EB999E7.7688524E8CB97C5E.AE92050F9865D6BD@lp.airnews.net>:
'' This does not work --
''
'' #!/usr/bin/perl
'' use Time::localtime
^
;
'' print timefunct(), "\n";
'' exit;
''
'' sub timefunct () {
'' my @now;
'' my $str;
''
'' @now = localtime;
CORE::localtime;
'' $str = "$now[0]:$now[1]:$now[2]:now[3]";
^
$
'' return scalar $str;
'' }
''
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 25 Aug 1999 10:36:31 -0400
From: Tom Renic <trenic@nortelnetworks.com>
Subject: How to Address an email using CGI
Message-Id: <37C3FF6F.BD84A8BF@nortelnetworks.com>
I'm trying to set up a cgi script that will send out an email. I'm
having a problem trying to set it up so that a variable ($testrecipient)
is set in the "To" section and variables ($recipient, $recipient1,
$recipient2) are set in the "Cc" section as well as setting the
"Subject". Can someone PLEASE tell me how to do this? I can't get it to
run on HP-UX10 machine. HELP!!!!
------------------------------
Date: Wed, 25 Aug 1999 15:45:31 +0100
From: kev <kevin.porter@fast.no>
Subject: Japanase characters - how do I handle them?
Message-Id: <37C4018B.28D60C69@fast.no>
Hi,
This is just an exploratory probe of a question.
I have written a spider which goes out and collects news headlines from
various websites. However, it crossed my mind recently that I will also
have to do the same for a few Japanese sites, and I haven't got a clue
how to handle Japanese character sets.
Can anyone point me in the right direction?
thanks,
- Kev
------------------------------
Date: 25 Aug 1999 10:20:25 -0400
From: elflord@panix.com (Donovan Rebbechi)
Subject: Re: killing my child
Message-Id: <slrn7s7ut5.kgs.elflord@panix3.panix.com>
On Sat, 21 Aug 1999 06:18:22 -0700, Bill Moseley wrote:
>Do I need to do anything else besides close( PIPE ) if I want to
>properly kill the program before I've read all its output?
Nope.
>There's a paragraph in perlipc about setting $SIG{CHLD} but I'm unclear
>if that applies here.
Perl takes care of this by itself on piped opens. You only
need it if you manually fork() ( in which case, you'd better
have it ! )
>than backticks because it lets me 'kill off the child process early.'
>But then I don't see where it explicitly says how.
You'll need to look at how to get the child PID ( check perlipc )
THen you can use kill() to kill hte process ( see perlfunc ).
--
Donovan
------------------------------
Date: Wed, 25 Aug 1999 14:38:12 GMT
From: Stone Cold <paulm@dirigo.com>
Subject: Mail subroutine using postie
Message-Id: <7q0v4j$se7$1@nnrp1.deja.com>
I'm looking for a simple email subroutine using a third party email
program called postie. I'm on the right track, but a little stumped.
Anyone have a simple subroutine that calles a third party email program?
Any easier way to do this?
--
Paul R. Mesker
System Engineer
Dirigo Inc.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 25 Aug 1999 07:43:28 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: my() vs. local()
Message-Id: <MPG.122da0e8ef27b609989e94@nntp.hpl.hp.com>
In article <xjgaergg2a3.fsf@gamora.ndhm.gtegsc.com> on Tue, 24 Aug 1999
23:57:41 GMT, Vincent Murphy <vmurphy@gamora.ndhm.gtegsc.com> says...
...
> You can also use local with $/. Best run in a subroutine - or if you post
> it to this news group, Larry from HP will get mad. :-)
Not 'get mad' -- get even. :-)
I don't think you mean 'in a subroutine' -- simply a block will do just
fine. The body of a subroutine is a block. And so is what you use for
an example:
> Something like:
> foreach my $patch_file ( @files ) {
> my $file = "$mail_dir/$patch_file";
> local $/;
> undef $/;
That is unnecessary, because the value produced by the declaration alone
is 'undef'.
...
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 25 Aug 1999 09:47:00 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: mysql interview
Message-Id: <slrn7s80gp.lb2.abigail@alexandra.delanet.com>
barrytownbb@yahoo.com (barrytownbb@yahoo.com) wrote on MMCLXXXV September
MCMXCIII in <URL:news:7pvkeo$v15$1@nnrp1.deja.com>:
.. I am going to soon be interviewed for a mysql database programmer
.. position. Any ideas on what kind of questions are generally asked? I
.. wanted to get a headstart on essential reading for being "tech-ed out"
Let's hope your potential employer doesn't read this. ;-)
Of course, reading Knuth never hurts.
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 25 Aug 1999 09:48:52 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: mysql interview
Message-Id: <slrn7s80ka.lb2.abigail@alexandra.delanet.com>
Makarand Kulkarni (makkulka@cisco.com) wrote on MMCLXXXV September
MCMXCIII in <URL:news:37C36944.2BB77495@cisco.com>:
__ [ barrytownbb@yahoo.com wrote:
__
__ > I wanted to get a headstart on essential reading for being "tech-ed out"
__
__ A new book is now out --
__ MySQL and mSQL (Nutshell Series)
__ by Randy Jay Yarger, George Reese, Tim King
*ahum* Better not get me as the interviewer then.
Me: Did you learn anything from George Reese?
Candidate: *nod* *nod*
Me: You will be hearing from us. Goodbye.
Abigail
--
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 25 Aug 1999 09:51:46 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: newbie: need help,LEARNING FROM A BOOK
Message-Id: <slrn7s80pm.lb2.abigail@alexandra.delanet.com>
Michael de Beer (madebeer@igc.apc.org) wrote on MMCLXXXIV September
MCMXCIII in <URL:news:APC&1'0'50775d95'cb0@igc.apc.org>:
;; >I dont understand the concepts, of perl,when do you use " this and when
;; >do you use 'this,.?
;;
;; Perl usually thinks of $ as indicating a variable. a single ' is perl's
;; ways of saying, don't think of stuff as variables. For example, say you
;; have a string with the following content:
;; I have $10 dollars
;;
;; print "I have $10 dollars\n"; #outputs only part of what you want:
;; dollars
No, it will print:
I have dollars
and issue a warning about an undefined variable.
;; because perl thinks $10 is a variable name, does not have a value for
;; this variable and so prints nothing for the $10 part.
;;
;; print 'I have $10 dollars\n"; # But this does not think $10 is a
;; # variable and so outputs
;; I have 10 dollars
And that will print:
I have $10 dollars
Abigail
--
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
print } sub __PACKAGE__ { &
print ( __PACKAGE__)} &
__PACKAGE__
( )
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 25 Aug 1999 09:54:16 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Overwrite the middle of a file.
Message-Id: <slrn7s80ud.lb2.abigail@alexandra.delanet.com>
Greg Miller (gmiller@iglou.com) wrote on MMCLXXXIV September MCMXCIII in
<URL:news:37c2bf0d.297508@news.iglou.com>:
-- Does perl have a mechanism for overwriting part of a file,
-- without having to read/re-write the whole thing? (I.e. a database
-- table).
Sure, open the file in read/write mode (<+). But be sure to read
the manual and the FAQ to see what your limitations are.
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 25 Aug 1999 10:48:25 -0400
From: mleitch@ca.ibm.com (Mark D. Leitch)
Subject: Re: Perl a Black Sheep?
Message-Id: <ubtbv3ohy.fsf@ca.ibm.com>
<joeyandsherry@mindspring.com> writes:
> I told him of my learning of Perl and of how I used it, etc. As soon as I
> mentioned Perl and the UNIX server I use, he snarled. It was if I was
> speaking of a plague...He commented that Perl was not a "real" programming
> language, it is a scripting language and offered his dissertation on
> programming and Unix and other such things.
I have programmed in more languages than I can remember and to say "Perl" is
not a real programming language is ludicrous. In fact, when it comes to
portability, I have not found anything that can touch it. Our code runs on
over 10 distinct operating systems and we have yet to incur any problems
that are system specific (well, related to Perl anyway). In my experience,
current darlings like Java don't even come close.
Note I think there are problems with Perl (I hate the multitudinous hidden
variables but I have gotten over that) and I am sure the "Program Correctness"
crowd finds it hideous, but as a language it gets things done.
mark.
------------------------------
Date: 25 Aug 1999 09:59:21 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl a Black Sheep?
Message-Id: <slrn7s817u.lb2.abigail@alexandra.delanet.com>
joeyandsherry@mindspring.com (joeyandsherry@mindspring.com) wrote on
MMCLXXXV September MCMXCIII in <URL:news:7pvma4$ab5$1@nntp3.atl.mindspring.net>:
()
() Today I had an interview with an admissions counselor of a facility that
() offers training for the MCSE and the MCSD. I am hoping that this sort of
() certification may aid in my desire to change careers...
()
() I spoke to the admissions counselor and I questioned which training program
() would best enhance my limited exposure to NT. The Counselor introduced me to
() the Training Director, partly to answer my question and partly for
() prequalification...He asked of my experience.
()
() I told him of my learning of Perl and of how I used it, etc. As soon as I
() mentioned Perl and the UNIX server I use, he snarled. It was if I was
() speaking of a plague...He commented that Perl was not a "real" programming
() language, it is a scripting language and offered his dissertation on
() programming and Unix and other such things.
()
()
() Why is Perl treated with such disdain? I've found many occasions where Perl
() programmers say "Perl can do that...", which doesn't seem to reinforce what
() I experienced today.
And you find the opinion of an 'admission counselor' that's trying to get
you to pay for as many courses as possible relevant, because of....?
I bet they don't have Perl courses available at that center....
Abigail
--
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
|perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
|perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
|perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 25 Aug 1999 10:01:34 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl a Black Sheep?
Message-Id: <slrn7s81c4.lb2.abigail@alexandra.delanet.com>
Joe Schmoe (wookie@star.net) wrote on MMCLXXXV September MCMXCIII in
<URL:news:37C37C78.3DEF4541@star.net>:
??
?? Managers look down on Perl due to its being slower than compiled C.
?? Perl compilation may change this.
No. Go read the FAQ. The "slowness" of Perl isn't caused by non-compilation.
In fact, Perl gets compiled; it just isn't pre-compiled.
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 25 Aug 1999 10:04:24 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl don't stop
Message-Id: <slrn7s81hd.lb2.abigail@alexandra.delanet.com>
cls@quotient.net (cls@quotient.net) wrote on MMCLXXXIV September MCMXCIII
in <URL:news:7pu9ka$ff$1@nnrp1.deja.com>:
//
// When I launch a cgi script with my browser and I stop it by closing the
// browser, perl.exe is always running and takes all the ressources
You don't "stop" CGI programs by closing the browser. The browser doesn't
communicate with your CGI program.
// I use Netscape Entreprise Server 3.5 on NT 4.0 SP3
Netscape *AND* NT? Oh well. If you ask for trouble, don't complain
if you get it.
Abigail
--
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 25 Aug 1999 14:33:59 GMT
From: vladisx@usa.net
Subject: perl port for win32 problem
Message-Id: <7q0usn$s4k$1@nnrp1.deja.com>
HELP - I need the perl 500560 build for win32 binary.
I could compile with no problems for unix and linux
but on windows I get only errors...
can anyone help me and send me these binaries or point me
to a place I can get them (or have an experience doing this...)
PLZ I need this as soon as possible!!!
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 25 Aug 1999 09:22:32 -0400
From: Phil Buckley <phil@1918.com>
Subject: Perl running on Unix and NT???
Message-Id: <37C3EE18.D06A547A@1918.com>
I ran into a perl snafu the other day and can't figure it out. It's not
a syntax problem (for a change) but a networky question.
I work for a tiny web development company. We run our internal network
off a linux server. Everything was going fine until we met with our
newest client. Their network is NT only. So when we signed on to do a
project for them, they gave us one of their NT servers so we could
develop directly on the machine that the small perl/MySQL application
will sit on. Development on the NT box also went okay.
Here's the icky part...
We use the linux server as our gateway for the network and only have a
dial up PPP connection which gives us a dynamic IP address. We need to
let the client access to their machine, to do some data entry. If I
mount the NT box as part of the linux system, the perl written on the NT
box tries to use the perl on the linux machine.
The big question - is there a way to make the perl on the NT box only
use the Windows perl?
------------------------------
Date: 25 Aug 1999 10:09:05 -0400
From: elflord@panix.com (Donovan Rebbechi)
Subject: Re: Perl running on Unix and NT???
Message-Id: <slrn7s7u80.kgs.elflord@panix3.panix.com>
On Wed, 25 Aug 1999 09:22:32 -0400, Phil Buckley wrote:
>mount the NT box as part of the linux system, the perl written on the NT
>box tries to use the perl on the linux machine.
the perl program ( ie /usr/bin/perl or whatever ) is a binary. On the
linux system it's a linux binary, on the NT system it's an NT binary.
You can't run NT executables on linux, so of course it needs to use
the perl you have installed on the linux box.
>The big question - is there a way to make the perl on the NT box only
>use the Windows perl?
If you want to use the windows perl, you need to run it on the
windows box ( not run it on the inux box from a mounted NT filesystem )
--
Donovan
------------------------------
Date: Wed, 25 Aug 1999 14:32:27 GMT
From: mpeppler@mbay.net
Subject: Re: Rebuild perl
Message-Id: <7q0upr$s46$1@nnrp1.deja.com>
In article <37C14689.4EBFF94C@visbyte.com>,
Mars <mars@visbyte.com> wrote:
> I encounter a problem recompiling Perl. Here is the info:
>
> I am setting up a Sybase SQL server on a RedHat 6.0 Linux machine and
> decide to write application in Perl with sybperl. During installing
> sybperl, the 'make test' fails because of the conflict between Sybase
DB
> library and Berkeley DB library. Therefore, I have to recomple Perl.
>
> I run sh Configure and answer all the questions prompted with default
> answers except leaving out -ldb at the linking library section. 'make
> test' fails on test 12 on anydbm.t. Now I have no idea how to make it
> work.
>
You also need to remove -lndbm from the libraries section.
Michael
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 25 Aug 1999 10:15:34 -0300
From: Arved_37@chebucto.ns.ca (Arved Sandstrom)
Subject: Re: Sorting a list of lists
Message-Id: <Arved_37-2508991015340001@dyip-28.chebucto.ns.ca>
In article <37c3603e@news.sisna.com>, "DJ" <djten@sisna.com> wrote:
> If I had ORDER BY capability, I would order by field3. I've been trying to
> figure out code that will do a sort that will achieve the same result. I
> was hoping... actually been _trying_ to get some implementation of the
> Schwartzian Transform to work, but have so far failed. Might be on the
> wrong track. I'm thinking this has to have been dealt with before, and that
> someone must have a recipe, or something, that will perform a sort on a list
> of lists, based upon one element of the list within the list.
A Schwartzian Transform will do it. Take the most basic example right out
of the Perl Cookbook or a manpage, and make your computable field $_->[2].
Arved
------------------------------
Date: Wed, 25 Aug 1999 10:14:25 -0400
From: Patrick Tully <pmt@top.mitre.org>
Subject: Want to execute remote app w/o feedback?
Message-Id: <37C3FA41.35D318B1@top.mitre.org>
Hi, I wrote this program that will registar you with another site's free
email, among other things. The problem is, is that, when it registars
you via this remote registration app, the remote app creates a web page
saying please click here to logon. I don't want to have that page show
up. Is there anyway for me to execute the script and somehow block the
feedback it gives me? something like changing the output or something?
I want my program to spit out a its own dynamic page after it has
executed the remote app. Any ideas?
Thanks,
-Pat Tully-
tcblue82@yahoo.com
------------------------------
Date: 25 Aug 1999 04:57:20 -0700
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <slrn7s5u5s.cl3.sitaram@diac.com>
On 12 Aug 1999 16:10:35 GMT, I R A Darth Aggie
<fl_aggie@thepentagon.com> wrote:
>+ Happy languages like FORTRAN come to mind.
>
>Heh. I thought f90 got rid of the column-dependencies, but I'm not so
>sure.
I'm not either. However, as someone who has used both the old
FORTRAN-IV and FORTRAN-77 (the former more than the latter!) I can
say that in these languages you *could* indent your code.
The spacing requirement was only for the first 6 columns: after
that you can do what you want. In this manner, this is almost the
same as COBOL (s/6/7/; for COBOL). Also, some compilers offered a
compile flag that would deal with this a little more
heuristically, allowing programmers to essentially forget about
those column restrictions.
But FORTRAN is a little more interesting. FORTRAN is probably the
only language I have heard of where spacing does not matter AT ALL
(once you've crossed the 1st 6 columns), except of course inside
literal strings (aka Hollerith constants - but I'm dating myself
very horribly now :-)
In FORTRAN, for instance, these two are equivalent:
VAR1 = 10
V A R1 = 10
In fact, legend has it that a spacecraft was lost due to this:
FOR I = 1. 10
where the programmer meant:
FOR I = 1, 10
which changes the meaning entirely - the former is creating a
brand new variable called "FORI" (too bad they didn't have a "-w"
that said "Name FORI used only once: possible typo at..."
It is so easy to mistake a period for a comma (esp. when you're
working with prinouts from a line printer whose band has seen
better days!).
------------------------------
Date: 25 Aug 1999 04:57:21 -0700
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <slrn7s5uh1.cl3.sitaram@diac.com>
On 15 Aug 1999 06:24:32 -0700, Tom Christiansen
<tchrist@mox.perl.com> wrote:
>I've heard of people spending hours trying to find the bug in C
>code when they'd essentially written:
>
> while (condition)
> statement1;
> statement2;
The COBOL world suffers from a similar predicament. Upto
COBOL-74, (I'm not familiar with the latest COBOL - aka OO COBOL,
aka "ADD 1 TO COBOL" :-), the only IF-scope terminator was either
an ELSE or a period.
There used to be an old riddle, part of whose punchline was
"...the other gets screwed if she misses a period", but I won't
repeat it since this is a family newsgroup :-)
Apologies for being wildly offtopic, being too far behind in my
newsgroup reading, and being off-colour :-)
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 637
*************************************