>     #!/usr/bin/perl -w
> 
>     use strict;

means you can't just go introducing names
willy nilly without telling perl where they come
from.

which in turn means...

>     while (<>) {
> 
>         @fields = split /    */;

you can't do this!. oops. should be

          my @fields = split /    */;

>         for (my $i = -1; $i > -9; --$i) {
> 
>             print $fields[$i] . "\n";
> 
>         }
> 
> }

> Q IS this what you want me to change it to
>    
>     for (my $i = 0; $i > -3; $i > -7) {

Nope. This form of a for loop works like this:

    for (start; test; change) {

        do something

    }

where 'start' tells perl the starting arrangement,
'test' is something perl tests each time it is at
the top of the loop, and 'change' is something
perl will do each time it reaches the bottom of
the loop. The 'change' bit had better change
something otherwise the loop will just go on
repeatedly doing the same thing.

So, the $i > -7 bit doesn't make sense because
it isn't going to change anything.

The loop I had written was going to start at index
position -1, which means the last element of an
array, then step backwards through the next 7
previous elements. I thought that was the address.

You need something more like:

    print $fields[0] . "\n";
    print $fields[3] . "\n";
    for (my $i = -3; $i > -7; --$i) {
        print $fields[$i] . "\n";
    }

> PS. not able to get access to the manpage.

That's like saying, you still can't get access to "the software".

What manpage? On what operating system?

Reply via email to