[28572] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 9936 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 6 21:05:50 2006

Date: Mon, 6 Nov 2006 18:05:06 -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           Mon, 6 Nov 2006     Volume: 10 Number: 9936

Today's topics:
        force IV to NV <mm@mohr.de>
        Huge Memory Load for reading into memory <rahul.thathoo@gmail.com>
    Re: I need to be amused on the perldocs that ship with  <tzz@lifelogs.com>
    Re: Keep getting error with email validation script <tadmc@augustmail.com>
    Re: Perl and OpenGL <mm@mohr.de>
    Re: Perl with setuid enabled <mark.clementsREMOVETHIS@wanadoo.fr>
    Re: Perl with setuid enabled <dmercer@mn.rr.com>
    Re: Putting a line in a specific place in a file anno4000@radom.zrz.tu-berlin.de
    Re: Putting a line in a specific place in a file <bryan@worldspice.net>
    Re: Putting a line in a specific place in a file <someone@example.com>
    Re: Putting a line in a specific place in a file <bryan@worldspice.net>
    Re: warnings or -w ? <abigail@abigail.be>
    Re: warnings or -w ? <ynl@nsparks.net>
    Re: warnings or -w ? <tadmc@augustmail.com>
        What is more detailled than $^O ? <ynl@nsparks.net>
    Re: What is more detailled than $^O ? anno4000@radom.zrz.tu-berlin.de
    Re: What is more detailled than $^O ? <abigail@abigail.be>
    Re: What is more detailled than $^O ? <ynl@nsparks.net>
    Re: What is more detailled than $^O ? <ynl@nsparks.net>
    Re: What is more detailled than $^O ? <tzz@lifelogs.com>
    Re: What is more detailled than $^O ? <abigail@abigail.be>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 07 Nov 2006 00:45:28 +0100
From: Martin Mohr <mm@mohr.de>
Subject: force IV to NV
Message-Id: <eioh4h$ruk$02$1@news.t-online.com>

Hello,

to work around a problem I'm having with SDL::OpenGL (see earlier 
thread), I'd like to know a way to force an integer value (IV) to become 
a double value (NV). It's not as easy as I first thought:

perl -MDevel::Peek -e "$a = 1;$a+=0.0; Dump $a"

This shows that $a remains IV. How can I achive this cast?

Ciao
Martin



------------------------------

Date: 6 Nov 2006 16:10:44 -0800
From: "rahulthathoo" <rahul.thathoo@gmail.com>
Subject: Huge Memory Load for reading into memory
Message-Id: <1162858244.454077.171680@i42g2000cwa.googlegroups.com>

Hi
I am trying to load a 600MB file into memory through the below code.
But when I do a top on the system, I see that over the duration of the
program run, the memory usage is 7.5 Gigs!! the top command says: VIRT:
7449m and Res: 7.289m - of course I have 8GB of RAM at my disposal. But
the point is why is this happening for a file which is only 600MB in
size. Here is the code:

open UM, MAP_FILE or die "Can't open Usermap.\n";
my %mapHash;
while(<UM>){
        @tokens = split(/:/, $_);
        $zHashKey = $tokens[0];
        @zMovArr = split(/\s/, $tokens[1]);
        $mapHash{$zHashKey} = [@zMovArr];
}
close UM;


Thanks for any help.

Rahul



------------------------------

Date: Mon, 06 Nov 2006 19:29:17 +0000
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: I need to be amused on the perldocs that ship with Perl.
Message-Id: <g69d5802x2q.fsf@lifelogs.com>

On  4 Nov 2006, cdalten@gmail.com wrote:

> Anyhow, the perldocs that came with my Perl distro has a lot of bs
> written on closures. However, I haven't seen any kind of actual use of
> closures in the standard mods. All I've seen are some mods generated
> using h2xs, some mods that abuse AUTOLOAD, but mostly I've seen a lot
> that make heavy use of the Symbol mod. I really forgot where this was
> going. Anyone care to enlighten me on this?

