>The UNIX shebang #!/usr/bin/perl is pointless.
not in this case...my instructor runs all of the class' scripts on a
Linux box so we need to add it.
>
>readdir will list all items in the directory including directories
>and the Icon\r; you want only text files, so build a list using -T
>and excluding Icon\r.
That's a good idea....I'll be getting there after I get the basic
functionality works.
>
>Your $file_list[$openme] gives only the name of the file and not the pathname.
for this assignment (our fourth in an intro class) that's all the
instructor asked for...but I might just add something like this...as
long as I can figure out how it works so I'd be able to write it
again on my own :)
Many thanks!
CTP
>
>
>
> #!perl -w
> $dir = $ENV{MACPERL};
> opendir (DIR, $dir) || die $!;
> @all = readdir DIR;
> foreach(@all) {
> -T and !/Icon\n/ and push @flist, $_
> }
> $i = 1;
> foreach(@flist){
> print "$i - $_$/";
> $i++
> }
> print "$/Type a number: ";
> chomp ($n = <STDIN>);
> print $/;
> open (F , "$dir$flist[$n-1]");
> print while (<F>);
>
>JD