> What is wrong? Isn't any command from vi able to be done in sed, just
> take
> out the leading :1,$ ?
That is not my understanding. Regex syntax was different in the many
different tools.
/Michael Turner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional co
OK, here is a "real" beginners question, but interesting nonetheless:
Sample code:
$b = 1;
$b = $b++;
Result:
$b = 1
Which strikes me as a little surprising. Shouldn't the result be 2? What
is happening?
If you respond, please CC me. Many TIA
/Michael Turner
--
To unsu
or '$b = 1; $b = $b + 1', you'll get more expected
> behaviour. :)
>
> - Chris.
> --
>
Thanks for the response, Chris,
but check this out:
$b=1;
$b = ++$b;
result: 2
So, that isn't the whole story. This has to do with pre- & post
"timing", I
hank them each), they haven't resolved my confusion.
It seems that '$b = $b++;' is always a coding mistake. Nobody should use
that syntax on purpose, apparently, because it ignores the 'side effect'
auto-increment. Is this true? I'll try to write my questions better in
> $ perl -Dt -le '$b=$b++'
>
> EXECUTING...
>
> (-e:0) enter
> (-e:0) nextstate
> (-e:1) gvsv(main::b)
> (-e:1) postinc
> (-e:1) gvsv(main::b)
> (-e:1) sassign
> (-e:1) leave
>
> What I think this means is, "Take the current value of $b, save it as
> the result of the expression. Incremen
>> $b = $b++;
> The simple answer is *DON'T DO THAT*. :-)
> John
> --
> use Perl;
> program
> fulfillment
Ok, :-) but I suggest that when 'use warnings' is true, this
construction should be warned. It fails silently.
Thanks to everyone.
/Michael
--
To unsubscribe, e-mail: [EMAIL PROTECTE