[31271] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2516 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 13 09:09:42 2009

Date: Mon, 13 Jul 2009 06:09:05 -0700 (PDT)
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, 13 Jul 2009     Volume: 11 Number: 2516

Today's topics:
        cpan fails to work after machine relocation <josef.moellers@ts.fujitsu.com>
    Re: cpan fails to work after machine relocation <mail@bananas-playground.net>
    Re: cpan fails to work after machine relocation <josef.moellers@ts.fujitsu.com>
    Re: Notationsfrage <cyrus.kriticos@googlemail.com>
        removing paragraphs from text files <alfonso.baldaserra@gmail.com>
    Re: removing paragraphs from text files <tadmc@seesig.invalid>
    Re: removing paragraphs from text files <alfonso.baldaserra@gmail.com>
    Re: removing paragraphs from text files <alfonso.baldaserra@gmail.com>
    Re: removing paragraphs from text files <hjp-usenet2@hjp.at>
        When SRK Became Dr Khan <sonali.chakrobarty123@gmail.com>
        When SRK Became Dr Khan <sonali.chakrobarty123@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 13 Jul 2009 11:20:33 +0200
From: Josef Moellers <josef.moellers@ts.fujitsu.com>
Subject: cpan fails to work after machine relocation
Message-Id: <h3eu91$abm$1@nntp.fujitsu-siemens.com>

Hi,

In oder not to save some time, I decided to do the upgrade of my work 
machine's Linux distro during the weekend at home, rather than at work.
Obviously, I have a different network setup at home (a 172.16.0-subnet 
rather than the subnet at work).
At home, I was able to install several packages from CPAN, however, when 
I tried this here at work, I failed.
I changed the proxy-URLs in /etc/perl/CPAN/config.pm, but "cpan 
Net::IMAP" terminates with an error message (at the end of this message.

I'd be prepared to completely re-configure cpan, but don't know what to 
actually remove to do that. Or ... maybe I just miss something so the 
current setup works?

Josef

Tail of output at the end of "cpan Net::LDAP":

CPAN: LWP::UserAgent loaded ok (v2.036)
CPAN: Time::HiRes loaded ok (v1.86)
Warning: no success downloading 
'/root/.cpan/sources/authors/id/G/GB/GBARR/perl-ldap-0.39.tar.gz.tmp19657'. 
Giving up on it. at /usr/local/share/perl/5.8.8/CPAN/FTP.pm line 837
         CPAN::FTP::hostdlhard('CPAN::FTP', 'ARRAY(0x850abcc)', 
'authors/id/G/GB/GBARR/perl-ldap-0.39.tar.gz', 
'/root/.cpan/sources/authors/id/G/GB/GBARR/perl-ldap-0.39.tar....', 
'HASH(0xcdbea24)') called at /usr/local/share/perl/5.8.8/CPAN/FTP.pm 
line 515
         CPAN::FTP::hostdlxxx('CPAN::FTP', 'dlhard', 'undef', 
'ARRAY(0x850abcc)', 'authors/id/G/GB/GBARR/perl-ldap-0.39.tar.gz', 
'/root/.cpan/sources/authors/id/G/GB/GBARR/perl-ldap-0.39.tar....', 
'HASH(0xcdbea24)') called at /usr/local/share/perl/5.8.8/CPAN/FTP.pm 
line 442
         CPAN::FTP::localize('CPAN::FTP', 
'authors/id/G/GB/GBARR/perl-ldap-0.39.tar.gz', 
'/root/.cpan/sources/authors/id/G/GB/GBARR/perl-ldap-0.39.tar.gz') 
called at /usr/local/share/perl/5.8.8/CPAN/Distribution.pm line 379
 
CPAN::Distribution::get_file_onto_local_disk('CPAN::Distribution=HASH(0xbc2fdc8)') 
called at /usr/local/share/perl/5.8.8/CPAN/Distribution.pm line 343
         CPAN::Distribution::get('CPAN::Distribution=HASH(0xbc2fdc8)') 
