I know I could use the filehandle but I am trying to understand why I cannot use the array and print each element at the time.
#!/usr/bin/perl use strict; use Fcntl;
$/ = "\n\n"; sysopen(readFile, "cnnArticle.txt", O_RDONLY) || die $!; sysopen(writeFile, "fortuneCookie.txt", O_WRONLY|O_CREAT) || die $1;
my @articleArray = <readFile>;
while(<@articleArray>) { print $_; }
Slurping an entire file into an array is not a good idea... at any rate, you don't need the angle brackets around the array if you are going to loop through it, just use the array as you normally would.
But again, I recommend looping through the filehandle instead with angle brackets, it'll give you better control over your data.
-- Brett http://www.chapelperilous.net/ ------------------------------------------------------------------------ Many pages make a thick book, except for pocket Bibles which are on very very thin paper.
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]