in reply to Regexp help
Not answering your question but your use of local $/ = undef; is not particularly local as you have not confined its effect to a logical block of code. Rather, you have changed the value from that point forward in the script. It is better to restrict the localization to where it is required so as to avoid collateral damage further down the script where line by line input might be required.
You could employ a bare block
my $string; { local $/; $string = <DATA>; }
Or, perhaps better, a do block
my $string = do { local $/; <DATA>; };
I hope this is of interest.
Update: Corrected missing semi-colon, thanks AnomalousMonk.
Cheers,
JohnGG
|
|---|