called at /usr/local/share/perl/5.8.8/CPAN/Distribution.pm line 1677
         CPAN::Distribution::make('CPAN::Distribution=HASH(0xbc2fdc8)') 
called at /usr/local/share/perl/5.8.8/CPAN/Distribution.pm line 2876
         CPAN::Distribution::test('CPAN::Distribution=HASH(0xbc2fdc8)') 
called at /usr/local/share/perl/5.8.8/CPAN/Distribution.pm line 3266
 
CPAN::Distribution::install('CPAN::Distribution=HASH(0xbc2fdc8)') called 
at /usr/local/share/perl/5.8.8/CPAN/Module.pm line 474
         eval {...} called at /usr/local/share/perl/5.8.8/CPAN/Module.pm 
line 473
         CPAN::Module::rematein('CPAN::Module=HASH(0xb390900)', 
'install') called at /usr/local/share/perl/5.8.8/CPAN/Module.pm line 576
         CPAN::Module::install('CPAN::Module=HASH(0xb390900)') called at 
/usr/local/share/perl/5.8.8/CPAN/Shell.pm line 1755
         CPAN::Shell::rematein('CPAN::Shell', 'install', 'Net::LDAP') 
called at /usr/local/share/perl/5.8.8/CPAN/Shell.pm line 1935
         CPAN::Shell::__ANON__('CPAN::Shell', 'Net::LDAP') called at 
/usr/local/bin/cpan line 319
         main::_default('ARRAY(0x8154390)') called at 
/usr/local/bin/cpan line 278


You have not configured a urllist and do not allow connections to the
internet to get a list of mirrors.  If you wish to get a list of CPAN
mirrors to pick from, use this command

     o conf init connect_to_internet_ok urllist

If you do not wish to get a list of mirrors and would prefer to set
your urllist manually, use just this command instead

     o conf init urllist


-- 
These are my personal views and not those of Fujitsu Technology Solutions!
Josef Möllers (Pinguinpfleger bei FTS)
	If failure had no penalty success would not be a prize (T.  Pratchett)
Company Details: http://de.ts.fujitsu.com/imprint.html


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

Date: Mon, 13 Jul 2009 12:23:36 +0200
From: =?ISO-8859-1?Q?=22j=2Eke=DFler=22?= <mail@bananas-playground.net>
To: Josef Moellers <josef.moellers@ts.fujitsu.com>
Subject: Re: cpan fails to work after machine relocation
Message-Id: <4A5B0B28.2090203@bananas-playground.net>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

