in reply to Re: why does typo work?
in thread why does typo work?

Lots of great info in such a short time! Thanks a lot. Using range operator made it all easy. But, I'm not exactly sure why it works.( "..0") Could you explain what it's doing, please ?

Replies are listed 'Best First'.
Re^3: why does typo work?
by Anonymous Monk on Jan 04, 2015 at 18:34 UTC
    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"

    Since the line number is never 0, it prints until the end of file. This is a bit too obsure, IMO, i'd do it like that:

    if ( ($payperiod =~ /$start_day/) .. eof ) { ... }
    (parens also added for clarity)