[Dresden-pm] Zeile n bis m anzeigen?

A. Pagaltzis pagaltzis at gmx.de
Fre Jan 27 14:06:10 PST 2006


* Steffen Schwigon <schwigon at webit.de> [2006-01-27 23:00]:
>"A. Pagaltzis" <pagaltzis at gmx.de> writes:
>>    perl -ne'print if $n .. $m' somefile
>
>Ah, danke, das war knapp. Sehr elegant.
>
>Obwohl ich nicht verstehe, warum das geht. Wird irgendwo
>implizit das $. (siehe Sörens Mail) verwendet?

Ja. Cf. `perldoc perlop`:

    If either operand of scalar ".." is a constant expression,
    that operand is considered true if it is equal ("==") to the
    current input line number (the $. variable).

Gruss,
-- 
Aristoteles Pagaltzis // <http://plasmasturm.org/>