Hello mb92,
I think you answer lies on File::Find. There is a really easy to follow tutorial that practically gives the answer to your question here Beginners guide to File::Find.
The way that I would solve your problem would be something like:
print "Enter a file to look up for: "; my $file = <STDIN>; chomp $file; # Get rid of newline character exit 0 if ($file eq ""); # If empty string, exit. use File::Find; my $dir = # whatever you want the starting directory to be find(\&do_something_with_file, $dir); sub do_something_with_file { #.....count number of lines of the file and simply concatenate the + lines. #.....$numlines[$i++] . each line etc. etc. }
Hope this helps.
In reply to Re: School assignment
by thanos1983
in thread School assignment
by mb92
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |