SPUG: geting the perl version

Bill Campbell bill at celestial.com
Wed Jan 25 10:48:30 PST 2006

On Wed, Jan 25, 2006, Atom Powers 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.

If you're doing this from the shell, this should set a shell
variable, version:

eval `perl -V:version`

INTERNET:   bill at Celestial.COM  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676

``Unix is simple. It just takes a genius to understand its simplicity'' --
    Dennis Ritchie

More information about the spug-list mailing list