Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie basic help

Status
Not open for further replies.

bluegroper

Technical User
Dec 12, 2002
407
AU
Whats a nicer way to write line 1 of this snippet ?
Code:
my $version = `basename $0`; chomp $version; $version = "$version vx.x";
print "$version\n";
TIA's
 
You can use the standard basename module. It's two lines instead of just one, but it's easy enough to use:
Code:
use File::Basename;
my $version = basename($0) . 'vx.x';
 
Guess I was hoping for a neat one-liner.
But the 2 liner will prolly be more platform independent (eg windoze will work too.)
Thx.
Any others ??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top