SPUG: geting the perl version

Colin Meyer cmeyer at helvella.org
Wed Jan 25 10:37:27 PST 2006


On Wed, Jan 25, 2006 at 10:35:00AM -0800, jerry gay wrote:
> On 1/25/06, Atom Powers <atom.powers at gmail.com> wrote:
> >
> > I want to do this: `/usr/bin/perl -V:version | /usr/bin/cut -d "'" -f
> > 2` without using pipes or quotes; is that possible? (for some reason
> > my application isn't executing this correctly)
> >
> > That is; I am looking for a simple way to get just the version number
> > wihout any padding. Something like "5.8.7" or "5.0.6" or whatever.
> 
> 
> 
> maybe this will help:
>   perl -MConfig -e"print $Config{version}"

Most shells interpolate $variables within double quotes, so this
may work better for you:

  perl -MConfig -le'print $Config{version}'

-Colin.


More information about the spug-list mailing list