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.
  • Is this the perl-ish way to pass arguments by-value rather than by-alias?
    • Bingo! I needed to delete select pairs of items from an import list, but I couldn't do this:

      # we don't simply splice out because we're iterating by index
      @_[ $i, $i + 1 ] = (undef, undef) if $some_condition;
      # and later
      @_ = grep { defined } @_;

      The array slice assignment gave me a "modification of read-only value" error, hence the @_ = @_; statement.

      It all feels rather clumsy, but it works.