Josef Moellers wrote:
> Hi,
> 
> In oder not to save some time, I decided to do the upgrade of my work
> machine's Linux distro during the weekend at home, rather than at work.
> Obviously, I have a different network setup at home (a 172.16.0-subnet
> rather than the subnet at work).
> At home, I was able to install several packages from CPAN, however, when
> I tried this here at work, I failed.
> I changed the proxy-URLs in /etc/perl/CPAN/config.pm, but "cpan
> Net::IMAP" terminates with an error message (at the end of this message.
> 
> I'd be prepared to completely re-configure cpan, but don't know what to
> actually remove to do that. Or ... maybe I just miss something so the
> current setup works?
> 
> Josef
> 
> Tail of output at the end of "cpan Net::LDAP":
> 
> CPAN: LWP::UserAgent loaded ok (v2.036)
> CPAN: Time::HiRes loaded ok (v1.86)
> Warning: no success downloading
> '/root/.cpan/sources/authors/id/G/GB/GBARR/perl-ldap-0.39.tar.gz.tmp19657'.
> Giving up on it. at /usr/local/share/perl/5.8.8/CPAN/FTP.pm line 837
>         CPAN::FTP::hostdlhard('CPAN::FTP', 'ARRAY(0x850abcc)',
> 'authors/id/G/GB/GBARR/perl-ldap-0.39.tar.gz',
> '/root/.cpan/sources/authors/id/G/GB/GBARR/perl-ldap-0.39.tar....',
> 'HASH(0xcdbea24)') called at /usr/local/share/perl/5.8.8/CPAN/FTP.pm
> line 515
>         CPAN::FTP::hostdlxxx('CPAN::FTP', 'dlhard', 'undef',
> 'ARRAY(0x850abcc)', 'authors/id/G/GB/GBARR/perl-ldap-0.39.tar.gz',
> '/root/.cpan/sources/authors/id/G/GB/GBARR/perl-ldap-0.39.tar....',
> 'HASH(0xcdbea24)') called at /usr/local/share/perl/5.8.8/CPAN/FTP.pm
> line 442
>         CPAN::FTP::localize('CPAN::FTP',
> 'authors/id/G/GB/GBARR/perl-ldap-0.39.tar.gz',
> '/root/.cpan/sources/authors/id/G/GB/GBARR/perl-ldap-0.39.tar.gz')
> called at /usr/local/share/perl/5.8.8/CPAN/Distribution.pm line 379
> 
> CPAN::Distribution::get_file_onto_local_disk('CPAN::Distribution=HASH(0xbc2fdc8)')
> called at /usr/local/share/perl/5.8.8/CPAN/Distribution.pm line 343
>         CPAN::Distribution::get('CPAN::Distribution=HASH(0xbc2fdc8)')
> called at /usr/local/share/perl/5.8.8/CPAN/Distribution.pm line 1677
>         CPAN::Distribution::make('CPAN::Distribution=HASH(0xbc2fdc8)')
> called at /usr/local/share/perl/5.8.8/CPAN/Distribution.pm line 2876
>         CPAN::Distribution::test('CPAN::Distribution=HASH(0xbc2fdc8)')
> called at /usr/local/share/perl/5.8.8/CPAN/Distribution.pm line 3266
> 
> CPAN::Distribution::install('CPAN::Distribution=HASH(0xbc2fdc8)') called
> at /usr/local/share/perl/5.8.8/CPAN/Module.pm line 474
>         eval {...} called at /usr/local/share/perl/5.8.8/CPAN/Module.pm
> line 473
>         CPAN::Module::rematein('CPAN::Module=HASH(0xb390900)',
> 'install') called at /usr/local/share/perl/5.8.8/CPAN/Module.pm line 576
>         CPAN::Module::install('CPAN::Module=HASH(0xb390900)') called at
> /usr/local/share/perl/5.8.8/CPAN/Shell.pm line 1755
>         CPAN::Shell::rematein('CPAN::Shell', 'install', 'Net::LDAP')
> called at /usr/local/share/perl/5.8.8/CPAN/Shell.pm line 1935
>         CPAN::Shell::__ANON__('CPAN::Shell', 'Net::LDAP') called at
> /usr/local/bin/cpan line 319
>         main::_default('ARRAY(0x8154390)') called at /usr/local/bin/cpan
> line 278
> 
Hello,

did you tried what comes with the error message ?(below)
> 
> You have not configured a urllist and do not allow connections to the
> internet to get a list of mirrors.  If you wish to get a list of CPAN
> mirrors to pick from, use this command
> 
>     o conf init connect_to_internet_ok urllist
> 
> If you do not wish to get a list of mirrors and would prefer to set
> your urllist manually, use just this command instead
> 
>     o conf init urllist
> 
> 
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)

iEYEARECAAYFAkpbCygACgkQE++2Zdc7EtenDACfUgeUupxsc7ulCxR7PdOLlK02
dqQAoJ0DLNlUVuCPqyF4cAQDgulimpHG
=T3sB
-----END PGP SIGNATURE-----


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

