Hmmm, I have a challenge (To me at least)...
I need to make a perl program that reads the contentc of a text file and then prints them with a prefix (an incrementing number in front of each line)
This is my code so far
PHP Code:
#!/usr/bin/perl
#
#
$file '/root/perl/food';
open(INFO$file);
@
lines = <INFO>;
close(INFO);
$i 0;
foreach (@
lines)
{
print 
"$i $_";

I got this far with much help, I know I need to make the $i variable increment every line, and I also know that I have to use $i++ to do it, I just dont know where top put it and why..... The file that is stated exists and has lines in it.... If anyone knows this please give me a hint or a tip... If your gonna give me the answer PLEASE explain it first.... Thanks in advance

PS - Im just learning PERL so no wise cracks about the code