[28576] in Perl-Users-Digest
Perl-Users Digest, Issue: 9940 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 7 21:05:45 2006
Date: Tue, 7 Nov 2006 18:05:05 -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 Tue, 7 Nov 2006 Volume: 10 Number: 9940
Today's topics:
Re: $var=... <wahab@chemie.uni-halle.de>
Data Pattern generation <pradeep.bg@gmail.com>
Re: Data Pattern generation yankeeinexile@gmail.com
Re: Data Pattern generation usenet@DavidFilmer.com
Re: Data Pattern generation <pradeep.bg@gmail.com>
Re: Data Pattern generation yankeeinexile@gmail.com
Re: Data Pattern generation yankeeinexile@gmail.com
Re: Data Pattern generation <wahab@chemie.uni-halle.de>
Re: Data Pattern generation <wahab@chemie.uni-halle.de>
Re: Data Pattern generation <tadmc@augustmail.com>
IPv4 address validation in Net::IP <jigar.jigar@gmail.com>
Re: IPv4 address validation in Net::IP <noreply@gunnar.cc>
overloading and data driven <bpatton@ti.com>
Re: Putting a line in a specific place in a file <bryan@worldspice.net>
Re: Regular expressions <mritty@gmail.com>
Re: Regular expressions <newsmanDELETE@REMOVEdahl-stamnes.net>
Re: Regular expressions <mritty@gmail.com>
Re: simple regular expression <abigail@abigail.be>
Re: simple regular expression <asandstrom@accesswave.ca>
Re: SUID script?? <noreply@gunnar.cc>
Re: What is more detailled than $^O ? <ynl@nsparks.net>
Re: What is more detailled than $^O ? <cwilbur@mithril.chromatico.net>
Re: What is more detailled than $^O ? <ynl@nsparks.net>
Re: What is more detailled than $^O ? <abigail@abigail.be>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 08 Nov 2006 00:48:51 +0100
From: Mirco Wahab <wahab@chemie.uni-halle.de>
Subject: Re: $var=...
Message-Id: <eir6ap$2kt$1@mlucom4.urz.uni-halle.de>
Thus spoke Mirco Wahab (on 2006-11-07 13:41):
> You could also find a solution (besides the substr thing)
> by stating
>
> ...
> chomp( my $var=<STDIN> );
> print map{ $_->[0] eq $_->[-1] ? 'same':'differ'} [split '', $var];
> ...
This is clunky, better written (with split) as:
...
my @chars = split '', <STDIN>; pop @chars; # pseudo cho<m>p
print 'OK' if @chars > 2 and pop @chars eq shift @chars;
...
M.
------------------------------
Date: 7 Nov 2006 13:52:38 -0800
From: "Deepu" <pradeep.bg@gmail.com>
Subject: Data Pattern generation
Message-Id: <1162936358.038629.141800@m73g2000cwd.googlegroups.com>
Hi All,
I am trying to generate data in the pattern shown below, can somebody
please help me giving some ideas on how it can be generated.
Data Pattern required:
0x000000 0x0000 0x0001 0x0002 0x0003 0x0004 0x0005 0x0006 0x0007
0x0008 ------- 0x000f
0x000010 0x0010 0x0011 0x0012 0x0013 0x0014 0x0015
------------------------------------------ 0x001f
0x000020
|
|
0x000100 0x0100 0x0101 0x0102
-----------------------------------------------------------------------------
0x010f
Thanks for your time.
------------------------------
Date: 07 Nov 2006 16:02:08 -0600
From: yankeeinexile@gmail.com
Subject: Re: Data Pattern generation
Message-Id: <87psbyykyn.fsf@gmail.com>
"Deepu" <pradeep.bg@gmail.com> writes:
> Hi All,
>
> I am trying to generate data in the pattern shown below, can somebody
> please help me giving some ideas on how it can be generated.
>
> Data Pattern required:
> [snip, it appears later in this post]
> Thanks for your time.
>
That's an easy one....
#!/usr/bin/perl
use strict;
use warnings;
print <<'THAT_WAS_EASY'
0x000000 0x0000 0x0001 0x0002 0x0003 0x0004 0x0005 0x0006 0x0007
0x0008 ------- 0x000f
0x000010 0x0010 0x0011 0x0012 0x0013 0x0014 0x0015
------------------------------------------ 0x001f
0x000020
|
|
0x000100 0x0100 0x0101 0x0102
-----------------------------------------------------------------------------
0x010f
THAT_WAS_EASY
;
You want to try again with a clearer description of what you're trying
to do, and what you've written so far to solve it?
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
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: 7 Nov 2006 14:15:06 -0800
From: usenet@DavidFilmer.com
Subject: Re: Data Pattern generation
Message-Id: <1162937706.237496.16920@b28g2000cwb.googlegroups.com>
Deepu wrote:
> I am trying to generate data in the pattern shown below, can somebody
> please help me giving some ideas on how it can be generated.
>...
> 0x000100 0x0100 0x0101 0x0102
I assume you are asking how to print a group of decimal numbers in hex
format...
use printf. For example, to print the sample line quoted above:
printf "%0#8x %0#6x %0#6x %0#6x\n", qw{256 256 257 258};
The format string '%0#8x' says:
% - all format strings begin with %
0 - uses leading zeros (instead of space)
# - prefix non-zero number with '0x' (for hex numbers)
8 - number field is minimum 8 characters long
x - unsigned hex integer (lowercase)
--
The best way to get a good answer is to ask a good question.
David Filmer (http://DavidFilmer.com)
------------------------------
Date: 7 Nov 2006 14:26:02 -0800
From: "Deepu" <pradeep.bg@gmail.com>
Subject: Re: Data Pattern generation
Message-Id: <1162938362.789836.59840@b28g2000cwb.googlegroups.com>
use...@DavidFilmer.com wrote:
> The best way to get a good answer is to ask a good question.
Sorry for my improper description. I am trying to auto generate this
pattern
0x000000 0x0000 0x0001 0x0002 0x0003 0x0004 0x0005 0x0006 0x0007
0x000008 0x0008 0x0009 0x000a 0x000b 0x000c 0x000d 0x000e 0x000f
0x000010 0x0010 0x0011 0x0012 0x0013 0x0014 0x0015 0x0016 0x0017
0x000018 0x0018 0x0019 0x001a 0x001b 0x001c 0x001d 0x001e 0x001f
this sequential pattern continues till the ADDR becomes 0x000100
The first column basically represent ADDR(address) and the column after
that represent the data.
This is basically equivalent to:
0x000000 has 0x0000
0x000001 has 0x0001
and so on.
Thanks for your time.
------------------------------
Date: 07 Nov 2006 16:33:15 -0600
From: yankeeinexile@gmail.com
Subject: Re: Data Pattern generation
Message-Id: <87k626yjis.fsf@gmail.com>
"Deepu" <pradeep.bg@gmail.com> writes:
> 0x000000 0x0000 0x0001 0x0002 0x0003 0x0004 0x0005 0x0006 0x0007
> 0x000008 0x0008 0x0009 0x000a 0x000b 0x000c 0x000d 0x000e 0x000f
> 0x000010 0x0010 0x0011 0x0012 0x0013 0x0014 0x0015 0x0016 0x0017
> 0x000018 0x0018 0x0019 0x001a 0x001b 0x001c 0x001d 0x001e 0x001f
>
#!/usr/bin/perl
use strict;
use warnings;
my $address = 0;
while ( $address < 0x100 ) {
printf "%06x ", $address;
foreach my $element ( $address .. $address + 7 ) {
printf "%04x ", $element;
}
print "\n";
$address += 8;
}
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
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: 07 Nov 2006 16:36:47 -0600
From: yankeeinexile@gmail.com
Subject: Re: Data Pattern generation
Message-Id: <87fycuyjcw.fsf@gmail.com>
yankeeinexile@gmail.com writes:
DAMMIT ... I hate it when I do that ...
Let's try that again
#!/usr/bin/perl
use strict;
use warnings;
my $address = 0;
while ( $address < 0x100 ) {
printf "0x%06x\t", $address;
foreach my $element ( $address .. $address + 7 ) {
printf "0x%04x ", $element;
}
print "\n";
$address += 8;
}
That's better ...
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
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: Tue, 07 Nov 2006 23:42:19 +0100
From: Mirco Wahab <wahab@chemie.uni-halle.de>
Subject: Re: Data Pattern generation
Message-Id: <eir2e1$1ek$1@mlucom4.urz.uni-halle.de>
Thus spoke Deepu (on 2006-11-07 23:26):
> Sorry for my improper description. I am trying to auto generate this
> pattern
>
> 0x000000 0x0000 0x0001 0x0002 0x0003 0x0004 0x0005 0x0006 0x0007
> 0x000008 0x0008 0x0009 0x000a 0x000b 0x000c 0x000d 0x000e 0x000f
> 0x000010 0x0010 0x0011 0x0012 0x0013 0x0014 0x0015 0x0016 0x0017
> 0x000018 0x0018 0x0019 0x001a 0x001b 0x001c 0x001d 0x001e 0x001f
If you need variable column count (4,8,16 ...), you could use
...
my $width = 8; # 8/16 columns
for( 0 .. 0x10 * 0x10 / $width ) {
my $row = $_ * $width;
printf "%0#8x%5s", $row, ' ';
printf " %0#6x" x $width, ($row ..$row + $width - 1);
print "\n";
}
...
Maybe it can be written (by map) much shorter.
Regards
Mirco
------------------------------
Date: Tue, 07 Nov 2006 23:47:29 +0100
From: Mirco Wahab <wahab@chemie.uni-halle.de>
Subject: Re: Data Pattern generation
Message-Id: <eir2nm$1iq$1@mlucom4.urz.uni-halle.de>
Thus spoke usenet@DavidFilmer.com (on 2006-11-07 23:15):
> printf "%0#8x %0#6x %0#6x %0#6x\n", qw{256 256 257 258};
Thanks for bringing this nice idiomatic
expression back to my mind (lost already ;-)
Regards
Mirco
------------------------------
Date: Tue, 7 Nov 2006 19:02:30 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Data Pattern generation
Message-Id: <slrnel2b56.ee5.tadmc@tadmc30.august.net>
Deepu <pradeep.bg@gmail.com> wrote:
>
> 0x000000 0x0000 0x0001 0x0002 0x0003 0x0004 0x0005 0x0006 0x0007
> 0x000008 0x0008 0x0009 0x000a 0x000b 0x000c 0x000d 0x000e 0x000f
> 0x000010 0x0010 0x0011 0x0012 0x0013 0x0014 0x0015 0x0016 0x0017
> 0x000018 0x0018 0x0019 0x001a 0x001b 0x001c 0x001d 0x001e 0x001f
> The first column basically represent ADDR(address) and the column after
> that represent the data.
http://www.cpan.org/scripts/nutshell/ch6/xdump
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 7 Nov 2006 15:33:16 -0800
From: "Jigs" <jigar.jigar@gmail.com>
Subject: IPv4 address validation in Net::IP
Message-Id: <1162942396.203344.276360@h54g2000cwb.googlegroups.com>
Hi All,
I was using the Net::IP module from CPAN and the function to validate
an IP address allows single numbers to be a valid address. Here is the
snippet from the function ip_is_ipv4:
# Single Numbers are considered to be IPv4
if ($ip =~ m/^(\d+)$/ and $1 < 256) { return 1 }
# Count quads
my $n = ($ip =~ tr/\./\./);
# IPv4 must have from 1 to 4 quads
unless ($n >= 0 and $n < 4) {
$ERROR = "Invalid IP address $ip";
$ERRNO = 105;
return 0;
}
Can someone please explain why single numbers are valis IP addresses?
Thank in advance ...
Jigs
------------------------------
Date: Wed, 08 Nov 2006 00:42:55 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: IPv4 address validation in Net::IP
Message-Id: <4rck3tFqrna7U1@mid.individual.net>
Jigs wrote:
> Can someone please explain why single numbers are valis IP addresses?
Have you tried Google? It's not a Perl question.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 7 Nov 2006 16:47:16 -0800
From: "bpatton" <bpatton@ti.com>
Subject: overloading and data driven
Message-Id: <1162946836.850752.277840@f16g2000cwb.googlegroups.com>
I'm looking for some method that will allot the data to choose the
function, not have a function decide if it is right for the data. I
know this sounds very confusing, but I'll try and explain.
I'm trying to write a language to represent some layout rules for the
verification of physical layout data.
my main goal is to create regression data from the rules
The language is expected to have @ 100 words.
An example and very simple
MET1 spacing to CONT is >= 50
2 layers (upper case) MET1 and CONT
one function "spacing to"
one operator >=
one value 50
and one filler word 'is'
There are many more very complex statements.
Standard programming
if ($var1 eq 'spacing to'
&& ...
&& not (...
This can get very hairy.
I've looked at CLIPS where the facts are represented
Here is an example of a clips fact
(rule 2b1 MET1 spacing to cont >= 50)
The rule
(defrule xxx
(rule ?rule ?l1 spacing to $l2 ?oper $val)
=>
do some neat stuff
)
In this example the data has selected the function, not a function
looking at the data and deciding if it can use it through a series of
if/then/else.
It's also my concept of how lex/yacc might work. The data finds the
correct function.
lex/yacc would provide me with a strong syntax checker and provide the
link with data driven function selection, bit I would like to stay away
from compiled programs. Sooner or later I have to put a gui and a
connection into Oracle for this bad puppy and I don't have a clue how
all this will fit together.
------------------------------
Date: 7 Nov 2006 12:28:14 -0800
From: "samasama" <bryan@worldspice.net>
Subject: Re: Putting a line in a specific place in a file
Message-Id: <1162931294.808530.319820@m7g2000cwm.googlegroups.com>
samasama wrote:
> > Line Number: 7 Contents: 16 Flip-flop: 5E0
> > ^
> > ^
> > ^
> > Line Number: 8 Contents: 17 Flip-flop:
> > Line Number: 9 Contents: 18 Flip-flop:
> >
> > Notice the 'E' above? That is what the pattern is matching.
> >
> >
Ahhh, the E made sense after reading this:
The range operator, which is really two different operators depending
on the context. In an array context, returns an array of values
counting (by ones) from the left value to the right value. This is
useful for writing "for (1..10)" loops and for doing slice operations
on arrays.
In a scalar context, .. returns a boolean value. The operator is
bistable, like a flip-flop, and emulates the line-range (comma)
operator of sed, awk, and various editors. Each .. operator maintains
its own boolean state. It is false as long as its left operand is
false. Once the left operand is true, the range operator stays true
until the right operand is true, AFTER which the range operator becomes
false again. (It doesn't become false till the next time the range
operator is evaluated. It can test the right operand and become false
on the same evaluation it became true (as in awk), but it still returns
true once. If you don't want it to test the right operand till the next
evaluation (as in sed), use three dots (...) instead of two.) The right
operand is not evaluated while the operator is in the "false" state,
and the left operand is not evaluated while the operator is in the
"true" state. The precedence is a little lower than || and &&. The
value returned is either the null string for false, or a sequence
number (beginning with 1) for true. The sequence number is reset for
each range encountered. The final sequence number in a range has the
string 'E0' appended to it, which doesn't affect its numeric value, but
gives you something to search for if you want to exclude the endpoint.
You can exclude the beginning point by waiting for the sequence number
to be greater than 1. If either operand of scalar .. is static, that
operand is implicitly compared to the $. variable, the current line
number.
Any comments about the rest of the code is very much welcome and
appreciated.
--
samasama
------------------------------
Date: 7 Nov 2006 11:30:23 -0800
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Regular expressions
Message-Id: <1162927822.996924.319810@h54g2000cwb.googlegroups.com>
J=F8rn Dahl-Stamnes wrote:
> I'm trying to extract parts of a string with the following line:
>
> $relay =3D~ s/^\[(.+)\]$|^(.+) \[.+$/$1/;
>
> But $relay contain data only if it match the first part of the expression.
> I have tested both parts of the expression, and they both work.
>
> Can the |-operator be used in the line above?
The | can be used there, yes. The $1, however, cannot. $1 will ALWAYS
refer to the first parentheses in the entire match, regardless of
whether or not the sub-pattern that contains it was actually matched.
You want the little known $+ variable instead. It's documented in
perldoc perlvar
$+ The text matched by the last bracket of the last
successful search pattern. This is useful if you
don't know which one of a set of alternative
patterns matched. For example:
/Version: (.*)|Revision: (.*)/ && ($rev =3D $+);
Paul Lalli
------------------------------
Date: Tue, 07 Nov 2006 20:49:25 +0100
From: =?ISO-8859-1?Q?J=F8rn?= Dahl-Stamnes <newsmanDELETE@REMOVEdahl-stamnes.net>
Subject: Re: Regular expressions
Message-Id: <4550e345@news.broadpark.no>
Paul Lalli wrote:
> Jørn Dahl-Stamnes wrote:
>> I'm trying to extract parts of a string with the following line:
>>
>> $relay =~ s/^\[(.+)\]$|^(.+) \[.+$/$1/;
>>
>> But $relay contain data only if it match the first part of the
>> expression. I have tested both parts of the expression, and they both
>> work.
>>
>> Can the |-operator be used in the line above?
>
> The | can be used there, yes. The $1, however, cannot. $1 will ALWAYS
> refer to the first parentheses in the entire match, regardless of
> whether or not the sub-pattern that contains it was actually matched.
> You want the little known $+ variable instead. It's documented in
>
> perldoc perlvar
Thanks, it worked. I could not find this in the O'Reillys "Programming Perl"
book I got. But then, I have not read every word in it.
--
Jørn Dahl-Stamnes
http://www.dahl-stamnes.net/dahls/
------------------------------
Date: 7 Nov 2006 12:30:34 -0800
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Regular expressions
Message-Id: <1162931433.947583.9680@m7g2000cwm.googlegroups.com>
J=F8rn Dahl-Stamnes wrote:
> Paul Lalli wrote:
>
> > You want the little known $+ variable instead. It's documented in
> >
> > perldoc perlvar
>
> Thanks, it worked. I could not find this in the O'Reillys "Programming Pe=
rl"
> book I got. But then, I have not read every word in it.
Page 184 in the Regexp section on Caputring and Clustering, and page
668 in the list of all special variables. In the 3rd edition, at
least. . .=20
Paul Lalli
------------------------------
Date: 07 Nov 2006 23:31:44 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: simple regular expression
Message-Id: <slrnel25q1.rtp.abigail@alexandra.abigail.be>
John W. Krahn (someone@example.com) wrote on MMMMDCCCXVI September
MCMXCIII in <URL:news:t_Z3h.57943$P7.10465@edtnps90>:
`` Olaf wrote:
`` > Which is the simplest way to know if a $var start and finish with the
`` > same character?
``
`` $var =~ /\A(.).*\1\z/s;
That would not match if $var equals "a". Which, IMO, starts and finishes
with the same character.
If you were going to do this with a regexp, I'd use:
$var =~ /^(?=(.)).*\1\z/s;
But I'd rather do:
length ($var) && substr ($var, 0, 1) eq substr ($var, -1, 1);
Abigail
--
$_ = "\x3C\x3C\x45\x4F\x54\n" and s/<<EOT/<<EOT/ee and print;
"Just another Perl Hacker"
EOT
------------------------------
Date: Wed, 08 Nov 2006 00:18:25 GMT
From: "Arved Sandstrom" <asandstrom@accesswave.ca>
Subject: Re: simple regular expression
Message-Id: <ln94h.96570$E67.36025@clgrps13>
"Abigail" <abigail@abigail.be> wrote in message
news:slrnel25q1.rtp.abigail@alexandra.abigail.be...
> John W. Krahn (someone@example.com) wrote on MMMMDCCCXVI September
> MCMXCIII in <URL:news:t_Z3h.57943$P7.10465@edtnps90>:
> `` Olaf wrote:
> `` > Which is the simplest way to know if a $var start and finish with the
> `` > same character?
> ``
> `` $var =~ /\A(.).*\1\z/s;
>
>
> That would not match if $var equals "a". Which, IMO, starts and finishes
> with the same character.
>
> If you were going to do this with a regexp, I'd use:
>
> $var =~ /^(?=(.)).*\1\z/s;
>
>
> But I'd rather do:
>
> length ($var) && substr ($var, 0, 1) eq substr ($var, -1, 1);
I also would rather do the latter. It is faster (by about a factor of two on
my machine). But more importantly, it's simply more clear than the RE. Not
by much - it's a simple RE - but clearer nevertheless.
There's a time and a place for regular expressions. But the string functions
exist for a reason and sometimes they're better.
AHS
------------------------------
Date: Tue, 07 Nov 2006 22:44:48 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: SUID script??
Message-Id: <4rcd6eFq17itU1@mid.individual.net>
richardrothwell@gmail.com wrote:
> I have a C program that runs as an SUID script. But I need to extend
> this script to query a database first and I've since found out that
> this cannot be done.
>
> So I was wondering if Perl can be used to create an SUID script or will
> Linux not run it??
You can do it by putting a C wrapper around your Perl script.
http://perldoc.perl.org/perlsec.html#Security-Bugs
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Tue, 7 Nov 2006 20:04:01 +0100
From: Yohan N Leder <ynl@nsparks.net>
Subject: Re: What is more detailled than $^O ?
Message-Id: <MPG.1fbaf70dc53e51a29898fd@news.tiscali.fr>
In article <87r6wfqf0h.fsf@mithril.chromatico.net>,
cwilbur@mithril.chromatico.net says...
> In this case, you want to know if it's Debian or Fedora so you know
> where to look for the log files and what format to expect the log
> files in. There's no built-in pre-existing way to find out what
> distribution you're on; so look for the log files in both places and
> parse them according to the format you'd expect them to be if they
> were there. Problem solved.
>
You don't understand the concept of a team here. Imagine (just a
scenario from a lot of possibles) this :
Now : I have to guess what the logs and trees are : so, what you say is
correct : I could just check and try these logs and tress.
In two weeks : Philip (a friend of mine in the team) has to auto-
generate a report from a Perl CGI script which just write the exact
linux ditribution in the subtitle of every report : unfortunately he
can't re-use what I've done because I'm a well known selfish.
Maybe more, I can't add in my own task myself because I need he finish
his own.
One week later : Samantha (yeah), collect the Philip's reports of the
last week and try to establish some statistics based on specific linux
distributions indicated on every report. Also, she wants (and when
Samantha wants, you can imagine...) to compare these statistics about a
week against the current states (close to "realtime") of the servers
park, reusing, again, the same piece of Perl code I've written (and
which has been modified, maybe, by Philip) tree weeks ago.
More, because she is a consultant, we've kept some money which will have
more chance to go in Philip and mine's pockets (oh, no!, big boss is
watching us ;-))
Well, so I don't target Y ignoring X without valid reason but because of
long experience in the concept of team !
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
------------------------------
Date: 07 Nov 2006 14:41:05 -0500
From: Charlton Wilbur <cwilbur@mithril.chromatico.net>
Subject: Re: What is more detailled than $^O ?
Message-Id: <87mz73qc32.fsf@mithril.chromatico.net>
Yohan N Leder <ynl@nsparks.net> writes:
> More, because she is a consultant, we've kept some money which will have
> more chance to go in Philip and mine's pockets (oh, no!, big boss is
> watching us ;-))
>
> Well, so I don't target Y ignoring X without valid reason but because of
> long experience in the concept of team !
In other words, you're writing code now that you think may be useful
later. Why not just solve your own problem as simply and clearly as
possible, and let Philip and Samantha worry about hypothetical
problems when they're no longer hypothetical?
http://en.wikipedia.org/wiki/You_Ain't_Gonna_Need_It
You've still got an XY problem, you're just hell-bent on doing it that
way because you think it may be useful someday.
Charlton
------------------------------
Date: Tue, 7 Nov 2006 21:19:50 +0100
From: Yohan N Leder <ynl@nsparks.net>
Subject: Re: What is more detailled than $^O ?
Message-Id: <MPG.1fbb08d37124789898fe@news.tiscali.fr>
In article <87mz73qc32.fsf@mithril.chromatico.net>,
cwilbur@mithril.chromatico.net says...
> In other words, you're writing code now that you think may be useful
> later. Why not just solve your own problem as simply and clearly as
> possible, and let Philip and Samantha worry about hypothetical
> problems when they're no longer hypothetical?
>
> http://en.wikipedia.org/wiki/You_Ain't_Gonna_Need_It
>
> You've still got an XY problem, you're just hell-bent on doing it that
> way because you think it may be useful someday.
>
Neither "may be useful later" nor "may be useful someday" or
"hypothetical", but because I know it will be useful in some weeks...
And because my current charge of work is under the Philip's one these
days... Again, a matter of team in a long term collaboration (this
method work successfully for us since ten years now ; in others fields
than Perl).
Remember that the universality doesn't exist : whatever be the wiki
philosophy you could link to, there will be always the reverse somewhere
and both may work for some and not the others...
------------------------------
Date: 07 Nov 2006 23:25:54 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: What is more detailled than $^O ?
Message-Id: <slrnel25f3.rtp.abigail@alexandra.abigail.be>
Yohan N Leder (ynl@nsparks.net) wrote on MMMMDCCCXVI September MCMXCIII
in <URL:news:MPG.1fbaedff61007c7a9898fc@news.tiscali.fr>:
-:
-: So, my question remains the same : how to check what's the current linux
-: distribution from a cgi Perl script ? Say, to begin and to point a
-: concrete case : how to distinguish if a linux is a Debian/Ubuntu or a
-: RedHat/Fedora ?
Why don't you ask this in the Python group, and report back how they
do it. Then we'll translate the Python code to Perl code....
This isn't really a Perl question, is it?
Abigail
--
#!/opt/perl/bin/perl -w
$\ = $"; $SIG {TERM} = sub {print and exit};
kill 15 => fork for qw /Just another Perl Hacker/;
------------------------------
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 9940
***************************************