Date: Mon, 13 Jul 2009 14:11:34 +0200
From: Josef Moellers <josef.moellers@ts.fujitsu.com>
Subject: Re: cpan fails to work after machine relocation
Message-Id: <h3f89l$h33$1@nntp.fujitsu-siemens.com>

j.keßler wrote:

>>
> Hello,
> 
> did you tried what comes with the error message ?(below)
>> You have not configured a urllist and do not allow connections to the
>> internet to get a list of mirrors.  If you wish to get a list of CPAN
>> mirrors to pick from, use this command

I noticed this only after I posted the message. Cancelling was probably 
too late. Thing was ... it did work at home!

Josef
-- 
These are my personal views and not those of Fujitsu Technology Solutions!
Josef Möllers (Pinguinpfleger bei FTS)
	If failure had no penalty success would not be a prize (T.  Pratchett)
Company Details: http://de.ts.fujitsu.com/imprint.html


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

Date: Sun, 12 Jul 2009 15:43:01 +0200
From: Cyrus Kriticos <cyrus.kriticos@googlemail.com>
Subject: Re: Notationsfrage
Message-Id: <7bu7j5F24pv3hU1@mid.individual.net>



Christian Kaufhold wrote:
> Cyrus Kriticos <cyrus.kriticos@googlemail.com> wrote:
> 
>> was verbirgt sich hinter der Notation bzw. wofür sind die geschweiften 
>> Klammern?
>>
>> $f = { 'e' => $e };
> 
> perldoc perlref

Ups, falsche Newsgoup.

Danke. Inzw. habe ich das unbekannte Ding als "Referenz auf einen anonymen 
Hash" identifiziert.

-- 
  Grüße  |  Estimator: "Gommste von driebn?"
  Cyrus  |  Tapio: "Gänse fleisch mal den Kofferraum oof moch'n?"
         |  Quelle: Forum des Heise-Newstickers


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

Date: Sun, 12 Jul 2009 22:58:26 -0700 (PDT)
From: alfonsobaldaserra <alfonso.baldaserra@gmail.com>
Subject: removing paragraphs from text files
Message-Id: <e15960a2-02d2-474f-b84a-863eaf3754d2@d36g2000prb.googlegroups.com>

hello,

i have a specific paragraph in a bunch of configuration files that i
want to remove.  the lines are as follows

define service{
        use                             linux-service
        host_name                       ninjasrv
        service_description             PING
        check_command                   check_ping!100.0,20%!500.0,60%
        action_url /nagios/pnp/index.php?host=$HOSTNAME$&srv=
$SERVICEDESC$
        }

the 'use' and 'host_name' directives are different in each file.  the
unique string is 'PING'.

i was just wondering if it is possible to do such thing in Perl?

thanks.


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

Date: Mon, 13 Jul 2009 01:13:23 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: removing paragraphs from text files
Message-Id: <slrnh5ljr7.24o.tadmc@tadmc30.sbcglobal.net>

alfonsobaldaserra <alfonso.baldaserra@gmail.com> wrote:
> hello,
>
> i have a specific paragraph in a bunch of configuration files that i
> want to remove.  the lines are as follows
>
> define service{
>         use                             linux-service
>         host_name                       ninjasrv
>         service_description             PING
>         check_command                   check_ping!100.0,20%!500.0,60%
>         action_url /nagios/pnp/index.php?host=$HOSTNAME$&srv=
> $SERVICEDESC$
>         }
>
> the 'use' and 'host_name' directives are different in each file.  the
> unique string is 'PING'.
>
> i was just wondering if it is possible to do such thing in Perl?


    perl -p0777 -i -e 's/define service\{[^}]*PING[^}]*\}\s+//g' *.cf

you might want to use
   -i.bak
instead of a bare "-i"...


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Sun, 12 Jul 2009 23:32:50 -0700 (PDT)
From: alfonsobaldaserra <alfonso.baldaserra@gmail.com>
Subject: Re: removing paragraphs from text files
Message-Id: <9c5747a1-8187-4850-812a-86ff7740a1e1@l5g2000pra.googlegroups.com>

