[28578] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9942 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 8 14:05:56 2006

Date: Wed, 8 Nov 2006 11: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           Wed, 8 Nov 2006     Volume: 10 Number: 9942

Today's topics:
    Re: "Did not find leading dereferencer" - new findings  <ro.naldfi.scher@gmail.com>
    Re: Best or the-module-you-use to list installed Perl m <brian.d.foy@gmail.com>
    Re: Best or the-module-you-use to list installed Perl m <ynl@nsparks.net>
    Re: Data Pattern generation <rvtol+news@isolution.nl>
    Re: Generate HTML from a Windows Network Share <robgmatthews@gmail.com>
    Re: Generate HTML from a Windows Network Share <scobloke2@infotop.co.uk>
    Re: how do you identify if a file is utf8 in perl <rvtol+news@isolution.nl>
    Re: How to open a browser with perl ? <daveandniki@ntlworld.com>
    Re: Masking/Hiding a password in Perl Source <nospam@example.com>
        Newbie perl question laclac01@yahoo.com
    Re: Newbie perl question <noreply@gunnar.cc>
    Re: Newbie perl question <tadmc@augustmail.com>
    Re: Newbie perl question <john@castleamber.com>
    Re: Nmake Error Two Modules <jmw_misc@hotmail.com>
    Re: Perl and OpenGL jmg3000@gmail.com
    Re: Regular expressions <newsmanDELETE@REMOVEdahl-stamnes.net>
    Re: Regular expressions <mritty@gmail.com>
    Re: warnings or -w ? <nospam@example.com>
    Re: What is more detailled than $^O ? anno4000@radom.zrz.tu-berlin.de
    Re: What is more detailled than $^O ? <ynl@nsparks.net>
    Re: What is more detailled than $^O ? <segraves_f13@mindspring.com>
    Re: What is more detailled than $^O ? <segraves_f13@mindspring.com>
    Re: What is more detailled than $^O ? <segraves_f13@mindspring.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 8 Nov 2006 07:20:14 -0800
From: "Ronny" <ro.naldfi.scher@gmail.com>
Subject: Re: "Did not find leading dereferencer" - new findings to an old puzzle
Message-Id: <1162999213.906180.28630@e3g2000cwe.googlegroups.com>


Ben Morrow schrieb:

> Quoth "Ronny" <ro.naldfi.scher@gmail.com>:
> > Ferry Bolhar schrieb:
> > > "Did not find leading dereferencer":
> > >  "extract_variable" was expecting one of '$', '@', or '%' at the
> > > start of a variable, but didn't find any of them.
> > This doesn't make any sense. First, I don't include in my programs any
> > Text:: stuff. Second, this would not explain why the error message
> > changes to the real one, if, say, I remove one comment line from the
> > source code.
>
> 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.

Indeed I do have a

   use Switch 'Perl6';

in this module. Good point.

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

On the positive side, my example file is kind of self-contained in that
it
uses only standard modules, so if the Perl developers are interested in
this bug, they can take this file and reproduce the error.

BTW, another interesting observation: My example file shows the
error only if it is "use'd" (it starts with a #! line so that,
technically,
you can also call it as a stand-alone program, but it is written as
a module, so that you can also 'use' it). This means that if you
write

   # Name of the file demonstrating the error: hinig.pm
   perl -e 'use hinig;'

you get the "leading dereferncer" error, but if you just call it as

   hinig.pm

you get the 'real' error message.

Ronald
>
> Ben
>
> --
> It will be seen that the Erwhonians are a meek and long-suffering people,
> easily led by the nose, and quick to offer up common sense at the shrine of
> logic, when a philosopher convinces them that their institutions are not based
> on the strictest morality. [Samuel Butler, paraphrased] benmorrow@tiscali.co.uk



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

Date: Wed, 08 Nov 2006 10:02:31 -0500
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: Best or the-module-you-use to list installed Perl modules ?
Message-Id: <081120061002310229%brian.d.foy@gmail.com>

