in reply to Re^2: Editing just one column in a file
in thread Editing just one column in a file
Because the Perl syntax for an array slice is @a[ ... ].
If you enable warnings, you'll see that by using $a[1..3], the 1..3 is treated as a flip-flop operator comparing against $., and under most circumstances will produce false, which in the numeric context gets taken as 0:
c:\test>perl -wE"@a = 0..10; say $a[1..3]; say @a[1..3]" Use of uninitialized value in range (or flip) at -e line 1. Argument "" isn't numeric in array element at -e line 1. 0 123
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Editing just one column in a file
by ZWcarp (Beadle) on Nov 30, 2011 at 20:23 UTC | |
by BrowserUk (Patriarch) on Nov 30, 2011 at 21:12 UTC | |
Re^4: Editing just one column in a file
by vinian (Beadle) on Nov 29, 2011 at 09:00 UTC | |
by choroba (Cardinal) on Nov 29, 2011 at 10:13 UTC | |
by Tux (Canon) on Dec 01, 2011 at 07:35 UTC | |
by vinian (Beadle) on Dec 02, 2011 at 07:40 UTC |
In Section
Seekers of Perl Wisdom