[31979] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3243 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 20 18:09:28 2010

Date: Mon, 20 Dec 2010 15:09:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 20 Dec 2010     Volume: 11 Number: 3243

Today's topics:
        Finding packages with ActiveState <bernie@fantasyfarm.com>
    Re: Finding packages with ActiveState <bernie@fantasyfarm.com>
    Re: Finding packages with ActiveState <brian.raven@osbsl.co.uk>
    Re: Finding packages with ActiveState <sisyphus359@gmail.com>
    Re: Finding packages with ActiveState <bernie@fantasyfarm.com>
    Re: Finding packages with ActiveState <bernie@fantasyfarm.com>
        How do I put apostraphes in this expression? <laredotornado@zipmail.com>
    Re: How do I put apostraphes in this expression? <marc.girod@gmail.com>
    Re: How do I put apostraphes in this expression? <laredotornado@zipmail.com>
    Re: How do I put apostraphes in this expression? <tadmc@seesig.invalid>
    Re: How do I put apostraphes in this expression? <tadmc@seesig.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 19 Dec 2010 18:57:18 -0500
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Finding packages with ActiveState
Message-Id: <0i6tg6t79mom5oork45m5u2pi9h2v40r7t@library.airnews.net>

I'm moving to a new system and I've just installed the latest ActiveState
Perl [5.12] and in order to get several of my existing perl scripts to work
I need several packages that aren't there.  I'm just running PPM "out of
the box" -- is there something I should do to tell it to "look harder" to
find modules?  [the ones I need [at the moment, I'll probably run into more
missing ones as I move more scripts over] are Net::NNTP, Net::SMTP,
Mail::Header, few others.  I need File::Basename, but I only see
File::Basename::Object in the package list???]

Thanks!  /bernie\
-- 
Bernie Cosell                     Fantasy Farm Fibers
bernie@fantasyfarm.com            Pearisburg, VA
    -->  Too many people, too few sheep  <--          


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

Date: Sun, 19 Dec 2010 19:27:34 -0500
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Re: Finding packages with ActiveState
Message-Id: <mh8tg6l4pnmic5rl217udb11bdt9vppuef@library.airnews.net>

Bernie Cosell <bernie@fantasyfarm.com> wrote:

} I'm moving to a new system and I've just installed the latest ActiveState
} Perl [5.12] and in order to get several of my existing perl scripts to work
} I need several packages that aren't there.

As a footnote, I realize that most likely what I'll need to do is add some
repositories to PPM... I looked at the two or three that ActiveState
mentions but I can't tell if one of them is one that'll really "plug the
holes".  Another thing is that I also realize that some of those packages
aren't PPM'ed because they're basically obsolete, and within bounds I guess
I'd be willing to recode some of the scripts to use more-current packages
-- but again, I'm not sure how to pursue that.  is there some way to find
out that "Mail::Header" has been superseded by dunno::what?

Thanks!  /b\

-- 
Bernie Cosell                     Fantasy Farm Fibers
bernie@fantasyfarm.com            Pearisburg, VA
    -->  Too many people, too few sheep  <--          


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

Date: Mon, 20 Dec 2010 10:01:30 +0000
From: Brian Raven <brian.raven@osbsl.co.uk>
Subject: Re: Finding packages with ActiveState
Message-Id: <87aak0pxtx.fsf@osbsl.co.uk>

Bernie Cosell <bernie@fantasyfarm.com> writes:

> I'm moving to a new system and I've just installed the latest ActiveState
> Perl [5.12] and in order to get several of my existing perl scripts to work
> I need several packages that aren't there.  I'm just running PPM "out of
> the box" -- is there something I should do to tell it to "look harder" to
> find modules?  [the ones I need [at the moment, I'll probably run into more
> missing ones as I move more scripts over] are Net::NNTP, Net::SMTP,
> Mail::Header, few others.  I need File::Basename, but I only see
> File::Basename::Object in the package list???]

All of the modules you refer to are present in my Activestate
installation (5.12.2, win32), without the need for ppm. The Net::*
modules are part of the libnet package, anf File::Basename is a core
module. This suggests that there may be something wrong with your
installation. Some simple command line checks should confirm that, like
'perl -v' to check that you are running the version of perl that you
have installed, and 'perl -MFile::Basename -e1' to check that perl can
find the specified module.

HTH

-- 
Brian Raven


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

Date: Mon, 20 Dec 2010 02:49:42 -0800 (PST)
From: sisyphus <sisyphus359@gmail.com>
Subject: Re: Finding packages with ActiveState
Message-Id: <afea2ba5-ece5-43ac-9f03-ee9afb089011@h17g2000pre.googlegroups.com>

