Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • same problem (Score:2, Informative)

    I struggled with the same thing today. Then I looked it up in the Cookbook, and it said:

    "An array slice is exactly the same as a list of individual array elements. Because you can't take a reference to a list, you can't take a reference to an array slice".

    • I knew the answer would be there - I just didn't have it with me at work today. It's one of those things where it looks so right (but just doesn't work the way you expect).
    • Now if you want some serious brain hurting, try this :

      perl -le '$x="abcdef";$y=\substr $x,2,2;$$y="gh";print $x'

      (warning ! this behaviour is not documented ! use at your own risk !)