In article <MPG.1fbbcd3399d7518e989900@news.tiscali.fr>, Yohan N Leder
<ynl@nsparks.net> wrote:

> What's the best cgi Perl module to list installed Perl modules ? Or, 
> since "best" doesn't have a real sense : what's the module you use to 
> list all the installed module on the server ?

CPAN.pm's autobundle feature will list all installed modules along
with their versions. CPAN.pm comes with Perl.

-- 
Posted via a free Usenet account from http://www.teranews.com



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

Date: Wed, 8 Nov 2006 18:11:46 +0100
From: Yohan N Leder <ynl@nsparks.net>
Subject: Re: Best or the-module-you-use to list installed Perl modules ?
Message-Id: <MPG.1fbc2e3c3a219ecc989901@news.tiscali.fr>

In article <081120061002310229%brian.d.foy@gmail.com>, 
brian.d.foy@gmail.com says...
> In article <MPG.1fbbcd3399d7518e989900@news.tiscali.fr>, Yohan N Leder
> <ynl@nsparks.net> wrote:
> 
> > What's the best cgi Perl module to list installed Perl modules ? Or, 
> > since "best" doesn't have a real sense : what's the module you use to 
> > list all the installed module on the server ?
> 
> CPAN.pm's autobundle feature will list all installed modules along
> with their versions. CPAN.pm comes with Perl.
> 
> 

OK, seen, and CPANPLUS too. Thanks Brian


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

Date: Wed, 8 Nov 2006 14:59:46 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Data Pattern generation
Message-Id: <eisre1.1gc.1@news.isolution.nl>

usenet@DavidFilmer.com schreef:

> 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 documentation of sprintf is a little bit (sic) off regarding the
"0x" prefix, because it can be "0X" too:

   $ perl -we 'printf "%#04X\n", 15'
   0X0F

   $ perl -we 'printf "%0#4X\n", 15'
   0X0F


I tend to use:

   $ perl -we 'printf "0x%02X\n", 15'
   0x0F

because I like to use that format, and because I easily forget to count
in the "0x" prefix (in the length).


The following is a bit harder to convert to a lowercase prefix and
uppercase numerics:

$ perl -we 'printf "%#8.2x\n", 15'
    0x0f



The documentation is already updated for the next release of perl,
saying that the casing of the prefix follows the casing of the
conversion-letter.


See also:

   $ perl -we 'printf "%#08b\n", 15'
   0b001111

The uppercase-B is added to the next release of perl:

   $ perl5.9 -we 'printf "%#08B\n", 15'
   0B001111

Maybe one day there will be a %P (and maybe even a %#p) too.
:)

-- 
Affijn, Ruud

"Gewoon is een tijger."



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

Date: 8 Nov 2006 09:17:05 -0800
From: "rob" <robgmatthews@gmail.com>
Subject: Re: Generate HTML from a Windows Network Share
Message-Id: <1163006225.267635.6400@f16g2000cwb.googlegroups.com>

I'm mostly investigating the possible viability of doing this. Please
bear with me as I am very much a newbie when it comes to perl.

>From my understanding, the code for gathering the data would be
something like this (if I'm not totally mistaken ..... which is very
possible):

$path "\\network_share\"

opendir($path) \ die "Can't open $path";
@dirs=3D["other"];
closedir(dir)

print "<a href=3D"\"$path">Test</a>

Am I looking at this in the right direction?

Josef Moellers wrote:
>
> What part are you having problems with:
> - gathering information on a windows network share
> or
> - generate an HTML document
> Where do you expect problems?
>
> What have you tried so far? Where have you failed?
> --
> Josef M=F6llers (Pinguinpfleger bei FSC)
> 	If failure had no penalty success would not be a prize
> 						-- T.  Pratchett



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