Closures are nice for hiding passwords.

{
 my $password = 'secret';
 sub get_password { return $password; }
}

You can't (easily) get at $password now except through get_password()

Ted


------------------------------

Date: Mon, 6 Nov 2006 17:27:49 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Keep getting error with email validation script
Message-Id: <slrnekvh7l.7m8.tadmc@tadmc30.august.net>

grocery_stocker <cdalten@gmail.com> wrote:
>
> Tad McClellan wrote:
>> grocery_stocker <cdalten@gmail.com> wrote:
>>
>> > I
>> > also figures since the OP is & to invoke the subroutine,
>>
>>
>> What effect does using & on the function call have for the
>> function that is being discussed?
>>
>
> I forgot. I think it was something to do with the fact the OP was
> already screwing himself using &..


How was using & screwing him up?

His code will work perfectly fine with an ampersand on the function call.


>> > 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, 


That would be uncharacteristic of what I have observed of
your posts to this point.


> 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
>
> This is because system() under *nix uses the fork/exec model. 


No it isn't.

It is because there is a shell involved. (semicolon is a shell metacharacter.)

If you use the form of system() that does not invoke a shell,
then the above bad guy trick will not "work".


> So is the
> behavior different using Perl?


Perl's system() also uses the fork/exec model.

But that model is not the reason for the unsafety that you claim.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Tue, 07 Nov 2006 00:29:53 +0100
From: Martin Mohr <mm@mohr.de>
Subject: Re: Perl and OpenGL
Message-Id: <eiog7f$bfm$00$1@news.t-online.com>

jmg3000@gmail.com wrote:
> Please keep digging and let us know what you find out! :)

After having created three different versions of my OpenGL program now, 
I can conclude that I am not completely happy with any of the three 
tested modules:

OpenGL
* Rather complete coverage of GL and GLUT API
   (as in: has everything I need)
* Doesn't build on Linux here, ppm for Windows available
* Seems unmaintained

OpenGL::Simple and OpenGL::Simple::GLUT
* Builds fine on Linux here, ppm for Windows available
* Lacks some parts of GLUT which I could need
* Uses 'perlified' polymorphic functions instead of the C-ish
   Vertex3f,Vertex3d etc.
* Last version about a year old

SDL::OpenGL
* Binary packages for Linux and Windows available;
   doesn't build easily
* Doesn't use or support GLUT, but has other ways of creating
   windows etc.
* Uses polymorphic functions as OpenGL::Simple above
* Has quite some bugs, for example in glMultMatrix
* Last version about a year old

Since GLUT seems outdated, I believe that SDL is the most modern 
approach. Also there is already a (partial) SDL interface for Parrot, 
which could also give some indications about endurance.

During my tests, I also found that it is quite easy to combine these 
modules. (I also found that it is quite easy to do so accidentally...) 
This is the way I will probably go now, picking the cherries from each 
of the interfaces.

If somebody would bother to comment, I would still be very happy. Is 
OpenGL generally so much out of fashion?

Ciao
Martin



------------------------------

Date: Mon, 06 Nov 2006 20:43:12 +0100
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: Perl with setuid enabled
Message-Id: <454f9050$0$5084$ba4acef3@news.orange.fr>

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.  It prints out the message:
> 
> Unrecognized character \x7F at /bin/ksh line 1.
> 
> The character 7F is the "delete" character, but I copied and pasted the
> ksh header from another script that works, so I don't believe there is
> any hidden character(s).  We've also tried something like:
> 
> #!${PERL}
> 
> but that didn't work. The only way to get it to work is to hardcode the
> path to perl executable, but this requires more maintenance when
> upgrading our version of perl and we'd like to avoid it if possible.
> Anyone have any ideas?
> 

You can have multiple versions of perl installed on each system. You 
could have symlinks pointing at the latest version, and then each script 
  just starts

