in reply to Re^3: Regex match on implicit default variable ($_) in a script, not a one liner
in thread Regex match on implicit default variable ($_) in a script, not a one liner
</quote>You aren't aware of what the switches on your one-liner are doing for you. See perlrun
The -n is the most important one. It applies a while(<>) { ... } loop around your code.
</quote>
You are correct. I am confused as all get out. I think what is getting me the worst is all the short hand and defaults. For instance, is "<>" short hand for "<STDIN>"?.
What would really help me is if you would rewrite
for me with "-we" in place of "-wple" with all the short hand and defaults removed so I could see exactly what is going on. (You would be my hero as I have asked this elsewhere and have not understood it there either. Mostly very helpful folks show me a better way to write it in a full script. And although greatly appreciated, it does not help me understand exactly what is happening in the "-wple" one liner or how to duplicate it in a full script.)
Many thanks, -T
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Regex match on implicit default variable ($_) in a script, not a one liner
by shmem (Chancellor) on Oct 24, 2015 at 21:42 UTC | |
|
Re^5: Regex match on implicit default variable ($_) in a script, not a one liner
by AppleFritter (Vicar) on Oct 24, 2015 at 20:30 UTC | |
by Todd Chester (Scribe) on Oct 24, 2015 at 23:07 UTC | |
by AppleFritter (Vicar) on Oct 25, 2015 at 00:09 UTC |