in reply to Re: (MeowChow) Re2: When does $_ get used?
in thread When does $_ get used?
As a sidenote, you can also do something like:
What that does is require that all the input be done, then release the output. This is unlike while (<>), which will pass its value through to the loop immediately. The difference is because foreach needs to know when it ends, while while doesn't care and will keep going until it's given a false value.foreach (<>) { # Do something with $line here... }
|
|---|