in reply to Re: Re: Bug with substring return value?
in thread Bug with substring return value?

Ok, here is what I think is happening (according to the examples above):
$y = 42; $x = $y; substr( $string, 2, 6 ) = ''; $result = substr( $string, 2, 6 );
The other ways of writing it, $x = $y = 42; and your example are just shorthand ways.

And perldoc specifically mentions the way when you use a fourth argument instead as an alternative where you can get the replaced values back, unlike the assignment way.


You have moved into a dark place.
It is pitch black. You are likely to be eaten by a grue.

Replies are listed 'Best First'.
RE:(4): Bug with substring return value?
by shotgunefx (Parson) on Apr 13, 2002 at 14:15 UTC
    DOH!
    Apparently when I code 20 hour straight I lose the basic ability to do simple addition. I'm not quite firing on all cylinders today.

    ++Thanks you for the very polite (considering the stupidity of my reply) dope slap.



    -Lee

    "To be civilized is to deny one's nature."