#!/usr/local/bin/perl

or somesuch.

Mark


------------------------------

Date: Tue, 07 Nov 2006 00:51:31 GMT
From: "Dan Mercer" <dmercer@mn.rr.com>
Subject: Re: Perl with setuid enabled
Message-Id: <nMQ3h.3$rB.2@tornado.rdc-kc.rr.com>


<prattm@gmail.com> wrote in message news:1162834627.465053.100680@k70g2000cwa.googlegroups.com...
: 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.  It prints out the message:
:
: Unrecognized character \x7F at /bin/ksh line 1.
:
: The character 7F is the "delete" character, but I copied and pasted the
: ksh header from another script that works, so I don't believe there is
: any hidden character(s).  We've also tried something like:
:
: #!${PERL}
:
: but that didn't work. The only way to get it to work is to hardcode the
: path to perl executable, but this requires more maintenance when
: upgrading our version of perl and we'd like to avoid it if possible.
: Anyone have any ideas?
:
: Thanks, Mike
:

use env

#!/usr/bin/env perl
use warnings;
use strict;
 ...

Dan Mercer




------------------------------

Date: 6 Nov 2006 19:28:44 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Putting a line in a specific place in a file
Message-Id: <4r9gncFqci4jU1@mid.dfncis.de>

samasama <bryan@worldspice.net> wrote in comp.lang.perl.misc:

[positioning a file handle]

> This finds the lines correctly but if I try to print after $gpg_line,
> the line below gets fubar.
> I know I could use Tie::File, but i really want to understand what's
> going on and how to insert my line after $gpg_line correctly.

Well, you can't.

A file is really a sequence of bytes, no more, no less.  You can
append to the end of a file, but writing anywhere else implies
overwriting what's already there.

That's what happened to the "line below".  It was partially overwritten
by the new data you wrote.

Editors and other tools that work on text files make it look like
a file was a sequence of lines that new lines could be inserted in.
That's software that makes it look like that.  There is no insert
operation on the file level.

[side note]

Pity we can no longer refer to the FAQ for this question.

Perlfaq5 "How do I change one line in a file/delete a line..." used to
explain this problem in detail.  These days it just refers to Tie::File,
another tool that makes files look like a sequence (a Perl array) of lines.

Anno


------------------------------

Date: 6 Nov 2006 13:52:34 -0800
From: "samasama" <bryan@worldspice.net>
Subject: Re: Putting a line in a specific place in a file
Message-Id: <1162849954.376414.3620@i42g2000cwa.googlegroups.com>


anno4000@radom.zrz.tu-berlin.de wrote:
> samasama <bryan@worldspice.net> wrote in comp.lang.perl.misc:
>
> [positioning a file handle]
>
> > This finds the lines correctly but if I try to print after $gpg_line,
> > the line below gets fubar.
> > I know I could use Tie::File, but i really want to understand what's
> > going on and how to insert my line after $gpg_line correctly.
>
> Well, you can't.
>
> A file is really a sequence of bytes, no more, no less.  You can
> append to the end of a file, but writing anywhere else implies
> overwriting what's already there.
>

Duh... Yeah I feel dumb : P  I don't know why I thought I could just
print the line.

>
> Pity we can no longer refer to the FAQ for this question.
>
> Perlfaq5 "How do I change one line in a file/delete a line..." used to
> explain this problem in detail.  These days it just refers to Tie::File,
> another tool that makes files look like a sequence (a Perl array) of lines.

Yeah, Tie::File is great, but I needed to learn the steps in writing my
own parser, for future projects.

