'here-document is a very handy Perl operator that allows to easily define multiline strings. Unfortunately, most of the times, the inclusion of a here-document string breaks the indentation level of the source code like in this example:

In list context both operators behave in the same way, returning a list of values counting from the left value to the right value (it even works on strings).

They're very useful for creating loops, slicing arrays, etc.

Example:

printf "Line %d\n", ++$i foreach ( 1 .. 10 );

In scalar context, they emulate the behaviour of the line range operator of sed.
To do this, the operator returns a boolean value, and this value is maintained across the duration of the routine that has the operator.