The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
perl -write values in a file to @array in perl meghana Shell Programming and Scripting 12 07-17-2008 01:38 PM
PERL array spacing Jamison Shell Programming and Scripting 3 07-17-2008 01:10 AM
split to array in perl jaganadh Shell Programming and Scripting 3 07-06-2007 02:29 AM
hash,array and perl new2ss Shell Programming and Scripting 3 05-23-2007 08:30 AM
appending to perl array vivekshankar UNIX for Dummies Questions & Answers 7 06-03-2006 07:33 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #8  
Old 02-04-2008
Registered User
 

Join Date: Jan 2008
Posts: 328
glob returns a list so you can use an array slice to get just the last element in one operation:

my $last = (glob("file*"))[-1];
print $last;
Reply With Quote
Google The UNIX and Linux Forums
Forum Sponsor
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:00 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0