While, I've figured out what I needed to do and I'll paste the last of
the code below... I still don't understand what if ( ( $. == $base_line
 .. /gpgkey\=/i ) =~ /E/ ) { translates too.
 It looks like $. == $base_line go down using .. until we hit gpgkey,
and I have no idea what the /E/  means. I'd really like to understand
that.

Code:

use strict;
use Fcntl;
use File::Copy;

my $file = "CentOS-Base.repo";
sysopen( REPO_FILE, $file, O_RDWR )
  || die "Can't open repo file !: $!\n";

my ( $base_line, $gpg_line, $found_exclude, $excluded, $exclude_line,
$package_excluded );
my $package = $ARGV[0];

print "$package\n";
while (<REPO_FILE>) {
    chomp $_;
    if ( $_ =~ /\[base\]/i ) {
        $base_line = $.;
        print "Found $_ on line $base_line\n";

    }

    if ( ( $. == $base_line .. /gpgkey\=/i ) =~ /E/ ) {
        print "Found $_ on line $.\n";
        $gpg_line = $.;
    }
    if ( ( $. == $gpg_line .. /exclude\=.*/i ) =~ /E/ ) {
        $exclude_line  = $.;
        $found_exclude = 1;
        print "Found exclude $_ on line $.\n";
        $package_excluded = 1 if ($_ =~ m/.*$package.*/);

        $excluded = $_;

    }
}

# reopen (maybe seek() would be better? )
sysopen( REPO_FILE, $file, O_RDWR )
  || die "Can't open repo file !: $!\n";

sysopen( TEMP_REPO_FILE, "/tmp/repo.XXX", O_CREAT | O_WRONLY )
  || die "Can't create temporary shadow file: $!\n";

while (<REPO_FILE>) {
    if ($found_exclude && !$package_excluded) {
        if ( $. == $exclude_line ) {
            chomp $_;
            $_ =~ s/$_/$_ $package\n/;
        }
    }
    else {
        if ( $. == $gpg_line ) {
            print TEMP_REPO_FILE "exclude\=$package\n" unless
$found_exclude;
        }
    }
 print TEMP_REPO_FILE $_;
}

close TEMP_REPO_FILE;
close REPO_FILE;
copy( "/tmp/repo.XXX", $file );
unlink("/tmp/repo.XXX");

Thanks

--
samasama



------------------------------

Date: Mon, 06 Nov 2006 23:49:05 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: Putting a line in a specific place in a file
Message-Id: <RRP3h.58763$H7.9884@edtnps82>

samasama wrote:
> anno4000@radom.zrz.tu-berlin.de wrote:
>>samasama <bryan@worldspice.net> wrote in comp.lang.perl.misc:
>>
>>[positioning a file handle]
>>
>>>This finds the lines correctly but if I try to print after $gpg_line,
>>>the line below gets fubar.
>>>I know I could use Tie::File, but i really want to understand what's
>>>going on and how to insert my line after $gpg_line correctly.
>>Well, you can't.
>>
>>A file is really a sequence of bytes, no more, no less.  You can
>>append to the end of a file, but writing anywhere else implies
>>overwriting what's already there.
>>
> 
> Duh... Yeah I feel dumb : P  I don't know why I thought I could just
> print the line.
> 
>>Pity we can no longer refer to the FAQ for this question.
>>
>>Perlfaq5 "How do I change one line in a file/delete a line..." used to
>>explain this problem in detail.  These days it just refers to Tie::File,
>>another tool that makes files look like a sequence (a Perl array) of lines.
> 
> Yeah, Tie::File is great, but I needed to learn the steps in writing my
> own parser, for future projects.
> 
> While, I've figured out what I needed to do and I'll paste the last of
> the code below... I still don't understand what if ( ( $. == $base_line
> .. /gpgkey\=/i ) =~ /E/ ) { translates too.
>  It looks like $. == $base_line go down using .. until we hit gpgkey,
> and I have no idea what the /E/  means. I'd really like to understand
> that.

Perhaps a demonstration may help:

$ seq 10 18 | perl -lne' my $x = 3 .. /16/; print "Line Number: $.   Contents:
$_   Flip-flop: $x" '
Line Number: 1   Contents: 10   Flip-flop:
Line Number: 2   Contents: 11   Flip-flop:
Line Number: 3   Contents: 12   Flip-flop: 1
Line Number: 4   Contents: 13   Flip-flop: 2
Line Number: 5   Contents: 14   Flip-flop: 3
Line Number: 6   Contents: 15   Flip-flop: 4
Line Number: 7   Contents: 16   Flip-flop: 5E0
Line Number: 8   Contents: 17   Flip-flop:
Line Number: 9   Contents: 18   Flip-flop:



John
-- 
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order.       -- Larry Wall


------------------------------

Date: 6 Nov 2006 16:25:53 -0800
From: "samasama" <bryan@worldspice.net>
Subject: Re: Putting a line in a specific place in a file
Message-Id: <1162859153.381757.193650@f16g2000cwb.googlegroups.com>


>
> Perhaps a demonstration may help:
>
> $ seq 10 18 | perl -lne' my $x = 3 .. /16/; print "Line Number: $.   Contents:
> $_   Flip-flop: $x" '
> Line Number: 1   Contents: 10   Flip-flop:
> Line Number: 2   Contents: 11   Flip-flop:
> Line Number: 3   Contents: 12   Flip-flop: 1
> Line Number: 4   Contents: 13   Flip-flop: 2
> Line Number: 5   Contents: 14   Flip-flop: 3
> Line Number: 6   Contents: 15   Flip-flop: 4
> Line Number: 7   Contents: 16   Flip-flop: 5E0
> Line Number: 8   Contents: 17   Flip-flop:
> Line Number: 9   Contents: 18   Flip-flop:
> 
> 

 heh, I guess I'm tired? : )  I'm still confused...



------------------------------

Date: 06 Nov 2006 21:09:53 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: warnings or -w ?
Message-Id: <slrnekv942.rtp.abigail@alexandra.abigail.be>

Yohan N Leder (ynl@nsparks.net) wrote on MMMMDCCCXIV September MCMXCIII
in <URL:news:MPG.1fb7f666306ba39f9898ec@news.tiscali.fr>:
,,  Hello,
,,  
,,  What the preferable way to activate warnings in CGI Perl scripts ? And, 
,,  especially, why ?
,,  
,,  1) The "-w" in the shebang line as "#!/usr/bin/perl -w"
,,  2) Or a "use warnings;"
,,  
,,  This question because, I'm used to use "use warnings", but was surprised 
,,  to see, some days ago, that some servers (for example, in a Fedora Core 
,,  5 with httpd and the Perl packages installed by default) don't have this 
,,  module and fail on it with errors log saying something like "no such a 
,,  file".


