P
perler wannabe
Hi,
Why my script doesn't reverse my input?
#!/usr/bin/perl -w
@lines=<STDIN>;
@backwardlines=reverse @lines;
print @backwardlines;
This script print the same thing as my keyboard input.
So if I input:
beginning perl
the output will be:
beginning perl
I am expecting the following output though:
perl beginning
Am I missing something?
Thanks
Why my script doesn't reverse my input?
#!/usr/bin/perl -w
@lines=<STDIN>;
@backwardlines=reverse @lines;
print @backwardlines;
This script print the same thing as my keyboard input.
So if I input:
beginning perl
the output will be:
beginning perl
I am expecting the following output though:
perl beginning
Am I missing something?
Thanks