in reply to Scope of $/
This code avoids "Action at a distance", by making wierd settings in as limited a scope as possible.{ # Add an enclosing block local $/= "\n\n\n"; while(<>){ local $/="\n"; # Reset to normal behaviour inside loop only my ($filename)=/^(\S+)/; my $text=reader::firstline($filename); } } # End enclosing block.
This is not an optical illusion, it just looks like one.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Scope of $/
by BillKSmith (Monsignor) on May 26, 2016 at 13:29 UTC | |
by NetWallah (Canon) on May 26, 2016 at 13:48 UTC | |
|
Re^2: Scope of $/
by Anonymous Monk on May 26, 2016 at 01:23 UTC | |
by Marshall (Canon) on May 26, 2016 at 01:38 UTC | |
by Anonymous Monk on May 26, 2016 at 01:52 UTC | |
by Marshall (Canon) on May 26, 2016 at 01:55 UTC | |
by NetWallah (Canon) on May 26, 2016 at 05:51 UTC | |
|