Date: Wed, 08 Nov 2006 17:33:46 +0000
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: Re: Generate HTML from a Windows Network Share
Message-Id: <6amdnZ4lL5Jjic_YRVnysA@bt.com>

rob wrote:
> 

I'd start with

#!perl
use strict;
use warnings;

> $path "\\network_share\"

I'm probably over simplifying but ...
1. To assign a value to a variable use the equals sign.
2. Use single quotes unless interpolating variables into text.
3. It is usually prudent to use forward slashes not back slashes.
4. Terminate a statement with a semi-colon.

> 
> opendir($path) \ die "Can't open $path";

1. Use the vertical bar for a high precendence "or".
2. For this circumstance, I prefer the word "or" instead.
    (there are precedence pitfalls for the unwary)

> @dirs=["other"];

You probably need to use the readdir() function here.

> closedir(dir)

Missing semi-colon.

> 
> print "<a href="\"$path">Test</a>

1. Unescaped superfluous quote after href=.
2. You didn't escape the other quote after the path.
3. No terminating quote.
4. No semi-colon.

You probably want to print the filenames you just read.

> 
> Am I looking at this in the right direction?
> 

Yes, but you might need to consult an optician :-)

You might find it helpful to start by writing a tiny program and 
actually try seeing what Perl tells you about syntax errors!

There are CPAN modules that simplify reading filenames from a directory.


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

Date: Wed, 8 Nov 2006 16:05:40 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: how do you identify if a file is utf8 in perl
Message-Id: <eisvfh.1ek.1@news.isolution.nl>

julian@ukonline.co.uk schreef:

> how do you identify if a file is utf8 in perl

There is no perfect way to do that, whether you use perl or any other
executable.

An ASCII file (all bytes 0-127) is also a UTF-8 file (and a utf8 file).

The Windows Notepad text editor prefixes a UTF-8 file with a
BOM-special U+FEFF, which leads to the initial bytes EF BB BF. See
http://www.unicode.org/book/ch13.pdf (13.6 Specials). So you could
check for that "signature".

You could also read the file, in an eval-block, with the utf8-layer
active, once from start to end (or some other limit), to check its
utf8-ness.

See also perluniintro and perlunicode.

-- 
Affijn, Ruud

"Gewoon is een tijger."



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

Date: Wed, 8 Nov 2006 19:32:22 +0100
From: "Dave" <daveandniki@ntlworld.com>
Subject: Re: How to open a browser with perl ?
Message-Id: <455222c9$0$27367$ba4acef3@news.orange.fr>


"Ashok" <genuine.ashok@gmail.com> wrote in message 
news:1162971410.487682.244530@m7g2000cwm.googlegroups.com...
> Hi all,
>     I have been woring in perl for past 6 months. I need to open a IE
> browser using perl scripts, and all the time when I run the script, the
> browser shuld auto refresh. Can anyone help me how to open a browser
> and how to make it auto refresh ?
> If u have came across any modules to be used in cpan for this, let me
> know that.
>
>
> Ashok
>

Sounds like you need to use Win32::OLE to access the IE automation 
interface.




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

Date: Wed, 08 Nov 2006 09:50:40 -0800
From: "Chris G." <nospam@example.com>
Subject: Re: Masking/Hiding a password in Perl Source
Message-Id: <45521907$0$97242$892e7fe2@authen.yellow.readfreenews.net>

While this is not a "secure" solution, obscuring the password or reading
it from a file are really my options.  Using a protocol like SSH is
something I REALLY want to do, but the "gods" who set the policies like
telnet.  A group of us "pee-ons" who see the value and need in SSH and
other common-sense security strategies have tried (unsuccessfully)
several times to convince the management of this value.

I appreciate the input on all of this!  I'm liking the unpack idea (so
far), as well as reading from a file.

Chris G.

