in reply to Re^2: How many defaults of $/ does perl have?
in thread How many defaults of $/ does perl have?
... to start bettering my understanding.
If you have access to multiple platforms, a little experimentation can afford insight. Something like Data::Dump::dd can also be helpful. The following is on my Windoze 7 laptop:
Update: In the spirit of making sure that what one posts is true, clear and helpful, I thought I'd test my example code with $/ = "\r\n". The whole idea of the example was that you'd be able to see a difference between "\n" and "\r\n". Not so. Easy to see why when you think about it. I'll have to think of a better example!
(But at least dd does not mislead.)c:\@Work\Perl\monks>perl -wMstrict -MData::Dump -le "print qq{'wx$/yz'}; dd $/; ;; $/ = qq{\r\n}; print qq{'wx$/yz'}; dd $/; " 'wx yz' "\n" 'wx yz' "\r\n"
Give a man a fish: <%-{-{-{-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How many defaults of $/ does perl have?
by stevieb (Canon) on Sep 19, 2015 at 00:29 UTC |