On Dec 20, 11:27=A0am, Bernie Cosell <ber...@fantasyfarm.com> wrote:
> Bernie Cosell <ber...@fantasyfarm.com> wrote:
> } I'm moving to a new system and I've just installed the latest ActiveSta=
te
> } Perl [5.12] and in order to get several of my existing perl scripts to =
work
> } I need several packages that aren't there.
>
> As a footnote, I realize that most likely what I'll need to do is add som=
e
> repositories to PPM... I looked at the two or three that ActiveState
> mentions but I can't tell if one of them is one that'll really "plug the
> holes".

Just run 'ppm repo suggest' and then add the ones suggested (unless
they already show up on 'ppm repo list').

ie:
ppm repo add bribes
ppm repo add log4perl
ppm repo add sisyphusion
ppm repo add trouchelle
ppm repo add uwinnipeg
ppm repo add wxperl

Then, if you want to install Some::Module, just run:

ppm install Some::Module

and if a ppm package for Some::Module exists on one of those repos it
will be installed.

If you first want to check which of the repos provides a ppm package
for Some::Module (without actually installing it) just run:

ppm search Some::Module

Cheers,
Rob


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

Date: Mon, 20 Dec 2010 11:30:22 -0500
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Re: Finding packages with ActiveState
Message-Id: <du0vg614av37520tea76qm5c631t8u8iif@library.airnews.net>


Brian Raven <brian.raven@osbsl.co.uk> wrote:

} Bernie Cosell <bernie@fantasyfarm.com> writes:
} 
} > ...  [the ones I need [at the moment, I'll probably run into more
} > missing ones as I move more scripts over] are Net::NNTP, Net::SMTP,
} > Mail::Header, few others.  I need File::Basename, but I only see
} > File::Basename::Object in the package list???]
} 
} All of the modules you refer to are present in my Activestate
} installation (5.12.2, win32), without the need for ppm The Net::*
} modules are part of the libnet package, anf File::Basename is a core
} module. This suggests that there may be something wrong with your
} installation.

Nope, stupid operator error.  I was looking in PPM for the packages loaded,
rather than in the actual docs for the available-packages.  The only one
that seems to be missing is Mail::Header, and I vaguely remember [this from
years ago] that the mail manipulation stuff was redone a long time ago and
that the Mail:: modules really are ancient... looks like Email::Address
will probably do what I needed from Mail::Header.  Thanks for the sanity
check...

  /Bernie\
-- 
Bernie Cosell                     Fantasy Farm Fibers
bernie@fantasyfarm.com            Pearisburg, VA
    -->  Too many people, too few sheep  <--          


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

Date: Mon, 20 Dec 2010 11:31:32 -0500
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Re: Finding packages with ActiveState
Message-Id: <151vg6tqu86rc0h2v5h0rdg6od597e63c5@library.airnews.net>

sisyphus <sisyphus359@gmail.com> wrote:

} On Dec 20, 11:27 am, Bernie Cosell <ber...@fantasyfarm.com> wrote:
} > As a footnote, I realize that most likely what I'll need to do is add some
} > repositories to PPM... I looked at the two or three that ActiveState
} > mentions but I can't tell if one of them is one that'll really "plug the
} > holes".
} 
} Just run 'ppm repo suggest' and then add the ones suggested (unless
} they already show up on 'ppm repo list').
} 
} ie:
} ppm repo add bribes
} ppm repo add log4perl
} ppm repo add sisyphusion
} ppm repo add trouchelle
} ppm repo add uwinnipeg
} ppm repo add wxperl

Cool... I'll do that, although as mentioned in the other folk on this
thread, my actual problem was operator error and not anything to do with
ActiveState...  tnx!  /b\
} 
} Then, if you want to install Some::Module, just run:
} 
} ppm install Some::Module
} 
} and if a ppm package for Some::Module exists on one of those repos it
} will be installed.
} 
} If you first want to check which of the repos provides a ppm package
} for Some::Module (without actually installing it) just run:
} 
} ppm search Some::Module
} 
} Cheers,
} Rob

-- 
Bernie Cosell                     Fantasy Farm Fibers
bernie@fantasyfarm.com            Pearisburg, VA
    -->  Too many people, too few sheep  <--          


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

Date: Mon, 20 Dec 2010 13:37:10 -0800 (PST)
From: laredotornado <laredotornado@zipmail.com>
Subject: How do I put apostraphes in this expression?
Message-Id: <55d176be-8608-48e3-a837-ddee5789d9f1@i18g2000yqn.googlegroups.com>

Hi, I'm using Perl 5.8.9 on Mac 10.6.3.  I regularly run a search and
replace expression from the terminal, but when the replacing
expression contains an apostraphe, the replace doesn't work.
Specifically, I have

perl -pi -e 's/(\d\d\d)/\'$1\'/g' /tmp/output

but this is apparently not the right way to add apostraphes.  What
would be the right way?  Thanks, - Dave


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

