Description of problem: WORKS #!/usr/bin/perl open(RPMS, "ls /home/tomi/*.rpm |"); @packages = []; for ($i = 0; $line = <RPMS>; $i++) { chop($line); @packages[$i] = $line; } close(RPMS); print @packages; ----------------------------------------- ONLY NEW LINES IN OUTPUT #!/usr/bin/perl open(RPMS, "ls /home/tomi/*.rpm |"); @packages = []; for ($i = 0; $line = <RPMS>; $i++) { @packages[$i] = chop($line);; } close(RPMS); print @packages; Version-Release number of selected component (if applicable): perl-5.8.0-88.4 How reproducible: Always Steps to Reproduce: Example code Actual Results: Only new lines in output Expected Results: Should have file list.
According to what I understand about how chop works, that is expected behavior. http://www.rocketaware.com/perl/perlfunc/chop.htm says that it "chops off the last character of a string and returns the character chopped". Therefore, I am closing this as not a bug. If I have misunderstood the problem, or you still believe this is incorrect behavior, please reopen with additional information.