[29939] in Perl-Users-Digest
Perl-Users Digest, Issue: 1182 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 9 16:09:41 2008
Date: Wed, 9 Jan 2008 13:09:10 -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, 9 Jan 2008 Volume: 11 Number: 1182
Today's topics:
Checking the Platform in Perl mariakvelasco@gmail.com
Re: Checking the Platform in Perl <jurgenex@hotmail.com>
Re: every($key, $interval) function <uri@stemsystems.com>
Force return of the diamond operator from network socke <n0nb.DO.NOT.SPAM@ME.n0nb.us>
Re: Help with a Reg Ex <m@rtij.nl.invlalid>
Re: Help with a Reg Ex <amerar@iwc.net>
Re: Help with a Reg Ex <amerar@iwc.net>
Re: Help with a Reg Ex <jurgenex@hotmail.com>
Re: Help with a Reg Ex <jurgenex@hotmail.com>
how to do bit complement in perl <balaji.draj@gmail.com>
Re: how to do bit complement in perl <smallpond@juno.com>
Re: Perl Database Programing download for the template <smallpond@juno.com>
Re: Perl Database Programing download for the template <kwan.jingx@gmail.com>
Re: remove special characters in front of the file name wong_powah@yahoo.ca
Search/Replace text in XML file <lax_reddy@hotmail.com>
Re: Search/Replace text in XML file <lax_reddy@hotmail.com>
Re: Using CPAN "lightweight" <brian.d.foy@gmail.com>
Re: Using CPAN "lightweight" <bernie@fantasyfarm.com>
Re: Using CPAN "lightweight" <brian.d.foy@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 9 Jan 2008 12:28:45 -0800 (PST)
From: mariakvelasco@gmail.com
Subject: Checking the Platform in Perl
Message-Id: <c844a1d7-356f-4acd-9f09-1e56d00ed0a6@z17g2000hsg.googlegroups.com>
Hello all,
Is there a way using perl code to check what platform the script is
running on? I have a script that runs on both windows and unix
platforms and I want to check what platform the script is running on
because I will be executing different sections of the code depending
on the platform.
Thanks!
------------------------------
Date: Wed, 09 Jan 2008 20:50:42 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Checking the Platform in Perl
Message-Id: <cscao39blv5iffdeclqe9glils43efl8md@4ax.com>
mariakvelasco@gmail.com wrote:
>Is there a way using perl code to check what platform the script is
>running on?
perldoc perlvar: $^O
jue
------------------------------
Date: Wed, 09 Jan 2008 19:18:20 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: every($key, $interval) function
Message-Id: <x7sl16byf7.fsf@mail.sysarch.com>
>>>>> "BaB" == Big and Blue <No_4@dsl.pipex.com> writes:
BaB> Uri Guttman wrote:
R> sub every{
R> my %counters if 0;
>> don't use that broken idiom. it will fail under 5.10 since it
>> supports
>> state variables.
BaB> "our %counters" works.
and that declares and uses a global which can be modified by outside
code. not a better solution.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Architecture, Development, Training, Support, Code Review ------
----------- Search or Offer Perl Jobs ----- http://jobs.perl.org ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Wed, 09 Jan 2008 15:04:28 -0600
From: Nate Bargmann <n0nb.DO.NOT.SPAM@ME.n0nb.us>
Subject: Force return of the diamond operator from network socket
Message-Id: <D8ednXH7GfNBqxjanZ2dnUVZ_hudnZ2d@kans.com>
I am involved with a project that will use a server process written in C
and a client written in Perl. The processes will communicate over a
network socket that is opened when the Perl process starts and and remains
open throughout the life of the Perl program.
The server is queried by the Perl program and responds with short text
strings that are newline terminated. The server can return from one to
three lines depending on the query. This part is working well.
Here is where I am running into trouble. I am using the diamond
operator to read from the socket as in:
while (<$socket>) {
chomp;
print "$_\n";
}
however, the diamond operator doesn't return despite trying to send a NULL
string from the C program through the socket. Here is a snippet of my C
program:
fprintf(fout, "");
fflush(fout);
however, I'm not certain that the NULL string is even making it through
the socket to the Perl program.
Perhaps there is a better method of signalling the end of the C program's
output to the Perl program. At the moment I'm a bit stumped.
- Nate >>
--
"The optimist proclaims that we live in the best of all
possible worlds. The pessimist fears this is true."
------------------------------
Date: Wed, 9 Jan 2008 20:39:36 +0100
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: Help with a Reg Ex
Message-Id: <pan.2008.01.09.19.39.36@rtij.nl.invlalid>
On Wed, 09 Jan 2008 11:00:18 -0800, amerar@iwc.net wrote:
> I have the following expression in my Perl script:
>
> if (/^"([^\,].+)"\,"$/)
>
> Although I know that it is checking to see if the string starts with
> some characters, it is not working for my input file.
>
> Can someone explain to me in english what it is doing???
/
^ # beginning of string
" # match a quote
( # start capturing
[^\,] # one of any character, except comma
.+ # one of more of any character, except newline
) # stop capturing
" # another quote
\, # a comma
" # yet another quote
$ # end of string
/x
In other words, any string that starts with a quote; then two or more
characters, but not starting with a comma; a quote; a comma and a quote.
What do you want to achieve?
M4
------------------------------
Date: Wed, 9 Jan 2008 12:02:40 -0800 (PST)
From: "amerar@iwc.net" <amerar@iwc.net>
Subject: Re: Help with a Reg Ex
Message-Id: <72cc8e5a-2ca1-4b1c-ad18-d08662973ef8@k39g2000hsf.googlegroups.com>
On Jan 9, 2:39 pm, Martijn Lievaart <m...@rtij.nl.invlalid> wrote:
> On Wed, 09 Jan 2008 11:00:18 -0800, ame...@iwc.net wrote:
> > I have the following expression in my Perl script:
>
> > if (/^"([^\,].+)"\,"$/)
>
> > Although I know that it is checking to see if the string starts with
> > some characters, it is not working for my input file.
>
> > Can someone explain to me in english what it is doing???
>
> /
> ^ # beginning of string
> " # match a quote
> ( # start capturing
> [^\,] # one of any character, except comma
> .+ # one of more of any character, except newline
> ) # stop capturing
> " # another quote
> \, # a comma
> " # yet another quote
> $ # end of string
> /x
>
> In other words, any string that starts with a quote; then two or more
> characters, but not starting with a comma; a quote; a comma and a quote.
>
> What do you want to achieve?
>
> M4
Basically I have an input file, and the result of that IF statement
decides if I process the line read of not.......
------------------------------
Date: Wed, 9 Jan 2008 12:06:35 -0800 (PST)
From: "amerar@iwc.net" <amerar@iwc.net>
Subject: Re: Help with a Reg Ex
Message-Id: <34cadede-fb5d-4582-bcaa-bc53e7971e22@f47g2000hsd.googlegroups.com>
On Jan 9, 2:39 pm, Martijn Lievaart <m...@rtij.nl.invlalid> wrote:
> On Wed, 09 Jan 2008 11:00:18 -0800, ame...@iwc.net wrote:
> > I have the following expression in my Perl script:
>
> > if (/^"([^\,].+)"\,"$/)
>
> > Although I know that it is checking to see if the string starts with
> > some characters, it is not working for my input file.
>
> > Can someone explain to me in english what it is doing???
>
> /
> ^ # beginning of string
> " # match a quote
> ( # start capturing
> [^\,] # one of any character, except comma
> .+ # one of more of any character, except newline
> ) # stop capturing
> " # another quote
> \, # a comma
> " # yet another quote
> $ # end of string
> /x
>
> In other words, any string that starts with a quote; then two or more
> characters, but not starting with a comma; a quote; a comma and a quote.
>
> What do you want to achieve?
>
> M4
I might add, the input file looks like this:
"#ABC","
[
","ABC Dispensing designs, manufactures and services dispensing
systems that utilize standard micro-processing technology and
proprietary operating software.","
]
"
"#ABE","
[
","Aber Diamond Corporation is a specialist diamond company focusing
on the mining and retail segments of the diamond industry. The Company
supplies rough diamonds to the global market through its forty percent
ownership in the Diavik Diamond Mine and owns one of the world's
premier retailers of diamond jewelry, Harry Winston.","
]
"
And I guess it is deciding if the line needs to be processed.......
------------------------------
Date: Wed, 09 Jan 2008 20:15:39 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Help with a Reg Ex
Message-Id: <8caao393ek72amvibe0ednt8209m0vapu9@4ax.com>
"amerar@iwc.net" <amerar@iwc.net> wrote:
>
>I have the following expression in my Perl script:
>
>if (/^"([^\,].+)"\,"$/)
>
>Although I know that it is checking to see if the string starts with
>some characters, it is not working for my input file.
>
>Can someone explain to me in english what it is doing???
Match a string that
^ starts with
" a double quote
( and then a group that consists of
[^\,] one of the three characters caret, backslash, comma
.+ followed by at least one more character
)
"\," and has the character sequence double quote, comma, doublequote
$ at the end of the string.
I hope I got that right.
jue
------------------------------
Date: Wed, 09 Jan 2008 20:40:49 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Help with a Reg Ex
Message-Id: <m7cao3podh25avl9qgg5q0lkt3k9uink4n@4ax.com>
Jürgen Exner <jurgenex@hotmail.com> wrote:
>"amerar@iwc.net" <amerar@iwc.net> wrote:
>>
>>I have the following expression in my Perl script:
>>
>>if (/^"([^\,].+)"\,"$/)
>>
>>Although I know that it is checking to see if the string starts with
>>some characters, it is not working for my input file.
>>
>>Can someone explain to me in english what it is doing???
>
>Match a string that
>^ starts with
>" a double quote
>( and then a group that consists of
>[^\,] one of the three characters caret, backslash, comma
Ooops, correction. Make that
[^\,] any single character, that is not backslash or comma
>.+ followed by at least one more character
>)
>"\," and has the character sequence double quote, comma, doublequote
>$ at the end of the string.
>
>I hope I got that right.
>
>jue
------------------------------
Date: Wed, 9 Jan 2008 11:20:06 -0800 (PST)
From: IJALAB <balaji.draj@gmail.com>
Subject: how to do bit complement in perl
Message-Id: <8b9c4337-421b-4da3-919d-a05e78702786@f47g2000hsd.googlegroups.com>
hi all,
i have a file in which there are 8 byte hex values one followed by
another. For example:
2A414364
00001DA9
01A3F9DD
3FFFF661
00EE6670
000011CF
2BC43FD0
3FEB0003
3F7FFF40
I need to check for the last bit in every data and if it being set,
then the next data's 24 bits have to be inverted(assuming last bit is
d31, starting from d26 to d7 needs to be inverted). For example:
1st data 0x2A414364 has last bit as '0' so the next word can be
retained as same.But, 00001DA9(2nd data), the last bit is '1' so the
next data 01A3F9DD will have to be printed as 3e5c061d. so, for the
upper set of data, the below data needs to be printed. how do i do bit
complement in hex using perl.
2a414364
00001da9
3e5c061d
000009a1
3f1199b0
000011cf
143bc010
3feb0003
00800080
regards,
bala
------------------------------
Date: Wed, 9 Jan 2008 11:43:33 -0800 (PST)
From: smallpond <smallpond@juno.com>
Subject: Re: how to do bit complement in perl
Message-Id: <59a2cda8-bbb3-4495-83d6-e33ab9e7711d@k39g2000hsf.googlegroups.com>
On Jan 9, 2:20 pm, IJALAB <balaji.d...@gmail.com> wrote:
> hi all,
>
> i have a file in which there are 8 byte hex values one followed by
> another. For example:
> 2A414364
> 00001DA9
> 01A3F9DD
> 3FFFF661
> 00EE6670
> 000011CF
> 2BC43FD0
> 3FEB0003
> 3F7FFF40
>
> I need to check for the last bit in every data and if it being set,
> then the next data's 24 bits have to be inverted(assuming last bit is
> d31, starting from d26 to d7 needs to be inverted). For example:
> 1st data 0x2A414364 has last bit as '0' so the next word can be
> retained as same.But, 00001DA9(2nd data), the last bit is '1' so the
> next data 01A3F9DD will have to be printed as 3e5c061d. so, for the
> upper set of data, the below data needs to be printed. how do i do bit
> complement in hex using perl.
>
> 2a414364
> 00001da9
> 3e5c061d
> 000009a1
> 3f1199b0
> 000011cf
> 143bc010
> 3feb0003
> 00800080
>
> regards,
> bala
Test low bit
perl -e 'print hex( "2A414364") & 1 ? "odd" : "even";'
even
perl -e 'print hex( "00001DA9") & 1 ? "odd" : "even";'
odd
Complement whole word
perl -e 'printf "%08x",~hex( "00001DA9");'
ffffe256
XOR with mask
perl -e 'printf "%08x", 0x00ffff00 ^ hex( "01A3F9DD");'
015c06dd
------------------------------
Date: Wed, 9 Jan 2008 11:34:00 -0800 (PST)
From: smallpond <smallpond@juno.com>
Subject: Re: Perl Database Programing download for the template
Message-Id: <0a6c1dcc-b214-4f9b-ab51-d2efa503a640@q39g2000hsf.googlegroups.com>
On Jan 9, 12:57 pm, kwan <kwan.ji...@gmail.com> wrote:
> Hello!
>
> I have this book, but I couldn't located the template download that
> describe in the book. Could anyone point me to the download link for
> the template? I appreciate for your help.
>
> ------------Book information------
> Perl Database Programming
> by Brent Michalski ISBN:0764549561
> John Wiley & Sons =A9 2003 (552 pages)
> Here is an in-depth guide to creating database-driven applications
> using Perl
>
> ---------------------------------------
>
> Thank you
Perhaps you are having problems getting access to google where
you are. I searched for: Perl Database Programming wiley
and followed the first result.
http://media.wiley.com/product_ancillary/61/07645495/DOWNLOAD/Perl_Database_=
Programming_code.zip
------------------------------
Date: Wed, 9 Jan 2008 12:52:33 -0800 (PST)
From: kwan <kwan.jingx@gmail.com>
Subject: Re: Perl Database Programing download for the template
Message-Id: <eb22d337-b485-447f-be9c-6d0666236477@1g2000hsl.googlegroups.com>
On Jan 9, 1:34 pm, smallpond <smallp...@juno.com> wrote:
> On Jan 9, 12:57 pm, kwan <kwan.ji...@gmail.com> wrote:
>
>
>
> > Hello!
>
> > I have this book, but I couldn't located the template download that
> > describe in the book. Could anyone point me to the download link for
> > the template? I appreciate for your help.
>
> > ------------Book information------
> > Perl Database Programming
> > by Brent Michalski ISBN:0764549561
> > John Wiley & Sons =A9 2003 (552 pages)
> > Here is an in-depth guide to creating database-driven applications
> > using Perl
>
> > ---------------------------------------
>
> > Thank you
>
> Perhaps you are having problems getting access to google where
> you are. I searched for: Perl Database Programming wiley
> and followed the first result.http://media.wiley.com/product_ancillary/61/=
07645495/DOWNLOAD/Perl_Da...
Thank for helping.
I had downloaded the file before. I need the template for the each
chapter of the book. However, the download file is for the chapter
source code only.
Kwan
------------------------------
Date: Wed, 9 Jan 2008 12:29:16 -0800 (PST)
From: wong_powah@yahoo.ca
Subject: Re: remove special characters in front of the file names
Message-Id: <ff117517-50d1-4759-8366-4dcec6006339@i72g2000hsd.googlegroups.com>
On Jan 8, 3:26 pm, Ted Zlatanov <t...@lifelogs.com> wrote:
> On Tue, 8 Jan 2008 12:18:08 -0800 (PST) wong_po...@yahoo.ca wrote:
>
> wp> e.g. for this output:
> wp> $ find . -type f -print
> wp> ./VERSION
> wp> ./RELEASE
>
> wp> My desired output will be:
> wp> VERSION
> wp> RELEASE
>
> wp> This does not work:
> wp> $ find . -type f -print | perl -pe 's/([?|*.\047"])/$1/g'
> wp> ./VERSION
> wp> ./RELEASE
>
> You mean you want the base name? This will do what you're asking in the
> example above (you don't need Perl necessarily):
>
> find . -type f -exec basename {} \;
>
> Are you trying to do something else? Show some more examples (what you
> had above was great, by the way).
>
> Ted
It turns out that all I want is the dirname and basename.
Thanks.
------------------------------
Date: Wed, 9 Jan 2008 11:21:41 -0800 (PST)
From: Lax <lax_reddy@hotmail.com>
Subject: Search/Replace text in XML file
Message-Id: <5d60d81b-4be0-48b6-8e57-f8c840597e78@p69g2000hsa.googlegroups.com>
Hello all,
I'm trying to search and replace the value of a tag in an xml file.
I'm not in a position to use the usual XML parsers as the version of
Perl I'm required to use
doesnt contain any of the XML libraries. I can use Text::Balanced, but
I want to deal with the xml file on a
line-by-line basis, as the value of my tag could strecth over multiple-
lines.
Perl Version:
This is perl, v5.8.7 built for sun4-solaris
Sample xml file:
-------------------------
<project xmlns="xml:header">
<version>1.0.0</version>
<SomeTag>
<version>invalid version</version>
</SomeTag>
<SomeAnotherTagNested1>
<SomeAnotherTagNested2>
<SomeAnotherTagNested3>
<version>invalid version</version>
</SomeAnotherTagNested3>
</SomeAnotherTagNested2>
</SomeAnotherTagNested1>
<version>stand-alone, but not valid either</version>
</project>
-------------------------
I only want the version tag when they're not enclosed in any other
tags.
I want to replace the 1.0.0 (an example value) with 2.0.0 on an stand-
alone "version"'s first occurence.
I came up with the following:
--------------------
#!/usr/local/bin/perl
use strict ;
use File::Copy ;
die "Usage: replace.pl <xml file>!\n" unless ( $#ARGV == 0 ) ;
my $file = shift ;
open(IN,"$file") or die "Cant open file: $!\n" ;
chomp(my @arr = <IN> ) ;
close(IN) ;
open(OUT,"> bak") or die "Cant open file: $!\n" ;
# Two flags,
# $tag_flag -- to check if we're inside a tag
# $version_flag -- to check if we've replaced version tag already.
my $tag_flag = "off" ;
my $version_flag = "off" ;
foreach my $line ( @arr )
{
# Dont consider the open and close of top-level <project> tag.
if ( $line =~ /^\s*\<(\/)?project/ )
{
print OUT "$line\n" ;
next ;
}
# Found <version>, replace version string if tag_flag is on and
version_flag is off.
elsif ( ($line =~ /^\s*\<version\>/) && ( $tag_flag eq "off" ) &&
( $version_flag eq "off" ) )
{
# print "Flag: $flag\n" ;
print OUT "<version>2.0.0</version>\n" ;
$tag_flag = "on" ;
$version_flag = "on" ;
}
# Inside an open tag "<", tag_flag on.
elsif ( ( $line =~ /^\s*\<.*\>/ ) && ( $line !~ /^\s*\<\/.*
\>/ ) )
{
print OUT "$line\n" ;
$tag_flag = "on" ;
}
# Inside a close tag "</", tag_flag on.
elsif ( $line =~ /^\s*\<\/.*\>/ )
{
print OUT "$line\n" ;
$tag_flag = "off" ;
} else {
print OUT "$line\n" ;
}
}
close(OUT) ;
# Move bak file to original
------------------------------------------
The above script works, and a "diff bak <xml-file>" gives me the
expected result when the stand-alone <version> is all on one line, I
cant get this working when its extended over multiple-lines.
Could anyone give me some pointers, please?
Thanks,
Lax
------------------------------
Date: Wed, 9 Jan 2008 11:27:37 -0800 (PST)
From: Lax <lax_reddy@hotmail.com>
Subject: Re: Search/Replace text in XML file
Message-Id: <8377f453-d53c-43d0-bf33-d8da85d8b9d8@1g2000hsl.googlegroups.com>
On Jan 9, 2:21=A0pm, Lax <lax_re...@hotmail.com> wrote:
> =A0 =A0 =A0 =A0 # Found <version>, replace version string if tag_flag is o=
n and
> version_flag is off.
> =A0 =A0 =A0 =A0 # Inside an open tag "<", tag_flag on.
> =A0 =A0 =A0 =A0 # Inside a close tag "</", tag_flag on.
Please ignore the inaccurate values for off/on in the comments, the
code has proper values for the flags, sorry.
Thanks,
Lax
------------------------------
Date: Wed, 09 Jan 2008 13:07:28 -0600
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: Using CPAN "lightweight"
Message-Id: <090120081307289790%brian.d.foy@gmail.com>
In article <96s7o312i1lcro9a1aar7a9aih3avu5oer@library.airnews.net>,
Bernie Cosell <bernie@fantasyfarm.com> wrote:
> Is there a way to use the CPAN module *without* its creating a directory
> and doing all sorts of fancy initialization and such?
Well, at some point you need to store the files somewhere.
Are you trying to run CPAN.pm within a script? If you say more about
what you are trying to accomplish I may be able to help. It's easy to
configure CPAN.pm from within a program. You just have to do it (and
then it won't go looking for CPAN/MyConfig.pm. Your best bet is to do
the manual configuration, adjust it as you need it, then load that
configuration programmatically.
However, CPAN.pm (or CPANPLUS), are going to need to store files
somewhere.
------------------------------
Date: Wed, 09 Jan 2008 14:26:00 -0500
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Re: Using CPAN "lightweight"
Message-Id: <k77ao3deal0sdk3tc4e8k7jq6h517jhbmr@library.airnews.net>
Ben Morrow <ben@morrow.me.uk> wrote:
} Have you looked at CPANPLUS? It is core as of 5.10, and it was designed
} to be a more programmer-friendly replacement for CPAN.
Works wonderfully!! Only one little thing I can't quite sort out from the
various CPANPLUS::* manpages: it is possible to *turn*off* the custom
sources machinery?
This little program:
my $cb = CPANPLUS::Backend->new ;
my $mod = $cb->module_tree('File::Find') ;
print "File::Find -> ".$mod->description."\n" ;
print "CPAN version: ".$mod->version."\n" ;
got me almost *exactly* what I wanted:
[MSG] No '/staff/bernie/.cpanplus/custom-sources' dir, skipping custom
sources
File::Find -> Call func for every item in a directory tree
CPAN version: 1.12
except for the '[MSG]' -- I see that that's listed [in ::Backend] as being
a feature, and a nice one, too!! But it'd be nicer if I could tell it
either to quietly ignore the error or even very much better, since I don't
know anything about the $HOME configs of the people that'll be using this
app, simply to disable the custom-sources machinery. I did a check of
'conf' options in the configure_object but I didn't see one that looked
like it might affect the custom-sources stuff... ??
Thanks! /bernie\
--
Bernie Cosell Fantasy Farm Fibers
bernie@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--
------------------------------
Date: Wed, 09 Jan 2008 14:19:10 -0600
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: Using CPAN "lightweight"
Message-Id: <090120081419101619%brian.d.foy@gmail.com>
In article <k77ao3deal0sdk3tc4e8k7jq6h517jhbmr@library.airnews.net>,
Bernie Cosell <bernie@fantasyfarm.com> wrote:
> Ben Morrow <ben@morrow.me.uk> wrote:
>
> } Have you looked at CPANPLUS? It is core as of 5.10, and it was designed
> } to be a more programmer-friendly replacement for CPAN.
>
> Works wonderfully!! Only one little thing I can't quite sort out from the
> various CPANPLUS::* manpages: it is possible to *turn*off* the custom
> sources machinery?
>
> This little program:
>
> my $cb = CPANPLUS::Backend->new ;
> my $mod = $cb->module_tree('File::Find') ;
> print "File::Find -> ".$mod->description."\n" ;
> print "CPAN version: ".$mod->version."\n" ;
Here's the _show_Details that implements the -D switch in the cpan(1)
program that comes with Perl. It's as easy as CPANPLUS:
sub _show_Details
{
my $args = shift;
foreach my $arg ( @$args )
{
my $module = CPAN::Shell->expand( "Module", $arg );
my $author = CPAN::Shell->expand( "Author",
$module->userid );
next unless $module->userid;
print "$arg\n", "-" x 73, "\n\t";
print join "\n\t",
$module->description ? $module->description :
"(no description)",
$module->cpan_file,
$module->inst_file,
'Installed: ' . $module->inst_version,
'CPAN: ' . $module->cpan_version . ' ' .
($module->uptodate ? "" : "Not ") . "up
to date",
$author->fullname . " (" . $module->userid .
")",
$author->email;
print "\n\n";
}
}
------------------------------
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 V11 Issue 1182
***************************************