Robert Hicks wrote:
> J. Gleixner wrote:
>> Robert Hicks wrote:
>>> As other have answered there really isn't "a" solution to this. I make
>>> myself feel better by using the unpack command in my script.
>>>
>>> my $password = unpack "u", qq{&<&QE87-E};
>>>
>>> Sure that isn't any better than any other solution but it isn't "plain"
>>> text either and that was all I was trying to solve. You could probably
>>> do some silly obfuscation on it too.
>> This really is a false sense of security.
>>
>> If security really is an issue, at all, you should look at more secure
>> transport solutions, such as SSH/SCP. and ensuring the machine is
>> as secure as possible.  Even that might not be enough, however spending
>> more time in those areas will be much more beneficial, compared to
>> trying to find different ways to avoid having a password in clear text,
>> in a script. IMHO.
> 
> Yep, I thought that was clear in my post. It may be a false sense of
> security but it is my false sense of security.  : )
> 
> Robert
> 


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

Date: 8 Nov 2006 06:50:11 -0800
From: laclac01@yahoo.com
Subject: Newbie perl question
Message-Id: <1162997410.959443.214250@m73g2000cwd.googlegroups.com>

I am new to perl, I am having so trouble.  For my program, I just want
to log in to my router and then spit out the html to the screen.
here is my code

#!/usr/bin/perl

$original ="http://admin:admin@192.168.1.1/cgi-bin/sysinfo.cgi";
#$original ="README";
open (FILE, $original);
@lines=<FILE>;
close FILE;
print @lines;

When I  try to do it for the file README it works fine, but when I try
it for the website it doesn't work.  The address is correct because I
can cut and past it in to a browser and it brings me to the correct
page.
Any suggestions?



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

Date: Wed, 08 Nov 2006 16:00:48 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Newbie perl question
Message-Id: <4re9suFr1d5hU1@mid.individual.net>

laclac01@yahoo.com wrote:
> I am new to perl, I am having so trouble.  For my program, I just want
> to log in to my router and then spit out the html to the screen.
> here is my code
> 
> #!/usr/bin/perl
> 
> $original ="http://admin:admin@192.168.1.1/cgi-bin/sysinfo.cgi";
> #$original ="README";
> open (FILE, $original);
> @lines=<FILE>;
> close FILE;
> print @lines;
> 
> When I  try to do it for the file README it works fine, but when I try
> it for the website it doesn't work.  The address is correct because I
> can cut and past it in to a browser and it brings me to the correct
> page.
> Any suggestions?

open() expects a path on the file system, not a URL.

     perldoc -q fetch

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Wed, 8 Nov 2006 09:11:20 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Newbie perl question
Message-Id: <slrnel3sso.ht7.tadmc@tadmc30.august.net>

laclac01@yahoo.com <laclac01@yahoo.com> wrote:

> Subject: Newbie perl question


Please put the subject of your article in the Subject of your article.


> For my program, I just want
> to log in to my router and then spit out the html to the screen.
                                               ^^^^

   perldoc -q HTML

       How do I fetch an HTML file?


> $original ="http://admin:admin@192.168.1.1/cgi-bin/sysinfo.cgi";
> #$original ="README";


A "URL" and a "filename" are not the same thing, so you
access them differently.


> open (FILE, $original);


You should always, yes *always*, check the return value from open():

   open (FILE, $original) or die "could not open '$original'  $!";


> Any suggestions?


Check the Perl FAQ *before* posting to the Perl newsgroup!


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


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

Date: 8 Nov 2006 16:05:29 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Newbie perl question
Message-Id: <Xns987566A72BB9Dcastleamber@130.133.1.4>

laclac01@yahoo.com wrote:

> I am new to perl, I am having so trouble.


Pick your subject with care. Almost all post here are perl questions, so 
no need to state such in your subject. Also we're not really interested in 
your level of expertise, this is often clear from the question and/or 
code.

So that leaves you with an empty subject, because it's entirely wrong.

What's your problem? You can't open a file for reading via an URL.

By just putting that in your subject it's clear what you're asking, and 
people who know about that subject, are more able (and probably willing) 
to help you.

