Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I searched CPAN, Googled, and looked here but found no answers. Could someone explain what these bits of code (from MJD QOTW) do? (<at> and is)
my <at> rows = split /\n/, $_; my $x = pop <at> rows; is(scalar( <at> $result), $n_courses, "test $.: one room per course");

Replies are listed 'Best First'.
Re: New functions?
by Roy Johnson (Monsignor) on Jun 01, 2004 at 20:58 UTC
    <at> is someone spelling out the @ sigil. is is one of the functions from the Test::More module.

    The PerlMonk tr/// Advocate
Re: New functions?
by gjb (Vicar) on Jun 01, 2004 at 21:00 UTC

    <at> is most probably @ :)

    is is part of the Test::More module and check equality in a sensible way. Used in test code.

    Hope this helps, -gjb-

Re: New functions?
by CountZero (Bishop) on Jun 01, 2004 at 21:03 UTC
    <at> is really "@". I saw it too in MJD's-mail. It is probably an artefact of not being able to use "@" in some mail messages

    my  @rows = split /\n/, $_;

    Split what is found in the magic variable $_ on linefeed into the array @rows.

    my $x = pop  @rows;

    "pop" the top element of the array @rows into scalar variable $x

    is(scalar( @$result), $n_courses, "test $.: one room per course");

    "is" is a function in the Test::More module (to build an automated test suite). It checks if the value of scalar( @$result) is equal to $n_courses.

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

      More likely it's an overzealous attempt at obfuscating email addresses in a web mail archive.

        Then it must probably be some "automated obfuscator" as the "@" here is not used in e-mail addresses and the s/@/ <at> / was blindly applied.

        Surely another victim of the anti-spam overkill. Sometimes you wonder whether the cure is worse than the illness.

        CountZero

        "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law