Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old September 12th, 2000, 11:06 AM
Woop Woop is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Milton Keynes, Bucks, England
Posts: 4 Woop User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I was hoping I could use a command like

$onefile = 'ls -l $names[$loop]';

where $names[$loop] holds the name of a file

It does not work though. Obviously what I am trying to do is get a listing for a single file.

Anyone tell me why the above line does not work or an alternative method.

Thanks

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

Reply With Quote
  #2  
Old September 12th, 2000, 06:26 PM
steve100 steve100 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: ca, usa
Posts: 10 steve100 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
my @files = ('file1', 'file2', 'etc');

foreach my $file (@files) {
my $onefile = `ls -l $file`;
}

(i'm assuming your problems was interpolation of the array elemenent and not single quotes vs. tick ( ' vs. ` )

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > listing with variables


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway