Let's speculate on a context that might help make sense of this snippet:
#!/usr/bin/perl -w use strict; # List all non-common words in a block of text my %stopwords = (a => 1, an => 1, in => 1, the => 1); my %D2; while ( <DATA> ) { @D2{ map { my $l = lc; exists $stopwords{$l} ? () : $l } split /\W+/ } = (); } print "$_\n" for sort keys %D2; __DATA__ This is a demo of an interesting example in the post from PerlMonks.
Prints:
demo
example
from
interesting
is
of
perlmonks
post
this

In answer to your specific question,

    exists $stopwords{$l}?():$l

uses the ? : trinary operator to say: If $l exists in the %stopwords hash return nothing (specifically, a null list), otherwise return $l itself. (Note that it is dollar-el, not dollar-one.)

Considering my imagined context for this snippet, we have a list of common (uninteresting) words commonly called stopwords. These we want to ignore. So we read through the file (I used the DATA filehandle) a line at a time. For each line we split out the words, force each one to lowercase, drop the stopwords, and then use the others to specify a hash slice on the hash called %D2. Every key in that slice (whether new or pre-existing at that point) is set to an empty value (I'm skipping over some nuances here). When we have finished with all the data, the %D2 hash contains an entry for every "interesting" word in the data set (ignoring duplicates).

Update: Trying to stay focused on the stated problem, I avoided the issue of the variable name $l (dollar-ell). Nkuvu is correct to point this out.

I would also add that this code will return odd results for text containing words with apostrophes or hyphens: "isn't" and "good-by" will be reported as: "isn", "t", "good", "by".

So this code is not recommended for Real Text in a situation where accuracy of results matters.

------------------------------------------------------------
"Perl is a mess and that's good because the
problem space is also a mess.
" - Larry Wall


In reply to Re: questions by dvergin
in thread What does ?():$l mean? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.