> =A0 =A0 perl -p0777 -i -e 's/define service\{[^}]*PING[^}]*\}\s+//g' *.cf

that was so amazing, all done in a single shot.  could you please also
help on what exactly is -p0777 and how did this substitution work 's/
define service\{[^}]*PING[^}]*\}\s+//g'.  i have never seen/read such
regex.

thanks again.


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

Date: Mon, 13 Jul 2009 01:52:14 -0700 (PDT)
From: alfonsobaldaserra <alfonso.baldaserra@gmail.com>
Subject: Re: removing paragraphs from text files
Message-Id: <a3abfdaf-8629-4c97-902e-5fbff06165a5@13g2000prl.googlegroups.com>

> help on what exactly is -p0777 and how did this substitution work 's/
> define service\{[^}]*PING[^}]*\}\s+//g'. =A0i have never seen/read such
> regex.

i just found
-0777
    the separator between records is 777 in octal; this is not a real
ASCII char so the whole file is slurped in as a single record;

now my confusion is the regex match.
it goes like, search for
define service followed by a { then any characters but not } then PING
then any characters but not } then atleast one space and replace with
nothing.  i am just wondering what exactly is this [^}]* doing.  i
tried it with .* like

define service\{.*PING.*\}\s+//g
but it would not replace.

my understanding is that it should work because [^}]* (any character
but not }) is same as .* in this case since I know there is no }
before PING string.

what am i missing?


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

Date: Mon, 13 Jul 2009 11:52:24 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: removing paragraphs from text files
Message-Id: <slrnh5m0up.hpv.hjp-usenet2@hrunkner.hjp.at>

On 2009-07-13 08:52, alfonsobaldaserra <alfonso.baldaserra@gmail.com> wrote:
>> how did this substitution work 's/ define
>> service\{[^}]*PING[^}]*\}\s+//g'.  i have never seen/read such regex.
[...]
> now my confusion is the regex match.
> it goes like, search for
> define service followed by a { then any characters but not } then PING
> then any characters but not } then atleast one space and replace with
> nothing.  i am just wondering what exactly is this [^}]* doing.  i
> tried it with .* like
>
> define service\{.*PING.*\}\s+//g
> but it would not replace.
>
> my understanding is that it should work because [^}]* (any character
> but not }) is same as .* in this case since I know there is no }
> before PING string.

/./ is not "any character" but "any character except newline" unless you
use the /s modifier. So your substitution would only work if the whole
section was on a single line.

s/define service\{.*PING.*\}\s+//sg

OTOH would match anything from the first "define service{" to the last
"}" in the file (provided there's a PING somewhere between them) so it
would probably remove a lot more than you want. The /[^}]*/ in Tad's
regex is there to keep the match within a single brace-delimited block
(and it's a bit simple-minded: It won't work if you have a } inside a
comment, for example, but you probably don't, so that doesn't matter).

	hp


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

Date: Mon, 13 Jul 2009 00:27:33 -0700 (PDT)
From: Sona <sonali.chakrobarty123@gmail.com>
Subject: When SRK Became Dr Khan
Message-Id: <0b361eae-800b-4650-afa6-4de871241aec@a37g2000prf.googlegroups.com>

http://www.123bollywood.com/shahrukh-khan/when-srk-became-dr-khan/

 It was an elevating moment for Shah Rukh Khan.


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

Date: Mon, 13 Jul 2009 00:27:55 -0700 (PDT)
From: Sona <sonali.chakrobarty123@gmail.com>
Subject: When SRK Became Dr Khan
Message-Id: <25644ade-fda0-4f73-8178-517bc85ee6ce@12g2000pri.googlegroups.com>

http://www.123bollywood.com/shahrukh-khan/when-srk-became-dr-khan/

 It was an elevating moment for Shah Rukh Khan.


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

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


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