[28593] in Perl-Users-Digest
Perl-Users Digest, Issue: 9957 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Nov 12 06:05:55 2006
Date: Sun, 12 Nov 2006 03:05:07 -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 Sun, 12 Nov 2006 Volume: 10 Number: 9957
Today's topics:
Algorithm with HoA looping <hpbenton@scripps.edu>
Re: Algorithm with HoA looping <rvtol+news@isolution.nl>
Re: Creating Windows Shortcuts Programmatically <joe@inwap.com>
Re: filter out "strange" text in perl ? =?utf-8?B?w63Ct <ben.usenet@bsb.me.uk>
Re: filter out "strange" text in perl ? =?UTF-8?B?w63Ct <joe@inwap.com>
How to check ? <rakesh.shardiwal@gmail.com>
Re: How to check ? <someone@example.com>
Re: how to source an environment file <damercer@comcast.net>
IPC::Open3 <ed@noreply.com>
Re: IPC::Open3 <ced@blv-sam-01.ca.boeing.com>
new CPAN modules on Sun Nov 12 2006 (Randal Schwartz)
Re: perl exceptions and return value in finally block rusland@scn.ru
Re: perl threading; ->join; best method? <nospam-abuse@ilyaz.org>
scope of $name in: (my $name = 123) && something-invo <iler.ml@gmail.com>
Re: scope of $name in: (my $name = 123) && something- <someone@example.com>
Threads - "Attempt to free non-existent shared string" <lev.weissman@creo.com>
Unix Scripting Education Survey <pillyponka@gmail.com>
Re: Unix Scripting Education Survey <justin.0611@purestblue.com>
Re: What is more detailled than $^O ? <bik.mido@tiscalinet.it>
Re: What is more detailled than $^O ? <bik.mido@tiscalinet.it>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Nov 2006 15:27:59 -0800
From: "PB0711" <hpbenton@scripps.edu>
Subject: Algorithm with HoA looping
Message-Id: <1163287679.597956.168010@h48g2000cwc.googlegroups.com>
Hello,
I need some help designing an algorithm to loop thought a HoA a user
defined number of times. I want to take the keys and make every
possible combination of the keys. Then take all of this and put it into
a database. The DB will then contain the combinations of the keys and
the additions of the values (the array) as the data for each key
combinatiion. I hope that makes sense. Any help would be great.
Cheers,
PB :)
------------------------------
Date: Sun, 12 Nov 2006 11:34:07 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Algorithm with HoA looping
Message-Id: <ej712j.k4.1@news.isolution.nl>
PB0711 schreef:
> I need some help designing an algorithm to loop thought a HoA a user
> defined number of times. I want to take the keys and make every
> possible combination of the keys. Then take all of this and put it
> into a database. The DB will then contain the combinations of the
> keys and the additions of the values (the array) as the data for each
> key combinatiion. I hope that makes sense. Any help would be great.
Where is your code?
Suppose your hash is
%HoA = ( a => [1, 2, 3]
, b => [4, 5, 6]
, c => [7, 8, 9]
) ;
then should a query limited by "a,c,b" return 6+24+15= 45?
The table can then just hold
a,6
b,15
c,24
and you can leave the summing to the database, something like
SELECT SUM(sum_array) AS tot FROM table WHERE key IN "a,c,b"
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Sat, 11 Nov 2006 19:30:53 -0800
From: Joe Smith <joe@inwap.com>
Subject: Re: Creating Windows Shortcuts Programmatically
Message-Id: <hI-dnRh9H6ogCMvYnZ2dnUVZ_sqdnZ2d@comcast.com>
Mark Clements wrote:
> 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.
Interesting. That module was not found when I tried
http://search.cpan.org/search?query=Win32::Shortcut
http://search.cpan.org/search?query=Win32%3A%3AShortcut
Google found a module from 1997 that creates executable shortcuts
(ones that run a particular program in a specified directory with
given arguments). Not what I expected for a file shortcut.
http://search.cpan.org/src/JDB/libwin32-0.26/Shortcut/docs/index.html
-Joe
------------------------------
Date: Sun, 12 Nov 2006 01:44:48 +0000
From: Ben Bacarisse <ben.usenet@bsb.me.uk>
Subject: Re: filter out "strange" text in perl ? =?utf-8?B?w63CteKWk8K9?= =?utf-8?B?z4TilKTilpHOpsOi4oKn?=
Message-Id: <87ejs9781b.fsf@bsb.me.uk>
anno4000@radom.zrz.tu-berlin.de writes:
> Jack <jack_posemsky@yahoo.com> wrote in comp.lang.perl.misc:
>>
<snip>
>> Ok then - does anyone know what the syntax is to detect:
>
> That's not a syntax question. Code untested:
>
>> 1- ASCII
>
> For a single character:
>
> ord $char < 128
>
> For use in a regex:
>
> [[:ascii:]]
>
>> 2- double byte characters
>
> ord $char >= 256
>
> [^\0-\xff]
>
>> 3- UTF-8
>
> UTF-8 and ASCII overlap.
Yes, but in a very useful way. If you have an octet stream that might
be ASCII or UTF-8 or even "both mixed up" you can tell them apart. I
put that in quotes because, as you say, the encodings overlap in that
ASCII octets are valid UTF-8 encodings and they encode the same
character.
When you see an octet with the top bit set you tell if it the first
octet of a UTF-8 encoding *and* how many of the following octets are
part of the character. The following octets are all of the form
10xxxxxx so even if you find yourself in the middle of a multi-octet
character you can skip to the next one (it will start 11xxxxxx or
0xxxxxxx).
--
Ben.
------------------------------
Date: Sat, 11 Nov 2006 18:34:20 -0800
From: Joe Smith <joe@inwap.com>
Subject: Re: filter out "strange" text in perl ? =?UTF-8?B?w63CteKWk8K9z4Q=?= =?UTF-8?B?4pSk4paRzqbDouKCpw==?=
Message-Id: <xfSdnQ2-nZDnFcvYnZ2dnUVZ_uednZ2d@comcast.com>
Jack wrote:
> Ok then - does anyone know what the syntax is to detect:
> 1- ASCII
> 2- double byte characters
> 3- UTF-8
Your list excludes single-byte characters with the high-order
bit set, such as ISO 8859-1 (Latin-1 alphabet), since ASCII is
defined as 7-bit codes.
-Joe
------------------------------
Date: 12 Nov 2006 00:46:59 -0800
From: "Rakesh" <rakesh.shardiwal@gmail.com>
Subject: How to check ?
Message-Id: <1163321219.405014.318310@k70g2000cwa.googlegroups.com>
Any body know perl program for Check wether IIS is installed or not ?
------------------------------
Date: Sun, 12 Nov 2006 08:59:09 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: How to check ?
Message-Id: <xnB5h.2503$C94.707@edtnps82>
Rakesh wrote:
> Any body know perl program for Check wether IIS is installed or not ?
perl -e"print q[Is IIS installed? ]; <STDIN>"
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: Sat, 11 Nov 2006 18:06:18 -0600
From: "Dan Mercer" <damercer@comcast.net>
Subject: Re: how to source an environment file
Message-Id: <m4edncGH3drh-MvYnZ2dnUVZ_oydnZ2d@comcast.com>
<dcruncher4@aim.com> wrote in message news:1163083944.521955.293620@k70g2000cwa.googlegroups.com...
: I want my perl script to read a file containing environment variables
: and source it back
: to the script. That is, when the script is executed, these variables
: are not defined
: in enviroment. Once the script starts, variables defined in that env
: file is sourced
: in. In korn shell we can do
: dot(.) scriptname
:
: How do we do the same in perl.
:
: I found a crude approach. I do
: system(". scriptname; env > /tmp/env.$$")
: then I open /tmp/env.$$ file and store all env defined there
: in $ENV{envvar}.
:
: There should be a better way of doing it, shouldn't it?
:
: thanks.
:
Here's the source function from a module I wrote:
#!/usr/bin/perl -w
# Copyright Singing Pig Consulting 2005-
#
# Author Dan Mercer (Singing Pig Consulting)
# Date Created: 09/11/04 at 01:48:42 PM
use strict;
use warnings;
sub source
{
# Format: source file[,shell]
# : modifies the current environment
my ($srcfile, $shell, $legal, $srccmd, $pipeline, $perlcmd);
# filehandles
my ($hostsfh, $pipefh);
my $me = (caller(0))[3];
$srcfile = shift or die "$me: Missing source file argument\n";
$shell = shift or $shell = $ENV{SHELL} or $shell = "sh";
die "Unknown shell '$shell'\n" unless ($shell =~ /sh$/);
$srcfile = cwd() . "/" . $srcfile unless($srcfile =~ m{/});
# get full pathname
unless ($shell =~ m{^/})
{
my @path = split(/:/, $ENV{PATH});
foreach (@path)
{
next unless (-x "$_/$shell");
$shell = "$_/$shell";
last;
}
die "$me: unrecognized shell '$shell'\n" unless ($shell =~ m{^/});
}
# make sure it's a legal shell
$legal = 0;
if (open($hostsfh,"<","/etc/shells"))
{
while (<$hostsfh>)
{
chomp;
if ($_ eq $shell)
{
$legal = 1;
last;
}
}
close $hostsfh;
}
else
{
$legal = 1;
}
die "$me: illegal shell '$shell'\n" unless ($legal);
# determine source command
$srccmd = ($shell =~ /csh$/) ? "source" : ".";
# set up pipeline to source file then have perl print it out
# using NUL's as file and record separators
$perlcmd = "$^X -l0 -e '" . '\$,=\$\\;print %ENV' . "'";
$pipeline = "$shell -c \"$srccmd $srcfile;$perlcmd\"";
open ($pipefh, "$pipeline |") or die "$me: pipeline failed - $!\n";
my @env = %ENV;
local $/ = "\0"; # IRS to NUL - use local so WHHSH
my @newenv = <$pipefh>;
chomp @newenv;
push @env,@newenv;
close $pipefh;
%ENV = @env;
}
__DATA__
Dan Mercer
------------------------------
Date: Sun, 12 Nov 2006 01:10:01 GMT
From: ed <ed@noreply.com>
Subject: IPC::Open3
Message-Id: <20061112010820.59518fad@ed-desktop>
is it possible to get the exit status of a program that is started using
IPC::Open3?
#!/usr/bin/perl
use strict;
use warnings;
use IPC::Open3;
my $bpid = open3( my $bwr, my $brd, my $ber, "ls -al /fdsfsdfsfs" );
close($bwr);
close($brd);
print( $? );
this should close with exit 2 on my system, but i cannot seem to capture
the exit code at all.
--
Regards, Ed :: http://www.ednevitable.co.uk
just another linux person
Vin Diesel is fully backwards-compatible with all versions of the
Nintendo GameBoy.
------------------------------
Date: Sun, 12 Nov 2006 05:58:35 GMT
From: Charles DeRykus <ced@blv-sam-01.ca.boeing.com>
Subject: Re: IPC::Open3
Message-Id: <J8LsLM.GID@news.boeing.com>
ed wrote:
> is it possible to get the exit status of a program that is started using
> IPC::Open3?
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
> use IPC::Open3;
>
> my $bpid = open3( my $bwr, my $brd, my $ber, "ls -al /fdsfsdfsfs" );
> close($bwr);
> close($brd);
> print( $? );
>
>
> this should close with exit 2 on my system, but i cannot seem to capture
> the exit code at all.
The best examples for IPC::Open3 are found here in my opinion:
perldoc -q external
In your sample case, backticks would be more straightforward.
But, a possible solution with Open3:
$bpid = open3( ... )
waitpid( $bpid, 0 );
warn "exit code = ", $?>>8, "\n";
or, if you wanted to capture any error text too:
open( my $ber, '<&2' ) or die $!;
$bpid = open3(... );
waitpid ( $bpid, 0 );
if ($?) {
warn "exit code = ", $?>>8, "\n";
warn "error status = ", <$ber>;
}
--
Charles DeRykus
------------------------------
Date: Sun, 12 Nov 2006 05:42:10 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sun Nov 12 2006
Message-Id: <J8LruA.1043@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
AI-PSO-0.80
http://search.cpan.org/~kylesch/AI-PSO-0.80/
Perl module for running the Particle Swarm Optimization algorithm
----
Audio-SndFile-0.03
http://search.cpan.org/~jdiepen/Audio-SndFile-0.03/
Portable reading and writing of sound files
----
CGI-Auth-Auto-1.05
http://search.cpan.org/~leocharre/CGI-Auth-Auto-1.05/
Automatic authentication maintenance for cgi scrips.
----
CGI-Form-Table-0.161
http://search.cpan.org/~rjbs/CGI-Form-Table-0.161/
create a table of form inputs
----
Cairo-1.021
http://search.cpan.org/~tsch/Cairo-1.021/
Perl interface to the cairo library
----
Email-Address-1.880
http://search.cpan.org/~rjbs/Email-Address-1.880/
RFC 2822 Address Parsing and Creation
----
Exporter-Lite-0.02
http://search.cpan.org/~mschwern/Exporter-Lite-0.02/
Lightweight exporting of variables
----
File-RsyncP-0.66
http://search.cpan.org/~cbarratt/File-RsyncP-0.66/
Perl Rsync client
----
File-SimpleQuery-0.01
http://search.cpan.org/~btp/File-SimpleQuery-0.01/
Query flat-files, simply!
----
HTML-Tidy-1.07_01
http://search.cpan.org/~petdance/HTML-Tidy-1.07_01/
(X)HTML validation in a Perl object
----
HTML-Tree-3.22
http://search.cpan.org/~petek/HTML-Tree-3.22/
overview of HTML::TreeBuilder et al
----
Lingua-Ident-1.6
http://search.cpan.org/~mpiotr/Lingua-Ident-1.6/
Statistical language identification
----
PAR-0.958
http://search.cpan.org/~smueller/PAR-0.958/
Perl Archive Toolkit
----
POE-Component-DirWatch-Object-0.06
http://search.cpan.org/~groditi/POE-Component-DirWatch-Object-0.06/
POE directory watcher object
----
PSO-0.7
http://search.cpan.org/~kylesch/PSO-0.7/
Perl module for running the Particle Swarm Optimization algorithm
----
Tcl-0.90
http://search.cpan.org/~vkon/Tcl-0.90/
Tcl extension module for Perl
----
Test-Run-CmdLine-0.0102
http://search.cpan.org/~shlomif/Test-Run-CmdLine-0.0102/
Analyze tests from the command line using Test::Run
----
Time-Duration-Object-0.161
http://search.cpan.org/~rjbs/Time-Duration-Object-0.161/
Time::Duration, but an object
----
UNIVERSAL-require-0.11
http://search.cpan.org/~mschwern/UNIVERSAL-require-0.11/
require() modules from a variable
----
WWW-Search-MSN-0.0104
http://search.cpan.org/~shlomif/WWW-Search-MSN-0.0104/
backend for searching search.msn.com
----
WebService-Bloglines-0.12
http://search.cpan.org/~miyagawa/WebService-Bloglines-0.12/
Easy-to-use Interface for Bloglines Web Services
----
Win32-Process-Perf-1.05
http://search.cpan.org/~rpagitsch/Win32-Process-Perf-1.05/
----
Wx-0.60
http://search.cpan.org/~mbarbon/Wx-0.60/
interface to the wxWidgets cross-platform GUI toolkit
----
Wx-Demo-0.03
http://search.cpan.org/~mbarbon/Wx-Demo-0.03/
the wxPerl demo
----
Wx-GLCanvas-0.05
http://search.cpan.org/~mbarbon/Wx-GLCanvas-0.05/
interface to wxWidgets' OpenGL canvas
----
XML-Rules-0.08
http://search.cpan.org/~jenda/XML-Rules-0.08/
parse XML & process tags by rules starting from leaves
----
XML-Rules-0.09
http://search.cpan.org/~jenda/XML-Rules-0.09/
parse XML & process tags by rules starting from leaves
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: 11 Nov 2006 22:06:35 -0800
From: rusland@scn.ru
Subject: Re: perl exceptions and return value in finally block
Message-Id: <1163311595.270554.162390@e3g2000cwe.googlegroups.com>
> You can't "return" from a try.
>
> my $ret;
> try {
> if( condition ) { $ret = 'abc' }
> elsif( condition2 ) { $ret='lmnop'; }
Yes, I can use return at try, for example:
#!/usr/bin/perl
use strict;
use Error qw(:try);
sub apple {
try {
return 'fruit' if $_[0] eq 'apple';
return 'possibly a fruit';
}
finally {
print 'finally at apple(): ';
};
}
print apple('apple'), "\n";
print apple('berry'), "\n";
exit;
But problem is that I do not know what is return value in the finally
block... :(
------------------------------
Date: Sun, 12 Nov 2006 04:13:20 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: perl threading; ->join; best method?
Message-Id: <ej6710$12ud$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
jdhedden
<jdhedden@1979.usna.com>], who wrote in article <1163246988.121045.78140@m7g2000cwm.googlegroups.com>:
> 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.
Same as for the initial code. If you need this info, just inspect the
return value of join_a_thread(). I would think that something as
if (my ($thread_id_was, @retVal) = threads->join_a_thread()) {
} else { # Nothing joinable
}
would be sufficient...
Hope this helps,
Ilya
P.S. IMO, Any API that encourages using sleep(1) should go back to
the design board...
------------------------------
Date: 12 Nov 2006 01:11:45 -0800
From: "Yakov" <iler.ml@gmail.com>
Subject: scope of $name in: (my $name = 123) && something-involving-$name;
Message-Id: <1163322705.165277.68750@m7g2000cwm.googlegroups.com>
I find it strange in the examlpe below
1 open(my $fh, my $name="</no/such/file") ||
2 warn "Error name=$name\n";
3 print "name=$name";
that $name is not in the scope, at line 2 (in the warn() arg).
The assignment to $name in line 1 definitely already happened. So
how come $name is not known at line 2 ? Is this a feature or a bug ?
What is the explanation ? Does perl, like, wait for the semicolon to
add $name to the hashtable or variables ?
This is counterintuitive to me ... (comparing to C foo() { int x=1,
y=x; } )
Thanks
Yakov
------------------------------
Date: Sun, 12 Nov 2006 10:05:49 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: scope of $name in: (my $name = 123) && something-involving-$name;
Message-Id: <1mC5h.2290$gy2.1544@edtnps90>
Yakov wrote:
> I find it strange in the examlpe below
>
> 1 open(my $fh, my $name="</no/such/file") ||
> 2 warn "Error name=$name\n";
> 3 print "name=$name";
>
> that $name is not in the scope, at line 2 (in the warn() arg).
>
> The assignment to $name in line 1 definitely already happened. So
> how come $name is not known at line 2 ? Is this a feature or a bug ?
> What is the explanation ? Does perl, like, wait for the semicolon to
> add $name to the hashtable or variables ?
perldoc perlsub
[snip]
The declared variable is not introduced (is not visible) until after
the current statement. Thus,
my $x = $x;
can be used to initialize a new $x with the value of the old $x, and
the expression
my $x = 123 and $x == 123
is false unless the old $x happened to have the value 123.
So when perl compiles the line:
open(my $fh, my $name="</no/such/file") || warn "Error name=$name\n";
the second $name refers to a different variable then the first $name.
$ perl -Mwarnings -Mstrict -ce'open(my $fh, my $name="</no/such/file") || warn
"Error name=$name\n"'
Global symbol "$name" requires explicit package name at -e line 1.
-e had compilation errors.
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: 12 Nov 2006 02:38:45 -0800
From: "MoshiachNow" <lev.weissman@creo.com>
Subject: Threads - "Attempt to free non-existent shared string"
Message-Id: <1163327925.335043.113640@e3g2000cwe.googlegroups.com>
HI,
Just beginning with threads...
Code:
$thr = threads->create({'context' => 'void'},\&THREAD,$computer);
sub THREAD {
$computer=shift;
print "COMPUTER=$computer\n";
$objWMIService =
Win32::OLE->GetObject("winmgmts:\\\\$computer\\root\\CIMV2") or
&disp("WMI connection failed.\n",'RED');
$colItems = $objWMIService->ExecQuery("SELECT * FROM
Win32_Product", "WQL",
wbemFlagReturnImmediately | wbemFlagForwardOnly);
}
$thr->join();
=============================================
result:
"Attempt to free non-existent shared string 'ExecQuery', Perl
interpreter: 0x235d27c at D:\
DOcuments\Ripro\AIX\myscripts\pod_check.pl line 988.
Free to wrong pool 218fd28 not 222770 at
D:\DOcuments\Ripro\AIX\myscripts\pod_check.pl lin
e 988."
The thing is that 'ExecQuery' WAS working well till put in
thread...Appreciate ideas.
Thanks
------------------------------
Date: 11 Nov 2006 15:56:42 -0800
From: "AndrewS" <pillyponka@gmail.com>
Subject: Unix Scripting Education Survey
Message-Id: <1163289401.939625.199500@m7g2000cwm.googlegroups.com>
Invitation to contribute to the Unix Scripting Education
Professional Advisory Committee.
The purpose of this survey is to establish contact with industry
professionals wishing to influence the curriculum of their future
employees. At the end of the survey is an invitation to become
involved in the committee to oversee this research.
Survey: http://www.surveymonkey.com/s.asp?u=743662789831
Background:
Unix scripting at the command line interface is an essential skill for
software development, data analysis and system administration.
Professionals apply these skills in areas as diverse as: web services;
bioinformatics and genome sequencing; quantitative modeling in
transport, energy and the financial sectors; network traffic management
for telecommunications; and nuclear physics to name a few.
It is to the detriment of the IT sector that there is not yet a clear
definition of the core scripting skills which are needed by students
who branch into the various specializations, and therefore there is an
inconsistent coverage of these skills across the education sector.
USEPAC is a committee based at the University of Technology, Sydney,
the University of Sydney, and the University of New South Wales, whose
task is to identify the scripting skills which define the various
levels of competence. The identified skill sets will be published in
order to drive the design of courses and learning resources in the IT
education sector, and to enable IT professionals to be aware of their
standing.
------------------------------
Date: Sun, 12 Nov 2006 02:09:44 +0000
From: Justin C <justin.0611@purestblue.com>
Subject: Re: Unix Scripting Education Survey
Message-Id: <justin.0611-B8591D.02094412112006@stigmata>
In article <1163289401.939625.199500@m7g2000cwm.googlegroups.com>,
"AndrewS" <pillyponka@gmail.com> wrote:
Your name is *what* now? And you're posting on this topic from which
educational establishment?
> Survey: http://www.surveymonkey.com/s.asp?u=743662789831
*and* you expect me to visit "surveymonkey"?
Do we *look* like idiots here?
If your IQ was even remotely close to that of someone who would be
employed by something with a name like "Unix Scripting Education
Professional Advisory Committee" you'd know we're smarter than you and
therefore aren't going to fall for your incredibly poor excuse for a
post soliciting banner advertising clicks, or whatever is the latest way
to make money on the internet.
Muppet. Actually, I think that's insulting to most muppets, I take it
back.
--
Justin C, by the sea.
------------------------------
Date: Sun, 12 Nov 2006 00:33:45 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: What is more detailled than $^O ?
Message-Id: <pl9cl2tpjbl1i40t91srijvucon9re72tk@4ax.com>
On Tue, 7 Nov 2006 20:04:01 +0100, Yohan N Leder <ynl@nsparks.net>
wrote:
>> 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.
Well, that's one possibility.
>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.
In fact, that's not the point. The concept of a team fits well also
with other strategies than trying to infer the Linux distro in the
main scripts. For example one that springs to mind to me (not
necessarily the best one) would involve to wrap logging facilities in
a module that's to be made in different flavours for each distro (and
incidentally should check for your logs and trees) packaged in a
distro specific manner. After all from your words one has to infer
that you will be installing new machines quite often: how are you
making them? Just make sure that the required module is part of the
configuration that each machine must have.
You can easily reuse what you've done, because the different flavours
of the module would be very similar to each other. But if you're
concerned that when upgrading it you will have to modify the sorces of
each flavour instead of one, then just make it ortogonal enough to the
differences between the various distros that you can have one module
only, depending say on some environment variable or configuration
file. (The module should do the checking anyway, as hinted above, so
if the latter ones give wrong indications, then it should complain
aloud!)
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: Sun, 12 Nov 2006 00:37:12 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: What is more detailled than $^O ?
Message-Id: <qencl29ntop23k9r89cet3a37letip4omd@4ax.com>
On Tue, 7 Nov 2006 09:16:13 +0100, Yohan N Leder <ynl@nsparks.net>
wrote:
>Yes, but I don't want to test what feature is available or not. The fact
>is that some of the Perl CGI scripts we spread in our intranet and
>extranet have to proceed with reports from proprietaries logs in
>different trees depending of the specific linux distribution (actually :
>Ubuntu, Debian, Red Hat Ent, Fedora and Suse, but more in future).
How are proprietary logs in different trees failing to be *features*?
>And, to facilitate the stuff, some of the servers may change from time
>to time (I mean, change of linux ditribution from multi-boot or raw
>change) and every admin has choice to keep of strip-out some parts of
>the logs tree I told about ; this without notice, so I can't maintain a
>simple database saying server #1 is under Debian, server #2 is under
>Fedora, etc.
Then again, to make it short, I would rather follow a scheme like that
hinted in my other post, with the relevant info about the logs trees
embedded e.g. in a configuration file that should be part of a
particular distro configuration for your environment.
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: 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 9957
***************************************