Stories
Slash Boxes
Comments
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.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • by Ovid (2709) on 2009.08.01 12:08 (#69841) Homepage Journal

    Welcome aboard!

    I love what you've written here. When you talk about the assignment operators, it reminds me of one operator I love, but don't mention often.

    $id &&= qq{id="$id"};

    Basically, that's a handy shortcut for rewriting a string on the fly, but only if it has a true value. Otherwise, you have to do something like this in other languages:

    if (id) {
      id = "id=\"" + id + "\"";
    }

    It's a silly thing, I know, but there are so many useful constructs like this in Perl that once you get to know them, it can really reduce verbosity and increase comprehension as a result.