Firstly, I don't like the idea of overloading join as reduce. They're two quite different functions. But others have already told this, so I'll also show something else.
As I see, the builtin functions of perl are almost frozen and almost no change has been done on them till 5.004.
-
There's been a general rework of open (three-arg open and vvarious other extensions).
Apart from that, the only ones I know of are implications of how builtin data-types have changed:
- delete and exists now work on arrays,
- hash functions respect restricted hashes,
- file functions work on lexical handles and autovivify them,
- string functions (including pack and unpack) work on both character and byte strings depending on the utf8 flag,
- binmode and open now accepts perlio layers,
- my and sub accepts attributes.
To back up my statement, I've compared the perlfunc of perl 5.004 and 5.8.8, and here are the other significant changes of semantics I've found.
-
The argument of close is optional and defaults to the selected handle.
- The argument of cos, eval is optional and defaults to $_ (or this got documented because sin was already like this, I don't know).
- The argument of dump is optional and I don't care what it defaults to.
- Exec now accepts an indirect argument to tell which program to run, if not $ARGV[0].
- The argument of localtime is optional and defaults to time (so that's why I see localtime(time()) so often).
- Lock is made a new builtin function.
- The second argument of mkdir is optional and defaults to 0777.
- No now accepts a version (with or without a module; use did this already).
- Our is a new builtin function.
- Pack and unpack accepts some new templates: parenthesis, q Q j J F D, bracketed repeat counts, exclamation mark, x!.
- The argument of package can be omitted but this feature is depreceated.
- Prototype works for builtin functions.
- Qr precompiled regular expression quoting is introduced.
- Sort accepts a ($$) subroutine instead of implicitly passing values in $a and $b.
- You can now call splice with only one arguments, when it would remove all elements (no-one knows this, so this is a nice obfu-feature).
- Sprintf supports a new %b conversio to output an integer in binary, the v flag, the ll flag.
- Substr accepts a fourth argument as a replacement.
- Sysread accepts a fourth argument to specify an offset within the string (this is useful).
- You can omit the length from syswrite, which now deafults to the length of the scalar.
Of course, I could have easily skimmed over some other difference.
Update: listified changes. This way it seems much more.
Update: see also Builtin functions defaulting to $_
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.