in reply to $* is no longer supported

Your code has never worked. It was likely suppose to be
for ($ro_string) { s/^\s*//; s/\s*$//; }

Replies are listed 'Best First'.
Re^2: $* is no longer supported
by JadeNB (Chaplain) on Nov 04, 2009 at 04:47 UTC

    Have I got my rules for scoping wrong, or is that code useless?

    my $ro_string = " I'm surrounded by spaces! "; for ($ro_string) { # alias $_ to $ro_string for this scope s/^\s*//; # strip leading spaces from $_ s/\s*$//; # strip trailing spaces from $_ } # lose $_ when the scope ends print; # nothing!
    At least, that's what I'm getting on Perl 5.8.9.

    UPDATE: True but irrelevant, as pointed out by Your Mother and ikegami.

      You should be printing $ro_string. Due to the aliasing done by for, modifying $_ in the loop also modifies $ro_string.
        Oops. I was seduced by the name $ro_string into thinking that it was read-only. Thanks!
Re^2: $* is no longer supported
by Your Mother (Archbishop) on Nov 04, 2009 at 05:13 UTC

    print; # nothing!

    print $ro_string; # something! :)

    (update: Derrrrrr, meant to respond to JadeNB of course.)

      Derrrrrr, meant to respond to JadeNB of course.
      Well, it's no problem; I responded to ikegami. :-)