[9071] in Perl-Users-Digest
Perl-Users Digest, Issue: 2689 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 22 12:07:48 1998
Date: Fri, 22 May 98 09:00:41 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 22 May 1998 Volume: 8 Number: 2689
Today's topics:
Re: .= food for thought? <jefpin@bergen.org>
Re: .= food for thought? (Charlie Stross)
Re: Getting hex codes from string jack_chastain@hotmail.com
Re: GNU attacks on the open software community <JYoungman@vggas.com>
Re: GNU attacks on the open software community (Dave Barr)
Re: GNU attacks on the open software community <millNO@SPAMludd.luth.se>
Re: GNU attacks on the open software community (Leslie Mikesell)
Re: GNU attacks on the open software community (Stefaan A Eeckels)
Re: GNU attacks on the open software community <cmcurtin@interhack.net>
Re: GNU attacks on the open software community (Leslie Mikesell)
Re: GNU attacks on the open software community (Leslie Mikesell)
Re: GNU attacks on the open software community (Leslie Mikesell)
Re: Help needed - Will pay. <cynthee@earthlink.net>
Help needed with reg. expr. (newbie) rgold@sctcorp.com
Re: Help! Need script that will load new image every da <brianm@kodak.com>
How to use Mail::Header module? <jspath@mail.bcpl.lib.md.us>
Re: news/mail posting <rootbeer@teleport.com>
Perl Cron/At weirdness (Paul Falbe)
Re: Perl Cron/At weirdness <rootbeer@teleport.com>
Re-direct question <pbuckley@tiac.net>
Re: Sequestration <webmaster@fccjmail.fccj.org>
Re: Sequestration (Alan Schwartz)
to read CSV into an array and back into CSV/perlTK book (Franz Kaufmann)
Re: Tom Christiansen attacks the free software communit (I R A Aggie)
Re: Tom Christiansen attacks the free software communit (Barry A. Warsaw)
What's the right idiom? <paul.joslin@sdrc.com>
Re: Why NOT crypt??? (Chris Nandor)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 22 May 1998 10:29:51 -0400
From: Any more mini-dilemmas I should know about? <jefpin@bergen.org>
To: Belg4mit <belg4mit@aol.com>
Subject: Re: .= food for thought?
Message-Id: <Pine.SGI.3.95.980522102731.16351A-100000@vangogh.bergen.org>
>There is indeed.. I could of swarn I'd tried it to no avail...
>maybe it was =.
But that raises an interesting question. It would be handy to have a
concatenation operator that works thusly:
$var = "string" . $var; # $var OP "string";
It would come in handy.
That's all.
--
For the life of me, I cannot remember what made us think that we
were wise and we'd never compromise.
- "Freshmen" (Verve Pipe)
-- Jeff Pinyan | users.bergen.org/%7Ejefpin | techmaster@bergen.org --
NYPM | ICQ# 10222129 | 10222129@pager.mirabilis.com | qw[jeff] on EFnet
&jp('"($``','','$)EDF8```','$*52J4```','$+E1G4```','#J``@','#2__`');sub
jp{for$w(@_){$_=unpack('B48',unpack('u',$w));$c=~tr/10/# /;print;}}
------------------------------
Date: Fri, 22 May 1998 15:23:50 GMT
From: charlie@antipope.org (Charlie Stross)
Subject: Re: .= food for thought?
Message-Id: <slrn6mb622.upr.charlie@cs.ed.datacash.com>
On Fri, 22 May 1998 10:29:51 -0400, Any more mini-dilemmas I should know about?
<jefpin@bergen.org> wrote:
>>There is indeed.. I could of swarn I'd tried it to no avail...
>>maybe it was =.
>
>But that raises an interesting question. It would be handy to have a
>concatenation operator that works thusly:
>
>$var = "string" . $var; # $var OP "string";
>
>It would come in handy.
>
>That's all.
Ahem: you mean like this?
# perl -e 0 -d
Loading DB routines from perl5db.pl version 1.01
Emacs support available.
Enter h or `h h' for help.
main::(-e:1): 0
DB<1> $var = "bar";
DB<2> $var = "foo" . $var;
DB<3> print $var, "\n";
foobar
Clue: Perl has more operators than most people can remember.
-- charlie
------------------------------
Date: Fri, 22 May 1998 14:59:24 GMT
From: jack_chastain@hotmail.com
Subject: Re: Getting hex codes from string
Message-Id: <6k43sc$lfm$1@nnrp1.dejanews.com>
In article <6k3e05$o9e$1@nuscc.nus.edu.sg>,
kek@olympus.irdu.nus.sg (Choo Heng Kek) wrote:
>
> Greetings
>
> I want to read in a string and then print the hex codes of
> each character of the string.
>
> The following is what I do now, but am hoping for more "elegant"
> solutions from perl hackers out there:
>
> @buf = unpack('C*', $string);
> while(@buf){ printf "%02x:", shift @buf }
>
> If $string is "abc", the output is "61:62:63".
>
> Any suggestions or comments?
> Thanks for reading.
I use an unpack of H (or h, depending on the "endedness) which extracts
(directly) the hex value. I use a concatenation to tell me how many hex values
to extract (2 for each byte!), but H* may work for you as well.
You may need to "walk the string" with this method to put in colons (I am to
new to perl to do better at the mement! There is probably a better way!), but
an extract on your 'abc' would look like this:
@Buf = unpack('H*', 'abcdefg')
print "@Buf\n";
61626364656667
You can probably work it from here!
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 22 May 1998 15:20:25 +0100
From: James Youngman <JYoungman@vggas.com>
To: Jan Vroonhof <vroonhof@frege.math.ethz.ch>
Subject: Re: GNU attacks on the open software community
Message-Id: <u1btsq5qvq.fsf@noisy.vggas.com>
>>>>> "Jan" == Jan Vroonhof <vroonhof@frege.math.ethz.ch> writes:
Jan> James Youngman <JYoungman@vggas.com> writes:
>> Speaking of that, has anyone actually *seen* any documentation
>> published under the GPL? I don't think I have.
Jan> Huh? Most gnu stuff comes with documentation under the same
Jan> licence as the software.
--- No, it doesn't! ---
Under GNU's normal license for documentation (*NOT* the GPL):-
accounting.info as.info autoconf.info bfd.info binutils.info
bison.info cpp.info cvs.info dc.info diff.info ed.info fileutils.info
find.info gasp.info gawk.info gcc.info gdb.info gdbint.info gdbm.info
gettext.info git.info gpm.info gprof.info history.info indent.info
info-stnd.info info.info iostream.info ispell.info ld.info libc.info
libg++.info m4.info make.info makeinfo.info mtools.info readline.info
recode.info remsync.info screen.info sh-utils.info sharutils.info
stabs.info standards.info tar.info texinfo.info textutils.info
time.info
Apparently GPL'ed:-
features.info Part of the Bash documentation. This file has
no separate copyright notice and indicates that
it is part of GNU Bash and so presumably carries
the same license; the GPL.
...and that's it. It's the only one. ipc.info is also under the GPL,
but it's not an FSF document. (it's (C) krishna balasubramanian)
So to answer my question, I have now seen *one* set of documentation
from the FSF which is itself under the GPL.
GNU's normal license for documentation is:-
> Copyright (C) 1993, '94, '95, '96, '97 Free Software Foundation, Inc.
>
> Permission is granted to make and distribute verbatim copies of this
> manual provided the copyright notice and this permission notice are
> preserved on all copies.
>
> Permission is granted to copy and distribute modified versions of
> this manual under the conditions for verbatim copying, provided also
> that the section entitled "GNU Library General Public License" is
> included exactly as in the original, and provided that the entire
> resulting derived work is distributed under the terms of a permission
> notice identical to this one.
>
> Permission is granted to copy and distribute translations of this
> manual into another language, under the above conditions for modified
> versions, except that the text of the translation of the section
> entitled "GNU Library General Public License" must be approved for
> accuracy by the Foundation.
------------------------------
Date: 22 May 1998 15:05:56 GMT
From: barr@cis.ohio-state.edu (Dave Barr)
Subject: Re: GNU attacks on the open software community
Message-Id: <6k448k$nuf$1@news.cis.ohio-state.edu>
In article <m2iumyhm9o.fsf@mailhost.neuroinformatik.ruhr-uni-bochum.de>,
David Kastrup <dak@mailhost.neuroinformatik.ruhr-uni-bochum.de> wrote:
>kfox@pt0204.pto.ford.com (Ken Fox) writes:
>
>> Zenin <zenin@bawdycaste.org> writes:
>> > GPL code is only "free" for "free use". It's great for use where
>> > you don't ever want your code used for commercial use, but if you
>> > do it's a nightmare.
>>
>> That's true. That's why it exists.
>
>Sigh. Wrong. There are quite a few business thriving commercially on
>GPLed code.
Irrelevant.
"businesses thriving commercially on GPLed code" is not the same as
"businesses selling commercial software." or even "using the code
in commercial software".
RedHat or others shipping GPL programs with their quasi-commercial
system is not what we're talking about.
--Dave
--
http://www.cis.ohio-state.edu/~barr/
barr@cis.ohio-state.edu
------------------------------
Date: Fri, 22 May 1998 17:24:30 +0200
From: Olof Oberg <millNO@SPAMludd.luth.se>
Subject: Re: GNU attacks on the open software community
Message-Id: <356598AE.1AECC89E@SPAMludd.luth.se>
David Kastrup wrote:
> Mercedes will acknowledge the importance Bosch plays for their cars.
> Still they would object to Bosch calling Mercedes cars Bosch/Mercedes
> or a variant Bosch car.
>
> The whole credit issue could have been managed much much more sanely.
> Choosing the "brand name" for the attack was pretty stupid.
Another example. Ford Cosworth. Put the Cosworth engine (and
probably some addtional tweaks of braking systems etc) into
a Ford and you get a Ford Cosworth. Put the Linux kernel into
a mainly GNU system than you have a GNU/Linux system :).
/mill
--
#############################################################
# millNO@SPAMludd.luth.se # http://pedgr571.sn.umu.se/~mill #
#############################################################
------------------------------
Date: 22 May 1998 10:22:26 -0500
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: GNU attacks on the open software community
Message-Id: <6k457i$k4d$1@Mars.mcs.net>
In article <6k3via$mne$1@news.cis.ohio-state.edu>,
Dave Barr <barr@cis.ohio-state.edu> wrote:
>In article <u1hn2cbtqtz.fsf@mary-kay-commandos.MIT.EDU>,
>Thomas Bushnell, n/BSG <tb@mit.edu> wrote:
>>I don't recall any GNU people telling Linus that his kernel was
>>pointless. I remember lots of people being quite pleased with it.
>
>I do remember quotes from RMS saying essentially "Linux is interesting,
>but the Hurd is the way to go".
But that was back in the days when people still thought the problems
of a micro-kernel would be easy to solve...
Les Mikesell
les@mcs.com
------------------------------
Date: 22 May 1998 13:12:01 GMT
From: Stefaan.Eeckels@ecc.lu (Stefaan A Eeckels)
Subject: Re: GNU attacks on the open software community
Message-Id: <6k3tj1$7l9$1@justus.ecc.lu>
In article <5D477EF9ADF9340C.9A26ECAEE0E326D0.E84EBB992569E55E@library-proxy.airnews.net>,
fantome/@/usa/./net (le Fanttme) writes:
> On 22 May 1998 08:58:26 GMT, Stefaan.Eeckels@ecc.lu (Stefaan A
> Eeckels) wrote:
>
>>Unless you're having a free (ahem, no charge) network connection, or
>>use your company's feed to download Perl for your own use, why do
>>you think electronic distribution doesn't make money for someone
>>else but the original author?
>
> Because an infrastructure charge does not constitute a publication
> charge. When you're being charged for your network connection, you're
> not being charged for the "publication" of the perl documentation.
So we're indeed splitting hairs. The point was already made that
for some people (those without or with expensive network connections)
a CD or a book might be better -or the only- options to get hold
of the Perl documentation. If I'm not mistaken, the current PerFAQ
license makes that impossible.
--
Stefaan
--
PGP key available from PGP key servers (http://www.pgp.net/pgpnet/)
___________________________________________________________________
Williams and Holland's Law: If enough data is collected,
anything may be proven by statistical methods.
------------------------------
Date: 22 May 1998 11:32:37 -0400
From: cmcurtin <cmcurtin@interhack.net>
To: chris+usenet@netmonger.net
Subject: Re: GNU attacks on the open software community
Message-Id: <86wwbemicq.fsf@dr-teeth.cis.ohio-state.edu>
chris+usenet@netmonger.net writes:
> RMS believes that his style of free software and his licensing system
> are the best way to do good for the computing community. Is he not
> allowed to have this opinion? He is mad at O'Reilly because they sell
> a lot of books about GNU software but they don't donate anything to
> the FSF. His response is to ask people to write free books which the
> FSF can sell to raise money (and you can also photocopy or download
> them). Is any of this truly evil? You may disagree (I sometimes do),
> but I think it is self-evident that what RMS is doing is logical and
> consistent with respect to his philosophy of free software.
And how would RMS, et al, react to find one of the "GNU Free Books"
gutted, authorship removed, examples changed to things that don't
work, and then sold in bookstores everywhere because the publisher is
one with good distribution channels?
This is *precisely* what has happened time and again by morons who
pretend to be Perl experts. They steal Larry's work. They steal
Tom's work. They steal Randal's work. They steal from us all.
I authored the CGI/Perl chapter for the Internet Edition of Unix
Unleashed. They wanted something that was real friendly that got
people going. I decided that what was really needed to get new people
into using Perl for CGI programming is some good background to
understand what's going on, some words of sage advice, and an
introduction to a good tool to get stuff done quickly. I emailed
"Dr. Dr." Lincoln Stein and explained what was going on, and that I'd
like to use his excellent CGI.pm module as the basis for the example
and reference section of the chapter. I didn't want to republish his
work, but what I needed would be in the same basic style as his
documentation, so I *asked* for permission to write about CGI.pm in
the same style as what he has in the documentation. He agreed, and
all went as well as could be expected given the schedule I was given.
And I provided pointers to Lincoln's documentation. I hope that
people who have been introduced to CGI programming through my work
followed the links to Lincoln's documentation, saw that he has a book
of his own, and bought it.
Now, I also am the primary author of a USENET FAQ. I know that my FAQ
has been included on numerous CDs. (The HTTP_REFERER tells me that
people are pulling it off of high-lettered DOS/Windoze drive letters,
which vary, but always have the same directory structure under the
drive letter.)
I've only been asked twice if my FAQ may be included, but given the
sorts of directory structures I'm seeing, I believe that the FAQ has
been included on more than two CDs. Both times that someone bothered
to ask, I said "yes", but asked that a copy of the CD be sent to me.
I have not received any CDs with my FAQ on it. This is annoying. Is
it too much to ask to profit from my work? Is it too much to ask that
a copy of the CD be sent to me?
It really doesn't bother me that much, though. Because the FAQ,
though useful, is only a few pages long. It did take time to write,
correct, add contributed parts, and maintain. But I knew that going
into it. That's fine. If, however, I wrote a gratis book on the
topic, taking much longer to produce, I would be really annoyed about
pirates profiting from my work without doing a single thing
themselves.
Tom's writings, collected over a period of years, have been
surreptitiously copied and modified time and again. He is completely
justified in his indignation.
What bothers me about the GNU community is that there is a level of
arrogance in assuming that the One True Way(tm) of software
development (and apparently documentation, as well!) is based on what
Eric Raymond calls the Bazaar model. Making such an assertion is
absolutely stupid. Projects that operate in what Eric calls the
"Benevolent Dictatorship" mode have produced significant pieces of
work. The *BSD operating systems. XEmacs. Apache. Perl.
Tom is picky about his writings. I'm sure Larry is, too. Does it
come as a surprise, given that both Tom and Larry are formally trained
as linguists?
If something in Perl is broken, why not submit the patch to fix it,
and relevant documentation to p5p? If Tom--or whomever the keeper of
the relevant document is--doesn't like it, let the keeper change his
documentation to reflect the program's functionality in the way he
likes, just as you'll be allowing the keeper of the software you've
modified the opportunity to incorporate your changes?
And the fact of the matter is, there isn't a whole lot that you need
to do that requires mucking with Perl itself. That's the whole point
of the modular structure of Perl5. You write a MODULE. You
distribute it under YOUR OWN CONDITIONS. Your code, your
documentation, autographed 8x10 glossy pictures, etc., are all YOURS.
No need to mess with Perl itself.
This is not evil. This is not stupid. Neither, for that matter, is
the Bazaar method, whereby everyone gets to do whatever he likes, with
or without the permission of the original author. However, expecting
everyone to look at the world and its problems in the same way is.
The FSF did not create Perl. The FSF has no business telling the Perl
community how to do its work. The FSF, in its arrogance and apparent
lack of desire to cooperate with other entities, is alienating itself
from large pools of developers that could help it achieve its
(generally lofty) goals.
This is a shame, no matter how you look at it. And it would be
terrible to allow this to create a rift between the two communities.
The rift is being created by the FSF, who refuses to recognize the
Perl Community's right to do as it pleases. If this trend should not
reverse, if the rift becomes Yet Another Irreconcilable Difference
between the FSF and some other entity of the free software community,
I know which side I'll be on, and it won't be with The Free Software
Foundation or the GNU Project.
--
Matt Curtin cmcurtin@interhack.net http://www.interhack.net/people/cmcurtin/
------------------------------
Date: 22 May 1998 10:33:06 -0500
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: GNU attacks on the open software community
Message-Id: <6k45ri$kef$1@Mars.mcs.net>
In article <m2g1i2hlye.fsf@mailhost.neuroinformatik.ruhr-uni-bochum.de>,
David Kastrup <dak@mailhost.neuroinformatik.ruhr-uni-bochum.de> wrote:
>pudge@pobox.com (Chris Nandor) writes:
>
>> In article <_bS81.68$152.620589@cam-news-reader1.bbnplanet.com>, Barry
>> Margolin <barmar@bbnplanet.com> wrote:
>>
>> # The GPL doesn't force you to share with your friends, it allows it.
>>
>> What an odd thing to say. Since when does something like sharing your own
>> work with your friends need to be allowed? Does it allow me to cross the
>> street without my mommy, too?
>
>You are talking nonsense. The GPL has no impact on you sharing your
>work in any way you like with whoever you want, even if you have given
>copies of your work out before licensed under GPL, BSD, proprietary
>licenses whatever.
Yes it does, if your work consists of making GPL code and non-GPL
code interoperate. The GPL takes away your right to share such
code under any circumstances. You can write it for yourself, you
can use it, someone can hire you to write such code for their own
use, but you can't give them a copy.
>The GPL only applies to you for work that is licensed to you under
>it. For such work, it allows sharing it as well as any works you may
>derive from it with your friends.
Only so long as it doesn't involve linking with code that hasn't
been blessed by the GPL. In that case it prohibits sharing.
Les Mikesell
les@mcs.com
------------------------------
Date: 22 May 1998 10:41:10 -0500
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: GNU attacks on the open software community
Message-Id: <6k46am$kih$1@Mars.mcs.net>
In article <wsn67iy96vd.fsf@harper.uchicago.edu>,
robert havoc pennington <hp@pobox.com> wrote:
>les@MCS.COM (Leslie Mikesell) writes:
>> >Randal and Tom (and others of course). I think RMS is annoyed because
>> >free software is finaly being taken seriously, and its Linux, Apache
>> >and perl that people are looking at.
>>
>> And for obvious reasons. These do not have restrictions that prevent
>> commercial use or linking with code under different copyrights. People
>> can actually use them for something of value.
>>
>
>Um, well, except for Linux, among those mentioned. ;-)
>From the top of the Linux version of the COPYING file:
--
NOTE! This copyright does *not* cover user programs that use kernel
services by normal system calls - this is merely considered normal use
of the kernel, and does *not* fall under the heading of "derived work".
Also note that the GPL below is copyrighted by the Free Software
Foundation, but the instance of code that it refers to (the linux
kernel) is copyrighted by me and others who actually wrote it.
Linus Torvalds
--
>And Samba, Emacs, glibc, automake, autoconf, the GNU utilities, GIMP,
>and lots of other stuff, all of which see major use in commercial
>environments and some of which are a source of profit by commercial
>companies.
There are programs that by nature don't have any reason to be
linked with other people's extensions so the GPL doesn't cause
major harm. In an age of reusable objects where everything
knows how to dynamically load and use arbitrary extensions those
programs are becomming pretty rare and copyrights that require
prior knowledge of the separate encumberances of each library
are going to be a serious problem.
>There is no demonstrable correlation between license and free software
>success that I can see. All the major licenses have both failures and
>success stories - that's why they're major licenses.
Perhaps you just don't believe in cause and effect relationships.
Les Mikesell
les@mcs.com
------------------------------
Date: 22 May 1998 10:45:59 -0500
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: GNU attacks on the open software community
Message-Id: <6k46jn$kmo$1@Mars.mcs.net>
In article <m2btsqh6bn.fsf@mailhost.neuroinformatik.ruhr-uni-bochum.de>,
David Kastrup <dak@mailhost.neuroinformatik.ruhr-uni-bochum.de> wrote:
>les@MCS.COM (Leslie Mikesell) writes:
>
>> In article <yc74sykdoyu.fsf@shell1.tiac.net>,
>> Zach Kessin <zkessin@shell1.tiac.net> wrote:
>>
>> >The FSF in general and RMS in particular seem to be rather steemed now
>> >that the Free/Open software movement has started to ignore them. Linux
>> >exists because of Linus and company and Perl because of Larry Wall and
>> >Randal and Tom (and others of course). I think RMS is annoyed because
>> >free software is finaly being taken seriously, and its Linux, Apache
>> >and perl that people are looking at.
>>
>> And for obvious reasons. These do not have restrictions that prevent
>> commercial use or linking with code under different copyrights. People
>> can actually use them for something of value.
>
>You are, of course, aware that the Linux kernel as well as practically
>all system utilities written specifically for it are released under
>the GPL?
Not quite. It specifically allows modules to be loaded without
requiring them to be GPL'd. Without that, a company would be
living on faith that GPL'd device drivers would become available
for everything they might need in the future if they used Linux
in a critical function. Whether the option is ever actually
needed or not it makes the software a much safer choice.
Les Mikesell
les@mcs.com
------------------------------
Date: Fri, 22 May 1998 10:16:14 -0500
From: "c." <cynthee@earthlink.net>
Subject: Re: Help needed - Will pay.
Message-Id: <356596BE.80A@earthlink.net>
Tom Phoenix wrote:
>
> On Thu, 21 May 1998, c. wrote:
>
> > The same password will be going out to all of the members of this
> > organization, and it is not likely that the password would ever change.
>
> Thank you. You've made my day! But for even more fun, make the password
> be the word "password". :-)
:) - someday I know I'll look back on this and laugh...
Anyway, I just wanted to thank everybody for all of their helpful
suggestions and offers. Right after I posted, yesterday, 'the powers
that be' declared a meeting of everyone involved - from the copywriter
to the hosting service. Now, everybody thinks that the way to approach
it is to configure .htaccess and .htpasswd, leave the username prompt
there, and just have on the page: "your username is XXXX, please enter
the password for entry blah blah blah". I wish to god I knew for sure
that this is the route we're going to take, but at this point, nobody is
willing to make a solid decision, and we're running out of time.
Still, I appreciate everyone's help. You've all been more than helpful,
and I'll certainly keep the names and contacts I've received just in
case I ever find myself in this (horrifying) position again. ;)
Thanks again!
Cynthia Green
Moonstone Productions
--
"...children are innocent and love justice,
while most of us are wicked and naturally prefer mercy"
G.K. Chesterton
------------------------------
Date: Fri, 22 May 1998 15:33:56 GMT
From: rgold@sctcorp.com
Subject: Help needed with reg. expr. (newbie)
Message-Id: <6k45t4$o11$1@nnrp1.dejanews.com>
I am writing a test perl script to help distinguish PVCS base version numbers
(such as 1.12) from branches (such as 2.1.3.0). In the process, I have found
that my understanding of regular expression parsing does not seem to work very
well in perl.
Here is a sample:
--------- begin ---------
is_nonbranch( "21" );
is_nonbranch( "ab" );
is_nonbranch( "12.3" );
is_nonbranch( "32.3.1.0" );
sub is_nonbranch {
if (@_ =~ /(\d+)/) {
print @_, " matches at ", $1, "\n";
} else {
print @_, " doesn't match\n";
}
}
---------- end ----------
I intended the output to be:
21 matches at 21
ab doesn't match
12.3 matches at 12
32.3.1.0 matches at 32
but I get:
21 matches at 1
ab matches at 1
12.3 matches at 1
32.3.1.0 matches at 1
what am I doing wrong? And is there a better way to do this?
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Fri, 22 May 1998 11:18:23 -0400
From: Brian Mathis <brianm@kodak.com>
To: Nico Princely <nico@infonet2000.com>
Subject: Re: Help! Need script that will load new image every day in webpage......
Message-Id: <3565973F.11E6CA71@kodak.com>
Nico Princely wrote:
>
> I Need script that will load new image every day in webpage for a Pic of
> the day feature. I want to automate the process so I don't have to do it
> manually.......
>
> And it should be free, If I have to pay for it, I will just wright
> it....
>
> any help would be appreciated....
>
> Nico Princely E-mail: nico@infonet2000.com
Please write it yourself. Please do not post another message asking for a free
script here. This newsgroup is for Perl issues, not for providing free
scripting services.
Resources you might be interested in are:
www.cgi-resources.com
www.scriptsearch.com
www.htmlhelp.com
Brian Mathis
--
$_="
,.,,,.,,.,,.,,,,..,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,..,..,,.,,,,,,,,,
";s/\s//gs; tr/,./05/; @a=split(//); $_=<DATA>; tr/~`'"^/0-4/;map{$o.=
$a[$i]+$_;$i++} split(//); map{$o[++$#o]=substr($o,$j,3);$j+=3}@a;map{
print chr($_)}@o; __DATA__ # Brian Mathis, Just another perl hacker.
~'^``'``~```~"'~^'``~```````~^`~```^~"'``'`~```^`~"~"'`~^~^'~^^`~'`~```^~`~
------------------------------
Date: 22 May 1998 15:16:02 GMT
From: "Webmaster Jim" <jspath@mail.bcpl.lib.md.us>
Subject: How to use Mail::Header module?
Message-Id: <6k44ri$jge$1@news.abs.net>
Keywords: Mail::Header
I'm trying to split mail files into pieces to be forwarded or sent to
hypermail (by subject/month). I can't seem to get my hands around
using the Mail::Util and Mail::Internet modules from CPAN. Can someone
show me how to improve the following to be able to parse From date and
subject? (thanks!)
#!/usr/local/bin/perl -w
use Mail::Util qw( read_mbox );
use Mail::Internet;
$file = "/usr/spool/mail/jim";
@msgs = read_mbox( $file );
@msg = shift(@msgs);
while (defined ($msg[0])) {
$l = 0;
@hdr = new Mail::Header($msg[0]);
@h = Mail::Header::header($hdr[0]);
print $h[0][0];
while (defined ($msg[0][$l])) {
# print $msg[0][$l];
$l++;
}
print "=================================================\n";
@msg = shift(@msgs);
}
------------------------------
Date: Fri, 22 May 1998 15:15:49 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Pete Moss <mossp@hp.com>
Subject: Re: news/mail posting
Message-Id: <Pine.GSO.3.96.980522081521.29577T-100000@user2.teleport.com>
On Fri, 22 May 1998, Pete Moss wrote:
> How do you interact with the news server (innd)
I use a module. :-) See Net::NNTP from CPAN. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 22 May 98 15:02:30 GMT
From: paul@cassens.com (Paul Falbe)
Subject: Perl Cron/At weirdness
Message-Id: <9027.895849350@cassens.com>
Keywords: Perl, Cron
Hi,
I've been experiencing some weirdness with a perl script I wrote. When
the script is run from a "at" command I get different results then when
it the same script is run from the command line using the same datafile
and scripts to run it. In my shell script which runs the perl script I do
have SHELL=/usr/local/bin/perl; export SHELL. Does anyone have any ideas
on why this would occur. The perl is version 4. I am going to test the script
under version 5 tonite.
Thanks in Advance!
-Paul
--
Internet: | Paul J. Falbe |
falbe@cassens.com | Cassens Transport | Std disclaimers apply.
Voice: | 145 N. Kansas Str. | (But you knew that!)
618-656-3006 | Edwardsville, IL 62025 |
------------------------------
Date: Fri, 22 May 1998 15:49:51 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Paul Falbe <paul@cassens.com>
Subject: Re: Perl Cron/At weirdness
Message-Id: <Pine.GSO.3.96.980522084053.29577X-100000@user2.teleport.com>
On 22 May 1998, Paul Falbe wrote:
> I've been experiencing some weirdness with a perl script I wrote. When
> the script is run from a "at" command I get different results then when
> it the same script is run from the command line using the same datafile
> and scripts to run it.
It's normal for any program (not just Perl programs) to show different
behavior under 'at' and similar utilities; you typically have different or
altered environment variables, a different current working directory, and
other such changes.
> In my shell script which runs the perl script I do have
> SHELL=/usr/local/bin/perl; export SHELL.
Based upon the available evidence, I'd say that's not sufficient. :-)
> The perl is version 4.
It shouldn't be. But that's not likely to be the cause of _this_ problem.
It sounds to me as if you'll need to re-write the program so that it
doesn't assume so much about its environment. That may mean changing only
one or two lines, of course.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 22 May 1998 11:50:43 -0400
From: Phil Buckley <pbuckley@tiac.net>
Subject: Re-direct question
Message-Id: <35659ED3.D7087E8D@tiac.net>
Hello perl gurus,
I'm just getting started writing my own perl, and below is my second
attempt (hy hello world works flawlessly).
I figure I'm missing something simple, can someone give me hand, feel
free to bash me if it's very obvious.
I'm just trying to send any visitors from varian.com to one page, and
anyone else to another...
Thanks in advance, and please also e-mail any responses if it isn't too
much trouble
Phil Buckley
pbuckley@tiac.net
#!/usr/local/bin/perl
# Simple domain restriction script
# Created by Phil Buckley
# Created on: 5/21/98 Last Modified on: 5/21/98
# Version 1.0
################################################################
# Variables
$res_dom = "varian.com";
$varian_url = "http://www.tiac.net/users/dam4/varian.shtml";
$other_url = "http://www.tiac.net/users/dam4/private.shtml";
################################################################
$host = "$ENV{'REMOTE_HOST'}";
if ($host eq $res_dom) { # If they are coming from Varian
print "Location: $varian_url\n\n";
}
else { # For any other domain
print "Location: $other_url\n\n";
}
------------------------------
Date: Fri, 22 May 1998 15:44:18 GMT
From: Bill 'Sneex' Jones <webmaster@fccjmail.fccj.org>
Subject: Re: Sequestration
Message-Id: <35659B6A.3D388EAD@fccjmail.fccj.org>
Tom Christiansen wrote:
>
> To try to make some amends for the ridiculous amounts of non-Perl crud
> and destructive flaming that I was largely responsible for inciting over
> the last two days, <snip ...>
That you are solely responsible is questionable. We are all mature
enough not to contribute to the madness. Just because someone yells
FIRE doesn't mean someone else should go off the deep end.
>
> Enjoy.
I, for one, certainly will :-) Thanks!
>
> --tom
>
> http://www.oreilly.com/catalog/cookbook/
Receipes are always nice :-)
-Sneex-
"A firm supporter of the Kill A Spammer society..."
____________________________________________________________________________
Bill Jones | FCCJ Webmaster | Voice 1-904-632-3089 | Fax 1-904-632-3007
Florida Community College at Jacksonville | 501 W. State St. | Jax, FL 32202
mailto:webmaster@fccjmail.fccj.org | http://webmaster.fccj.org/Webmaster
------------------------------
Date: 22 May 1998 15:27:00 GMT
From: alansz@araw.mede.uic.edu (Alan Schwartz)
Subject: Re: Sequestration
Message-Id: <6k45g4$1p64$1@piglet.cc.uic.edu>
Tom Christiansen <tchrist@mox.perl.com> writes:
>To try to make some amends for the ridiculous amounts of non-Perl crud
>and destructive flaming that I was largely responsible for inciting over
>the last two days, I have just posted a dozen useful pieces of tips for
>doing cool things with Perl. Nearly all of them I've posted before in
>one place or another, but often only to private mailing lists, or embedded
>in larger messages where the code examples were likely to be missed.
These articles are superb. Thanks, Tom!
>Those examples will find their way into Perl Cookbook, which I must now
>buckle down and finish. I won't be posting again until then. PCB is
>the answer to the two missing chapters that were ``lost'' between the
>first and second editions of the Camel.
Yay!
- Alan
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Alan Schwartz <alansz@uic.edu>
Asst. Prof. of Clinical Decision Making | University of Illinois at Chicago
Adj. Asst. Prof. of Psychology | Department of Medical Education
"Life is what happens to you while you're busy making other plans"
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
------------------------------
Date: Fri, 22 May 98 17:26:31 gmt
From: ws97-868@wsrz1.wiso.uni-erlangen.de (Franz Kaufmann)
Subject: to read CSV into an array and back into CSV/perlTK books in print and the meaning of life
Message-Id: <6k45f8$cno$2@rznews.rrze.uni-erlangen.de>
Hello,
Sorry to bother on this crowded newsgroup,but I have some questions I do
not find answered in the usual docs:
1)How can I read a CSV file delimited with arbitrary delimiters mnot only
":" and "\n" into an array?How can I write an array as a CSV file?
2)Is there a book or some other form of comprehensive, "introduction to "
-like book for perlTK?
Thank you in advance.
------------------------------
Date: Fri, 22 May 1998 10:55:33 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Tom Christiansen attacks the free software community (was: Re: GNU attacks on the open software community)
Message-Id: <fl_aggie-2205981055330001@aggie.coaps.fsu.edu>
In article <6k3uur$ib5$1@hydra.cs.mu.oz.au>, trd@hydra.cs.mu.oz.au (Tyson
Richard DOWD) wrote:
+ pudge@pobox.com (Chris Nandor) writes:
+ >All this just simply to say that RMS and his cronies should simply use
+ >hyperlinks and footnotes to explain to Joe User (or worse, Pointy Haired
+ >Bosses) what they mean by "free" instead of potentially and very likely
+ >causing misunderstanding to be passed to said individuals.
+ This is a joke, yes?
No, if the intent is clear communication. If the intent is to obsfucate
the language, then don't offer footnotes, and become angry and indignant
when someone uses the verbage the different meaning.
+ I guess you want all those confusing foriegn people to translate their
+ web pages for you so you don't misunderstand them, too... if it's not
+ too much trouble.
That's what altavista's for. Followups.
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/CPAN-local/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: 22 May 1998 11:23:19 -0400
From: bwarsaw@cnri.reston.va.us (Barry A. Warsaw)
Subject: Re: Tom Christiansen attacks the free software community (was: Re: GNU attacks on the open software community)
Message-Id: <61ogwqpbx4.fsf@anthem.CNRI.Reston.Va.US>
>>>>> "TC" == Tom Christiansen <tchrist@mox.perl.com> writes:
TC> I'm sorry Barry, but when Joe Anybody hears the word "free",
TC> his thought is "gratis", not "libre". Go ask someone on the
TC> street what a "free lunch", a "free computer", a "free
TC> hamburger", or some "free software" are. Heck, I'll bet they
TC> even get the wrong idea about "free rooms". Go ahead. This
TC> is all very misleading.
I'm sure you didn't mean it as such, but what a very poignant insight
into the state of the world, where we are so concerned about the
economic that we barely even think about the liberty.
Regardless, your example is incomplete. Ask Joe Anybody what the
`free' in free speech, free press, or free exercise of religion means
and I'll bet you won't get answers like, "A dime a minute? I don't
think so!", "You can't charge me for that newspaper", "So you mean I
don't have to pay a buck a prayer?".
-Barry
------------------------------
Date: 22 May 1998 11:27:02 -0400
From: Paul Joslin <paul.joslin@sdrc.com>
Subject: What's the right idiom?
Message-Id: <y4dn2cza5q1.fsf@hppop.sdrc.com>
Suppose you're trying to read a directory and act on each entry:
opendir ( HANDLE, $path ) || die ( "$me: cannot opendir $path: $?" );
File: while ( $file = readdir ( HANDLE ) ) {
next File if ($file eq '.' || ($file eq '..'));
printf "$path/$file\n" if -d $path . '/' . $file;
# do something here....
}
closedir ( HANDLE );
}
This works great until you have a file or directory named "0". So you need
File: while (($file = readdir(HANDLE)) || (defined $file)) {
or an equivalent. What is the best 'equivalent'?
Yes, I know it's a contrived example. I know about File::Find. I'm just
asking either 1) what is the common practice, or 2) which FTM to answer #1.
Thanks for any help you can give. I will summarize any email responses.
--
Paul R. Joslin The man who sets out to carry a cat by its tail learns
paul.joslin@sdrc.com something that will always be useful and which never
+1 513 576 2012 will grow dim or doubtful. -- Mark Twain.
------------------------------
Date: Fri, 22 May 1998 15:11:55 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Why NOT crypt???
Message-Id: <pudge-2205981106180001@dynamic417.ply.adelphia.net>
In article <6k43r6$jja$1@plug.news.pipex.net>, "Jeremy Goldberg"
<jgoldberg@dial-but-dont-spam.pipex.com> wrote:
# >Yes, this might occasionally be useful, but if the script is going to be
# >tied that closely to UN*X security, it might be reasonable to test it on an
# >UN*X machine.
#
# Really? And if the remote machine doesn't keep error logs? Or if you have no
# access beyond FTP? Or you have to do it over a modem when the phone bill is
# starting to smoke?
If you are relying on Unix security and you don't test it on a Unix box,
then woe to you and the owner of your box.
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
MacPerl: Power and Ease (ISBN 1881957322), http://www.ptf.com/macperl/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
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 2689
**************************************