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.
  • Just like that one text editor...

    I often use an idiom that I try to fetch an item, and if successful I want to do something with it; if not successful, the code returns undef (false). Typically, the code goes something like this:

    if(my $item = get_item(@params)) {
        # do something with $item
        print $item->{text};
    }

    but this text editor complains about it, stating, in a dialog box:

    a single = in a conditional is usually a typo, use == or eq to compare.
    Do you want to continue?

    every.