in reply to Re: How to perform single operation to each line in file
in thread How to perform single operation to each line in file

$/ to read whole record and foreach is to read every line
  • Comment on Re^2: How to perform single operation to each line in file

Replies are listed 'Best First'.
Re^3: How to perform single operation to each line in file
by choroba (Cardinal) on Jan 21, 2014 at 12:21 UTC
    $/ tells readline or <> to read the whole file. foreach does not read anything, it just iterates a list. You give it a one member list: it contains the whole file as its only member.
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re^3: How to perform single operation to each line in file
by Corion (Patriarch) on Jan 21, 2014 at 12:16 UTC

    Why don't you just read the file line-by-line?