CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [eyebrowsbutt] Reading files from directory and subdirectory: Edit Log



Zhris
Enthusiast

Sep 11, 2012, 1:17 PM


Views: 1699
Re: [eyebrowsbutt] Reading files from directory and subdirectory

Hi,

I haven't tested your code but I immediately notice a couple of issues.

The first thing the subroutine list_recursively does is assign $directory with 'all.fna' regardless. You most likely meant to assign $directory the first argument passed in:

Code
my $directory = 'all.fna';  
my $directory = shift;


I'm pretty certain you don't mean to print the result of $directory divided by $file. Don't forget to wrap in double quotes to ensure the value is interpolated appropriately. Also chuck in \n for readability purposes:

Code
print $directory/$file; 
print "$directory/$file\n";


Finally, not sure if you meant to put an exit at the end of the GC subroutine. There are also 2 closing curly braces afterwards (I am unable to tell if they are both necessary due to the formatting of your code upon post).

Thats a start!

Chris


(This post was edited by Zhris on Sep 11, 2012, 1:26 PM)


Edit Log:
Post edited by Zhris (Enthusiast) on Sep 11, 2012, 1:17 PM
Post edited by Zhris (Enthusiast) on Sep 11, 2012, 1:18 PM
Post edited by Zhris (Enthusiast) on Sep 11, 2012, 1:20 PM
Post edited by Zhris (Enthusiast) on Sep 11, 2012, 1:25 PM
Post edited by Zhris (Enthusiast) on Sep 11, 2012, 1:26 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives