Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Do you have a list of things that you find odd about Perl? I'm not talking about what you don't like, but things that just don't seem to fit in, as if they were exceptions to normal Perl thinking.

Since Perl draws from so many other things, it's going to be a mish-mash of things. Perl can't very well help that libc functions do things a certain ways, or that it wanted to bridge a couple of languages. Still, there are things that make we wonder. What makes you think "Huh?" Here's three of mine:

-M, -A, and -C units

The -M, -A, and -C file test operators return the file modification, access, and creation times in days since the start of the program. Why? Why why why? Does anyone actually use the values for anything other than to compare them to each other?

mkdir() and rmdir()

The libc mkdir(), chmod(), chown(), rmdir(), and unlink() functions take the file name first, and so do Perl's mkdir() and rmdir(). However, the Perl versions of the other functions take lists of files to affect. Perl's mkdir() and rmdir() doesn't. I always want to put the directory names second in mkdir().

int mkdir(const char *path, mode_t mode); int rmdir(const char *path); int chmod(const char *path, mode_t mode); int chown(const char *path, uid_t owner, gid_t group); int unlink(const char *path);

The Perl chown() and chmod() functions take the file names last, which is a good thing so they can affect a lot of files. To me, mkdir() breaks the rule because it's the only thing that doesn't take a list of names.

print FH @list

You don't put a comma between the filehandle name and the list you give to print. I've just always thought that was odd, and I go out of my way to point it out to people in Perl classes. I don't have a problem with this while I code, but I still think it's an odd corner of syntax.

brian d foy <>

In reply to Perl oddities by brian_d_foy

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others making s'mores by the fire in the courtyard of the Monastery: (8)
    As of 2019-12-06 12:34 GMT
    Find Nodes?
      Voting Booth?
      Strict and warnings: which comes first?

      Results (155 votes). Check out past polls.