In short: create the shortest post possible that describes your problem. 
You are asking busy people to help you for free.

> Any suggestions?

Read the documentation of LWP. Assuming you're on Windows and are
using Active State, and installed stuff in the default location, enter in
your browser:

file:///C:/Perl/html/site/lib/lwpcook.html

You might want to bookmark: file:///C:/Perl/html/index.html

Also learn to use perldoc, type in a "dos box":

perldoc perldoc

And study the output.

-- 
John                Experienced Perl programmer: http://castleamber.com/

          Perl help, tutorials, and examples: http://johnbokma.com/perl/


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

Date: 8 Nov 2006 08:00:06 -0800
From: "Mike" <jmw_misc@hotmail.com>
Subject: Re: Nmake Error Two Modules
Message-Id: <1163001606.591904.7480@h48g2000cwc.googlegroups.com>

Thanks Rob,
That worked.
I had to move the directory structure back one level as follows.

ia-sta-1.0.0\
  Makefile.pl (Without DIR, and a postable to cd Sta and run a make)
  Sta\
     makefile (make for sta)
     sta.c (Global c funtions for both modules)
     sta.h
  Wf\
     All module files (Makefile.pl, .xs, typemap, etc)
  Txt
     All module files (Makefile.pl, .xs, typemap, etc)

Thanks Again

Mike wrote:
> Hi,
> I have written two modules with the following structure
>
> Sta::Wf
> Sta::Txt
>
> I have a Makefile with the follwing DIR command
>     'DIR'       => [ qw( Sta/Txt Sta/Wf )],
>
> After comiling the first module, i get the following error after
> apparently trying to cd back
>         cd ..
> NMAKE : fatal error U1077: 'cd' : return code '0x1'
> Stop.
>
> If i remove one of the directories, i dont get an error, but the last
> line is also
> cd ..
>
> The compiles work, if done seperately.
>
> I am on WinXP, Activestate perl 5.8.8 build 8.19 COmpiler i am using is
> gcc.
> 
> Thanks
> Mike



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

Date: 8 Nov 2006 07:22:31 -0800
From: jmg3000@gmail.com
Subject: Re: Perl and OpenGL
Message-Id: <1162999351.154258.224980@b28g2000cwb.googlegroups.com>

Martin Mohr wrote:
> [snip]
>
> If somebody would bother to comment, I would still be very happy. Is
> OpenGL generally so much out of fashion?

Thanks for the reviews Martin.

Dunno if OpenGL is "out of fashion". More likely that folks are just
waiting for Perl6 before updating projects they plan to switch over
anyway. For example, poking around, I see that chromatic had some
involvement with SDL::OpenGL, but work there seems to have tapered off.
However, you can see how much work he's putting into Perl6 (i.e., a
lot).

---John



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

Date: Wed, 08 Nov 2006 17:27:30 +0100
From: =?ISO-8859-1?Q?J=F8rn?= Dahl-Stamnes <newsmanDELETE@REMOVEdahl-stamnes.net>
Subject: Re: Regular expressions
Message-Id: <45520572@news.broadpark.no>

Paul Lalli wrote:

> Jørn 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
>> Perl" 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. . .