Date: Mon, 20 Dec 2010 14:13:33 -0800 (PST)
From: Marc Girod <marc.girod@gmail.com>
Subject: Re: How do I put apostraphes in this expression?
Message-Id: <303bbc4a-5ebe-4e3b-aec4-f0535cbe9375@w17g2000yqh.googlegroups.com>

On Dec 20, 9:37=A0pm, laredotornado <laredotorn...@zipmail.com> wrote:

> but this is apparently not the right way to add apostraphes. =A0What
> would be the right way? =A0Thanks, - Dave

Apostrophes. Or single quotes.
But this is a shell problem more than a Perl problem.

Two solutions come to my mind:

perl -pi -e 'BEGIN{$q=3Dchr(39)}s/(\d\d\d)/$q$1$q/g' /tmp/output
perl -pi -e 's/(\d\d\d)/chr(39) . $1 . chr(39)/eg' /tmp/output

Marc


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

Date: Mon, 20 Dec 2010 14:41:28 -0800 (PST)
From: laredotornado <laredotornado@zipmail.com>
Subject: Re: How do I put apostraphes in this expression?
Message-Id: <db9407ae-062c-4381-8372-a8281ac023e2@v17g2000vbo.googlegroups.com>

On Dec 20, 4:13=A0pm, Marc Girod <marc.gi...@gmail.com> wrote:
> On Dec 20, 9:37=A0pm, laredotornado <laredotorn...@zipmail.com> wrote:
>
> > but this is apparently not the right way to add apostraphes. =A0What
> > would be the right way? =A0Thanks, - Dave
>
> Apostrophes. Or single quotes.
> But this is a shell problem more than a Perl problem.
>
> Two solutions come to my mind:
>
> perl -pi -e 'BEGIN{$q=3Dchr(39)}s/(\d\d\d)/$q$1$q/g' /tmp/output
> perl -pi -e 's/(\d\d\d)/chr(39) . $1 . chr(39)/eg' /tmp/output
>
> Marc

Thanks.  Regarding the first solution, I tried what you suggested and
got a pile of compilation errors.  I'm using bash shell.  Here's the
output ...

davea-mbp2:~ davea$ perl -pi -e 's/BEGIN{$q=3Dchr(39)}s/(.*),(.*)/$q$1$q/
g' /tmp/output
Scalar found where operator expected at -e line 1, near "s/
BEGIN{$q=3Dchr(39)}s/(.*),(.*)/$q"
Scalar found where operator expected at -e line 1, near "$q$1"
	(Missing operator before $1?)
Scalar found where operator expected at -e line 1, near "$1$q"
	(Missing operator before $q?)
syntax error at -e line 1, near "s/BEGIN{$q=3Dchr(39)}s/(.*),(.*)/$q"
Execution of -e aborted due to compilation errors.

Any additional thoughts are appreciated, - Dave


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

Date: Mon, 20 Dec 2010 16:45:35 -0600
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: How do I put apostraphes in this expression?
Message-Id: <slrnigvnro.acq.tadmc@tadbox.sbcglobal.net>

laredotornado <laredotornado@zipmail.com> wrote:

> Subject: Re: How do I put apostraphes in this expression?


The word is spelled "apostrophe".

The character is named a "single quote".


> when the replacing
> expression contains an apostraphe, the replace doesn't work.


That is because perl is not even being run...


> Specifically, I have
>
> perl -pi -e 's/(\d\d\d)/\'$1\'/g' /tmp/output
>
> but this is apparently not the right way to add apostraphes.  What
> would be the right way?


You do not have a Perl problem.

You have a shell problem.

A simple solution is to not use single quote to quote your shell
arguments.

    perl -pi -e "s/(\d\d\d)/'\$1'/g" /tmp/output

Of course, you then need to escape the Perl variables so that
they are not treated as shell variables.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.


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

Date: Mon, 20 Dec 2010 16:50:43 -0600
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: How do I put apostraphes in this expression?
Message-Id: <slrnigvo5b.aes.tadmc@tadbox.sbcglobal.net>

laredotornado <laredotornado@zipmail.com> wrote:
> On Dec 20, 4:13 pm, Marc Girod <marc.gi...@gmail.com> wrote:

>> Two solutions come to my mind:
>>
>> perl -pi -e 'BEGIN{$q=chr(39)}s/(\d\d\d)/$q$1$q/g' /tmp/output
                ^^
                ^^

The first two characters are "BE" here.


> davea-mbp2:~ davea$ perl -pi -e 's/BEGIN{$q=chr(39)}s/(.*),(.*)/$q$1$q/
                                   ^^
                                   ^^

The first two characters are "s/" here.


> Any additional thoughts are appreciated, - Dave


You should copy/paste code rather than (attempt to) retype it.

Have you seen the Posting Guidelines that are posted here frequently?


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.


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

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:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#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 3243
***************************************


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