[28591] in Perl-Users-Digest
Perl-Users Digest, Issue: 9955 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Nov 11 11:06:07 2006
Date: Sat, 11 Nov 2006 08:05:15 -0800 (PST)
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, 11 Nov 2006 Volume: 10 Number: 9955
Today's topics:
Re: "Did not find leading dereferencer" - new findings <hjp-usenet2@hjp.at>
count lines,words,punctuations and characters in perl s <theryne_rc@yahoo.co.uk>
Re: count lines,words,punctuations and characters in pe yankeeinexile@gmail.com
Re: Creating string "user@host" elegantly <rvtol+news@isolution.nl>
Creating Windows Shortcuts Programmatically <don_stanley@paradise.net.nz>
Re: Creating Windows Shortcuts Programmatically <mark.clementsREMOVETHIS@wanadoo.fr>
Re: Data plotting questions Nov. 2, 2006 <edgrsprj@ix.netcom.com>
Re: Data plotting questions Nov. 2, 2006 <edgrsprj@ix.netcom.com>
How to do math inside of a regex? <Ross.Landis@gmail.com>
Re: How to do math inside of a regex? <no@email.com>
Re: Keep getting error with email validation script <hjp-usenet2@hjp.at>
Re: Masking/Hiding a password in Perl Source <craigk@execpc.com>
Re: Masking/Hiding a password in Perl Source <craigk@execpc.com>
Re: perl threading; ->join; best method? <jdhedden@1979.usna.com>
Re: Perl with setuid enabled <hjp-usenet2@hjp.at>
Re: simple regular expression <abigail@abigail.be>
Re: simple regular expression <hjp-usenet2@hjp.at>
Re: What is more detailled than $^O ? <bik.mido@tiscalinet.it>
Re: What is more detailled than $^O ? <bik.mido@tiscalinet.it>
Re: What is more detailled than $^O ? <bik.mido@tiscalinet.it>
Re: What is more detailled than $^O ? <hjp-usenet2@hjp.at>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 11 Nov 2006 13:34:43 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: "Did not find leading dereferencer" - new findings to an old puzzle
Message-Id: <slrnelbgr3.b61.hjp-usenet2@yoyo.hjp.at>
[Article reformatted. Please keep a consistent line length of about 70
characters. Alternating between long and extremely short lines may be
nice in a poem but is hard to read in prose]
On 2006-11-10 10:23, Ronny <ro.naldfi.scher@gmail.com> wrote:
> Ben Morrow schrieb:
>> Quoth "Ronny" <ro.naldfi.scher@gmail.com>:
>> > Ben Morrow schrieb:
[weird error messages from the Text::Balanced module]
>> > > Are you by any chance using any modules that set up source filters?
>> > > Switch.pm, perhaps? These often use Text::Balanced to do their work, and
>> > > it isn't quite as good at parsing Perl as it might be.
[...]
> The use Switch was in the code only for historic reason, and I have
> removed it. I don't know of course if *this* was sufficient to make
> the error go away: After all, the removal of the statement made the
> code a little bit smaller, so the problem might simply have
> disappeared for *this* reason (removing a comment line instead of the
> use Switch would have had the same effect).
Possible, but unlikely. Unless you use another module which uses
Text::Balanced, you aren't calling Text::Balanced any more and hence
can't get any error messages from it any more.
>> > > As usual, if you reduce your script to the *minimal* example which
>> > > reproduces the problem (yes, in this case this might be a lot of work),
>> > > and post it here, I'm sure someone can tell you what's going on.
>> >
>> > The problem with errors which occur only in "sufficiently big" source
>> > files is that the minimal example is still fairly big. In my case, I
>> > have reduced it to the extent that deleting one single character (for
>> > example, the "#" in front of an empty comment line) already makes this
>> > error go away. Still, the source file is around 350 lines big.
>>
>> If the error really only occurs with large source files, then the
>> obvious workaround is to split your module into two.
>
> This certainly is, although I it surprised me that 350 lines - quite a
> few of them being comments - is already too large to be handled in a
> single module.
I don't think it has anything to do with the size. The problem was
probably that the Switch module needs to parse the source code and that
uses a different grammar than perl (which is unavoidable, as the purpose
of Switch is to change the grammar). So changing a character which
shouldn't make a difference in Perl does make a difference in
Perl+Switch.
hp
--
_ | Peter J. Holzer | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR | > ist?
| | | hjp@hjp.at | Was sonst wäre der Sinn des Erfindens?
__/ | http://www.hjp.at/ | -- P. Einstein u. V. Gringmuth in desd
------------------------------
Date: 11 Nov 2006 06:50:44 -0800
From: "angel" <theryne_rc@yahoo.co.uk>
Subject: count lines,words,punctuations and characters in perl script
Message-Id: <1163256644.761377.327290@h54g2000cwb.googlegroups.com>
hello im a perl beginner. is there anybody who can help me by giving me
simple perl script? i need to know on how to count lines, words,
punctuations and characters of a pharagraph. pls i really need help
thanks a lot. i would really appreciate your help thanks!
------------------------------
Date: 11 Nov 2006 09:04:41 -0600
From: yankeeinexile@gmail.com
Subject: Re: count lines,words,punctuations and characters in perl script
Message-Id: <87slgqvxbq.fsf@gmail.com>
"angel" <theryne_rc@yahoo.co.uk> writes:
> hello im a perl beginner.
Hello. Welcome.
> is there anybody who can help me by giving me
> simple perl script?
If you want to hire a programmer jobs.perl.org is down the hall. If
you want help to write your own script, go read the posting
guidelines, and then come back.
> i need to know on how to count lines, words,
> punctuations and characters of a pharagraph.
This smells like a homework assignment. Do you really think your
lecturer doesn't read this group?
> pls i really need help
> thanks a lot. i would really appreciate your help thanks!
What work have you done thus far, and how has it failed to meet your
needs?
There was only one e. e. cummings -- you're not him. Use mixed case and
try to spell. Writing (good) programs requires clarity and precision
in any language. Practice being clear and precise in human languages,
too.
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Lawrence Statton - lawrenabae@abaluon.abaom s/aba/c/g
Computer software consists of only two components: ones and
zeros, in roughly equal proportions. All that is required is to
sort them into the correct order.
------------------------------
Date: Sat, 11 Nov 2006 10:27:58 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Creating string "user@host" elegantly
Message-Id: <ej48li.1dg.1@news.isolution.nl>
usenet@DavidFilmer.com schreef:
> I have two variable, $host and $user (and $user could be undef).
>
> I wish to construct a string such as would be used in an FTP command,
> such as:
>
> userid@hostname.example.com
>
> However, if $user is undefined, the string should simply say
>
> hostname.example.com
>
> I could do this:
> my $foo = ($user) ? "$user\@$host" : $host;
> but that seems a bit redundant (I had to type "$user" twice and
> "$host" twice).
>
> I could avoid typing "$host" twice with something like:
> my $foo = "$user\@" if $user;
> $foo .= $host;
> but I'm not sure I like that any better...
>
> Does anybody have a more elegant suggestion?
my $foo = (defined($user) ? "$user\@" : '') . $host ;
do {local ($", @_) = ("@"); defined($_) and push @_, $_ for $user,
$host; "@_" }
;)
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Sat, 11 Nov 2006 23:57:13 +1300
From: Don <don_stanley@paradise.net.nz>
Subject: Creating Windows Shortcuts Programmatically
Message-Id: <4555ac87$1@clear.net.nz>
Hi all
can anyone point me to some documentation that indicates how I can create a file shortcut please. I need to be able to
programmatically create shortcuts under windows xp. I have the original file name, directory name that the shortcut is to reside
in, and the shortcut name, but I haven't been able to determine how to actually create the shortcut in Perl.
Thanks
Don
------------------------------
Date: Sat, 11 Nov 2006 12:24:28 +0100
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: Creating Windows Shortcuts Programmatically
Message-Id: <4555b2e2$0$5086$ba4acef3@news.orange.fr>
Don wrote:
>
> can anyone point me to some documentation that indicates how I can
> create a file shortcut please. I need to be able to programmatically
> create shortcuts under windows xp. I have the original file name,
> directory name that the shortcut is to reside in, and the shortcut name,
> but I haven't been able to determine how to actually create the shortcut
> in Perl.
>
Try Win32::Shortcut
search.cpan.org is your friend.
There are also Win32::Hardlink and Win32::Symlink, but they create NTFS
links rather than shortcuts.
Mark
------------------------------
Date: Sat, 11 Nov 2006 14:39:17 GMT
From: "edgrsprj" <edgrsprj@ix.netcom.com>
Subject: Re: Data plotting questions Nov. 2, 2006
Message-Id: <pgl5h.5727$ig4.4666@newsread2.news.pas.earthlink.net>
"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message
news:ap29l2lk114tm7u7o18dep3mpack8ica9t@4ax.com...
Thanks for all of the information.
------------------------------
Date: Sat, 11 Nov 2006 14:39:16 GMT
From: "edgrsprj" <edgrsprj@ix.netcom.com>
Subject: Re: Data plotting questions Nov. 2, 2006
Message-Id: <ogl5h.5726$ig4.1527@newsread2.news.pas.earthlink.net>
<jmg3000@gmail.com> wrote in message
news:1163108246.382321.227490@b28g2000cwb.googlegroups.com...
Thanks for the comments.
------------------------------
Date: 11 Nov 2006 06:23:16 -0800
From: "Rossman123" <Ross.Landis@gmail.com>
Subject: How to do math inside of a regex?
Message-Id: <1163254995.961831.166070@m7g2000cwm.googlegroups.com>
If I have "Tom owns 2 cats", how do I search and replace with a regex,
so that I get "Tom owns 3 cats" ? I want to be able to find a digit,
add 1 to the digit, and replace with the result. Thanks!
------------------------------
Date: Sat, 11 Nov 2006 14:31:48 +0000
From: Brian Wakem <no@email.com>
Subject: Re: How to do math inside of a regex?
Message-Id: <4rm561FrnrvoU1@mid.individual.net>
Rossman123 wrote:
> If I have "Tom owns 2 cats", how do I search and replace with a regex,
> so that I get "Tom owns 3 cats" ? I want to be able to find a digit,
> add 1 to the digit, and replace with the result. Thanks!
s#(\d)#$1+1#e
--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png
------------------------------
Date: Sat, 11 Nov 2006 13:56:09 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Keep getting error with email validation script
Message-Id: <slrnelbi39.b61.hjp-usenet2@yoyo.hjp.at>
On 2006-11-06 14:29, grocery_stocker <cdalten@gmail.com> wrote:
> Tad McClellan wrote:
>> grocery_stocker <cdalten@gmail.com> wrote:
>> > we might as well just continue to screw ourself by using the unsafe
>> > system() function.
>>
>> What is unsafe about the system() function?
>>
>> Using the shell is certainly unsafe, but you can use the system()
>> function in such a way that it won't use a shell.
>>
>> Is that what you meant?
>
> I should probably explore this before I shoot off my mouth, but under
> *nix, you can screw yourself with system() by having the user do
> something really inane with the input. Like
>
> char arr[200];
> system(arr);
>
> The user then can go like
> ls -al; rm
That's not Unix, that's C. The C language defines a standard library
function called "system". The Perl language also defines a standard
function called "system". Both are system dependent [0] and they closely
related, but they are not the same. At least on Unix systems, Perl
"system" can be often be used in a safe manner with user-supplied input,
while C "system" cannot.
> This is because system() under *nix uses the fork/exec model.
No, this is because C system invokes the shell.
> So is the behavior different using Perl?
Yes. Perl system doesn't necessarily invoke the shell. Please read
perldoc -f system.
hp
[0] I.e., C "system" doesn't do the same thing on Unix and Windows, and
neither does Perl "system".
--
_ | Peter J. Holzer | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR | > ist?
| | | hjp@hjp.at | Was sonst wäre der Sinn des Erfindens?
__/ | http://www.hjp.at/ | -- P. Einstein u. V. Gringmuth in desd
------------------------------
Date: 11 Nov 2006 04:07:54 -0800
From: "Craig K" <craigk@execpc.com>
Subject: Re: Masking/Hiding a password in Perl Source
Message-Id: <1163246874.885838.184880@m73g2000cwd.googlegroups.com>
J. Gleixner wrote:
> Craig K wrote:
> > [...]
>
> > If I need to schedule the script, I can supply the username
> > and passwords on the command line while scheduling.
>
> FYI: Depending on the OS, the password can then be found in the process
> table, so it might be available to anyone or any process running a 'ps',
> for example.
>
This is true, but the OP asked for hiding the passwords within the
script which was the request that I offered a solution to. Also, if
you are running telnet, as the OP mentioned, I can put a sniffer on
the segment and have the password within 10 seconds.
> > This script is for TACACS logins [...]
> Whatever that is.
If you dont know what it is I would guess then you most likely are not
using it. Substitute whatever authentication means you are using.
------------------------------
Date: 11 Nov 2006 04:18:46 -0800
From: "Craig K" <craigk@execpc.com>
Subject: Re: Masking/Hiding a password in Perl Source
Message-Id: <1163247526.756179.210900@m73g2000cwd.googlegroups.com>
Craig K wrote:
>
> This is true, but the OP asked for hiding the passwords within the
> script which was the request that I offered a solution to. Also, if
> you are running telnet, as the OP mentioned, I can put a sniffer on
> the segment and have the password within 10 seconds.
>
In looking further... I think I mixed my newsgroup messages. The OP
only mentions connects to devices, not telnets. Anyway, let me correct
my statement to be that any unencrypted connection (i.e. telnet, ftp,
etc) could have the password gathered in short order with a sniffer.
------------------------------
Date: 11 Nov 2006 04:09:48 -0800
From: "jdhedden" <jdhedden@1979.usna.com>
Subject: Re: perl threading; ->join; best method?
Message-Id: <1163246988.121045.78140@m7g2000cwm.googlegroups.com>
Jerry D. Hedden wrote:
> while (threads->list()) {
> $_->join() foreach threads->list(threads::joinable);
> sleep(1);
> }
Ilya Zakharevich wrote:
> Badly designed API; with a better API it should have been something like
> 1 while threads->join_a_thread();
The problem I see with this is that it provides no mechanism for
identifying which thread was joined.
------------------------------
Date: Sat, 11 Nov 2006 14:16:35 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Perl with setuid enabled
Message-Id: <slrnelbj9j.b61.hjp-usenet2@yoyo.hjp.at>
On 2006-11-06 17:37, prattm@gmail.com <prattm@gmail.com> wrote:
> We have a bunch of Perl scripts on our system, all of which use the
> following header:
>
> #!/bin/ksh -- # -*- perl -*-
> eval 'exec ${PERL} $0 ${1+"$@"}'
> if 0;
>
> The idea is we maintain a common variable $PERL that points to our
> latest version. This works fine and dandy, but one particular script
> is running with setuid enabled (4110 permission) and has problems with
> this header.
That looks positively dangerous. If I can invoke that script at all, I
can get it to do anything by providing a suitable PERL variable.
> It prints out the message:
>
> Unrecognized character \x7F at /bin/ksh line 1.
That may be a combination of the 4110 permission and a bug in ksh (you
don't write which OS you are using). Scripts normally need to be
readably (not just executable) by the effective user id of the
interpreter process (because the interpreter has to read the script
before it can interpret it). Since your script has 04110 permission, the
ksh cannot open it, and the 0x7F character may just be the lower 7 bits
of the -1 return code that it got while trying to read from a
non-existing file descriptor. Change the permissions to 04510 and it
should work if your OS supports setuid scripts at all (some Unixes (e.g.
Linux) don't for good reasons).
hp
--
_ | Peter J. Holzer | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR | > ist?
| | | hjp@hjp.at | Was sonst wäre der Sinn des Erfindens?
__/ | http://www.hjp.at/ | -- P. Einstein u. V. Gringmuth in desd
------------------------------
Date: 11 Nov 2006 10:57:07 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: simple regular expression
Message-Id: <slrnelbb35.rtp.abigail@alexandra.abigail.be>
Uri Guttman (uri@stemsystems.com) wrote on MMMMDCCCXX September MCMXCIII
in <URL:news:x7ejsay27a.fsf@mail.sysarch.com>:
&& >>>>> "TZ" == Ted Zlatanov <tzz@lifelogs.com> writes:
&&
&& TZ> On 8 Nov 2006, asandstrom@accesswave.ca wrote:
&& >> There's a time and a place for regular expressions. But the string
&& >> functions exist for a reason and sometimes they're better.
&&
&& TZ> Are there any cases (within the scope of intended usage--fixed
&& TZ> offsets and search strings) that index, length, and substr are
&& TZ> slower than regular expressions? I don't know of any, and I'm
&& TZ> curious.
&&
&& in general any single call to the simpler string funcs should be faster
&& than an equivilent regex call. i agree it would be hard to show a
&& concrete example that contradicts that and i bet if one does exist it
&& will be a very degenerate example. but combining several simple string
&& calls in an expression could very well be slower than the equivilent
&& regex. the rule of thumb (and perl is very thumbish :) is that the more
&& perl code you run the slower vs the more c (perl guts) you run the
&& faster. but that rule can quickly be broken by the classic s/^\s+|\s+$/g
&& being slower than that split into two s/// calls.
It used to be that index() on long string with many almost matches
was dramatically slower than a regex, especially if there was no match.
Something like finding 'foobar' in 'fooba' x 1000, the regexp engine
quickly determining that 'r' wasn't present in the string, while index()
dutefully tried matching a 1000 times.
But I think this was fixed in 5.004 or so.
Abigail
--
($;,$_,$|,$\)=("\@\x7Fy~*kde~box*Zoxf*Bkiaox"," "x25,1,"\r");
{vec($_=>1+$"=>$^F<<$^F)=ord($/^substr$;=>$"=int rand 24=>1);
print&&select$,,$,,$,,$|/($|+tr/ //c);redo if y/ //>$^F**2};
------------------------------
Date: Sat, 11 Nov 2006 13:16:13 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: simple regular expression
Message-Id: <slrnelbfod.b61.hjp-usenet2@yoyo.hjp.at>
On 2006-11-10 18:05, Ted Zlatanov <tzz@lifelogs.com> wrote:
> On 8 Nov 2006, asandstrom@accesswave.ca wrote:
>> There's a time and a place for regular expressions. But the string
>> functions exist for a reason and sometimes they're better.
>
> Are there any cases (within the scope of intended usage--fixed offsets
> and search strings) that index, length, and substr are slower than
> regular expressions? I don't know of any, and I'm curious.
Note that he wrote "better", not "faster". "Better" in code is usually a
mixture of several aspects and readability and maintainability are often
considered more important than performance.
hp
--
_ | Peter J. Holzer | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR | > ist?
| | | hjp@hjp.at | Was sonst wäre der Sinn des Erfindens?
__/ | http://www.hjp.at/ | -- P. Einstein u. V. Gringmuth in desd
------------------------------
Date: Sat, 11 Nov 2006 11:45:06 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: What is more detailled than $^O ?
Message-Id: <u8abl2h781irs9h9rj6gcon0t50il88j3a@4ax.com>
On Mon, 6 Nov 2006 20:13:45 +0100, Yohan N Leder <ynl@nsparks.net>
wrote:
>I would like to distinguish the accurate linux distribution when $^O is
>'linux'. How to do ? Do I have to figure-out searching for trace of
>distribution name in some environment variables like SERVER_SOFTWARE or
>SERVER_SIGNATURE which may contains a reference to the operating system
>under which the web server has been built for ? Something better in mind
>?
While others already duly explained you why there are limits to what
can actually be done in this sense, the same question has been
discussed @ PM:
http://perlmonks.org/?node_id=578430
Hope you'll find some interesting ideas there.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sat, 11 Nov 2006 11:49:44 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: What is more detailled than $^O ?
Message-Id: <blabl25em7f9opplntah35blg7pp6jco49@4ax.com>
On 07 Nov 2006 13:37:50 -0500, Charlton Wilbur
<cwilbur@mithril.chromatico.net> wrote:
>There's a concept known as the XY problem. The querent asks "How do I
>do Y?" In reality, he's interested in knowing how to X, and he's
>convinced that doing Y is the best way to do X. Such a querent is
>almost always wrong.
Also, some expanding on the subject:
http://perlmonks.org/?node=XY+problem
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sat, 11 Nov 2006 12:06:07 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: What is more detailled than $^O ?
Message-Id: <qebbl2ptqtb7652qjk71u98nqpjmmdc386@4ax.com>
On Wed, 8 Nov 2006 11:08:41 +0100, Yohan N Leder <ynl@nsparks.net>
wrote:
>> This isn't really a Perl question, is it?
[snip]
>If you've read the thread, you've seen it's solved now
If you refer to <news:MPG.1fbaf70dc53e51a29898fd@news.tiscali.fr>,
then you wrote:
: Well, this said, I've found a begin of answer some minutes ago :
^^^^^
^^^^^
: http://search.cpan.org/~kerberus/Linux-Distribution-
: 0.14/lib/Linux/Distribution.pm
But then, as others pointed out, this doesn't make it really a Perl
question, although I have to admit that the existence of a specialized
Perl module somehow corrects this.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sat, 11 Nov 2006 13:04:40 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: What is more detailled than $^O ?
Message-Id: <slrnelbf2o.b61.hjp-usenet2@yoyo.hjp.at>
On 2006-11-06 23:24, Eric Schwartz <emschwar@pobox.com> wrote:
> Abigail <abigail@abigail.be> writes:
>> Yohan N Leder (ynl@nsparks.net) wrote on MMMMDCCCXV September MCMXCIII in
>> <URL:news:MPG.1fb9c8bcec77a3639898f6@news.tiscali.fr>:
>> __ In article <slrnekv9i1.rtp.abigail@alexandra.abigail.be>,
>> __ abigail@abigail.be says...
>> __ > What is the "accurate linux distribution" anyway?
>> __
>> __ At least something saying Red Hat, Fedora, Debian, Ubuntu, Suse, etc.
>> __ And better if it say also the major version number.
>>
>>
>> Then what? Just because it's Red Hat doesn't mean it has package X,
>> and just it's Debian doesn't mean it doesn't have package X.
>
> If one is writing an installer, it might be useful to know if one is
> to use yum, apt-get, or yast to install any dependencies,
So test for the availability of these tools. A stock redhat system
hasn't any of these tools, but the sysadmin might have installed yum or
apt (most of my redhat systems have apt). it might even be possible to
deinstall yast on a suse system.
> or which package to prompt the user to install.
Yes, but it generally needs quite special knowledge which changes
frequently. A feature provided by package X in version n might be
provided by package Y in version n+1. So as a hint for the user that's
helpful ("I can't find libfoo, since you are on a Redhat system, it is
probably included in the foo2-devel package", or something like that),
but the same information could just be contained in the README without
any real loss of functionality.
> If one is writing a test harness, it's often useful to be able to
> report to the person reading the test results what distro was
> installed on the system under test.
Right. The distribution (among other details about the environment) is
something you frequently want to include in reports of some kind: Bug
reports (to make it easier to reproduce the problem), configuration
reports (How many servers running desupported OS versions are we still
running?), etc.
To adapt the behaviour of the program to its environment, there are
usually more direct and reliable indicators than the distribution.
hp
--
_ | Peter J. Holzer | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR | > ist?
| | | hjp@hjp.at | Was sonst wäre der Sinn des Erfindens?
__/ | http://www.hjp.at/ | -- P. Einstein u. V. Gringmuth in desd
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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.
#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 V10 Issue 9955
***************************************