I only got the 2nd edition... :-(
And it does not have any "Update book" function... guess I must buy a new
version.

-- 
Jørn Dahl-Stamnes
http://www.dahl-stamnes.net/dahls/


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

Date: 8 Nov 2006 08:57:39 -0800
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Regular expressions
Message-Id: <1163005059.346747.4560@m7g2000cwm.googlegroups.com>


J=F8rn Dahl-Stamnes wrote:
> Paul Lalli wrote:
> > 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. . .
>
> I only got the 2nd edition... :-(
> And it does not have any "Update book" function... guess I must buy a new
> version.

You should *really* *really* consider doing so.  Perl has changed quite
a bit since version 5.0 was released, which is what the 2nd ed of the
Camel covers.

Paul Lalli



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

Date: Wed, 08 Nov 2006 10:04:17 -0800
From: "Chris G." <nospam@example.com>
Subject: Re: warnings or -w ?
Message-Id: <45521c39$0$97256$892e7fe2@authen.yellow.readfreenews.net>

Thanks for the discussion.  I never gave it any thought of how to
implement the "warnings" before.  Thanks for the discussion of why I
should do the "use warnings" vs "-w".

Chris G.


Yohan N Leder wrote:
> 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".


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

Date: 8 Nov 2006 15:04:44 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: What is more detailled than $^O ?
Message-Id: <4rea0cFqu7kiU1@mid.dfncis.de>

Yohan N Leder  <ynl@nsparks.net> wrote in comp.lang.perl.misc:
> In article <slrnel25f3.rtp.abigail@alexandra.abigail.be>, 
> abigail@abigail.be says...

> > 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 ...
> >
> > This isn't really a Perl question, is it? 
> 
> If you've read the thread, you've seen it's solved now

That doesn't make it a Perl question.  Can you say "non sequitur"?

Anno


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

Date: Wed, 8 Nov 2006 18:14:07 +0100
From: Yohan N Leder <ynl@nsparks.net>
Subject: Re: What is more detailled than $^O ?
Message-Id: <MPG.1fbc2ecaf8987c23989902@news.tiscali.fr>

In article <4rea0cFqu7kiU1@mid.dfncis.de>, anno4000@radom.zrz.tu-
berlin.de says...
>  "non sequitur"
> 

It's your second post in a thread which is not a Perl one : you're very 
strong in "non sequitur" too


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

Date: Wed, 08 Nov 2006 18:23:14 GMT
From: "Bill Segraves" <segraves_f13@mindspring.com>
Subject: Re: What is more detailled than $^O ?
Message-Id: <mgp4h.4095$l25.2777@newsread4.news.pas.earthlink.net>

"Yohan N Leder" <ynl@nsparks.net> wrote in message
news:MPG.1fbbcb12e9f24cd9898ff@news.tiscali.fr...
<snip>
> If you've read the thread, you've seen it's solved now

I've read the thread; and I didn't see you had solved a Perl problem
anywhere in the thread.

--
Bill Segraves






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

Date: Wed, 08 Nov 2006 18:23:22 GMT
From: "Bill Segraves" <segraves_f13@mindspring.com>
Subject: Re: What is more detailled than $^O ?
Message-Id: <ugp4h.4097$l25.3251@newsread4.news.pas.earthlink.net>

"Yohan N Leder" <ynl@nsparks.net> wrote in message
news: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.
> >
<snip>
> 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

Is this the item in the thread that you later claimed is your solution to
your non-Perl problem?

--
Bill Segraves






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

Date: Wed, 08 Nov 2006 18:23:25 GMT
From: "Bill Segraves" <segraves_f13@mindspring.com>
Subject: Re: What is more detailled than $^O ?
Message-Id: <xgp4h.4098$l25.3969@newsread4.news.pas.earthlink.net>

"Yohan N Leder" <ynl@nsparks.net> wrote in message
news:MPG.1fbaedff61007c7a9898fc@news.tiscali.fr...
<snip>
> 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 ?

You have prolonged your thread by not asking your questions in the proper
forum, e.g., comp.infosystems.www.authoring.cgi for CGI questions.

Clue: If the core of the solution would be the same, regardless of the
language in which you implement it, it's not a language problem.

You didn't mention what you had tried, e.g., on this workstation, while
running under Knoppix 4.02:

    uname -a (more detailed than Perl's $^O)
    cat /proc/version (more detailed than uname)

Either of those gives you more information than Perl's $^O, why not try
one of them?

That said (written), it is clear to me that the question is not a Perl
question; so I'll switch to "End of Thread" mode here.

--
Bill Segraves








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

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


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