Strange. The warnings module has been part of the Perl core since 
Perl 5.6, which is from the previous century (March 2000).

I don't recall Red Hat even having a product called "Fedora Core" in 2000.


I use '-w' one the command line, and 'use warnings' anywhere else.
If only for the ability to use 'no warnings "..."' (which always follows
my 'use warnings;').



Abigail
-- 
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
         % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
         BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'


------------------------------

Date: Mon, 6 Nov 2006 22:42:07 +0100
From: Yohan N Leder <ynl@nsparks.net>
Subject: Re: warnings or -w ?
Message-Id: <MPG.1fb9ca964b277dce9898f8@news.tiscali.fr>

In article <slrnekv942.rtp.abigail@alexandra.abigail.be>, 
abigail@abigail.be says...
> I use '-w' one the command line, and 'use warnings' anywhere else.
> 

OK, I think I'll continue to use "use warnings;" in cgi too.


------------------------------

Date: Mon, 6 Nov 2006 17:20:37 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: warnings or -w ?
Message-Id: <slrnekvgq5.7m8.tadmc@tadmc30.august.net>

A. Sinan Unur <1usa@llenroc.ude.invalid> wrote:
> Yohan N Leder <ynl@nsparks.net> wrote in news:MPG.1fb935ceb56f7d89898f0
> @news.tiscali.fr:
>
>> In article <slrnektcuk.i2i.tadmc@tadmc30.august.net>, 
>> tadmc@augustmail.com says...
>>>  [...]  *plonk*
>>> 
>> 
>> Your post is totally unuseful, Tad. So, sorry to *double-plonk* at my 
>> turn... [second degree for those who has not access to it]
>> 
>
> I see your plonk and raise you triple.


Perhaps the OP can _now_ see the usefulness of my reply.

The points made are (errr, would have been ) useful for avoiding earning 
a killfile entry.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Mon, 6 Nov 2006 20:13:45 +0100
From: Yohan N Leder <ynl@nsparks.net>
Subject: What is more detailled than $^O ?
Message-Id: <MPG.1fb9a7d3d2815cbf9898f5@news.tiscali.fr>

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 
?


------------------------------

Date: 6 Nov 2006 19:30:59 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: What is more detailled than $^O ?
Message-Id: <4r9grjFqci4jU2@mid.dfncis.de>

Yohan N Leder  <ynl@nsparks.net> wrote in comp.lang.perl.misc:
> 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 
> ?

Look for the standard module Config (perldoc Config).

Anno


------------------------------

Date: 06 Nov 2006 21:17:20 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: What is more detailled than $^O ?
Message-Id: <slrnekv9i1.rtp.abigail@alexandra.abigail.be>

Yohan N Leder (ynl@nsparks.net) wrote on MMMMDCCCXV September MCMXCIII in
<URL:news:MPG.1fb9a7d3d2815cbf9898f5@news.tiscali.fr>:
##  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 
##  ?


What is the "accurate linux distribution" anyway? If I install 'FooBar
Linux', manually select the package to install and picking only the ones
with an odd number of vowels in the name, and then install the latest
beta of Emacs, what's the "accurate linux distribution" suppose to be?

I also have a floppy image with a linux distribution on it - especially
created for a previous job. It doesn't have a name. Were I to compile
Perl for it, what should it return for "the accurate linux distribution"?



Abigail
-- 
:$:=~s:$":Just$&another$&:;$:=~s:
:Perl$"Hacker$&:;chop$:;print$:#:


------------------------------

Date: Mon, 6 Nov 2006 22:34:04 +0100
From: Yohan N Leder <ynl@nsparks.net>
Subject: Re: What is more detailled than $^O ?
Message-Id: <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.


------------------------------

Date: Mon, 6 Nov 2006 22:37:45 +0100
From: Yohan N Leder <ynl@nsparks.net>
Subject: Re: What is more detailled than $^O ?
Message-Id: <MPG.1fb9c99415328f899898f7@news.tiscali.fr>

In article <4r9grjFqci4jU2@mid.dfncis.de>, anno4000@radom.zrz.tu-
berlin.de says...
> Look for the standard module Config (perldoc Config).
> 

Noted, I'll take a look. Thanks !


------------------------------

Date: Mon, 06 Nov 2006 21:53:21 +0000
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: What is more detailled than $^O ?
Message-Id: <g69k6281bu6.fsf@lifelogs.com>

On  6 Nov 2006, ynl@nsparks.net wrote:

> 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.

In non-Perl terms, this information is often in /etc.  The file
/etc/issue in particular is often useful.

It's almost always better to test for tools and features than
distributions anyhow.  If you need package X, don't assume it's
installed, check.  For a web server, Apache for example, there's tools
to tell you the version and compiled-in or loaded features.  Perl
can't solve this problem in general terms AFAIK.

Ted


------------------------------

Date: 06 Nov 2006 22:50:16 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: What is more detailled than $^O ?
Message-Id: <slrnekvf09.rtp.abigail@alexandra.abigail.be>

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 you want to test for a specific feature, test for that feature.
Don't assume that a specific Linux distro means something is available
(or not available).



Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


------------------------------

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 9936
***************************************


home help back first fref pref prev next nref lref last post