Community backlog for Perl
Expert validation
It is extremely valuable to curate the Perl contents. Would you like to review these implementations?
If they can be improved, please help yourself. If you know a better way, please create a distinct entry. If they're broken, please flag them.
🗘
Idiom #319 Generator functionWrite a function g that behaves like an iterator. |
||
|
|
|
|
Idiom #131 Successive conditionsExecute f1 if condition c1 is true, or else f2 if condition c2 is true, or else f3 if condition c3 is true. |
||
|
|
|
|
Idiom #186 Exit program cleanlyExit a program, indicating no error to the OS |
||
|
|
|
|
For many more Perl snippets to curate, see the full list.
Docs & demos
🗘
Idiom #33 Atomically read and update variableAssign to the variable x the new value f(x), making sure that no other thread may modify x between the read and the write. |
||
|
|
|
|
Idiom #179 Get center of a rectangleReturn the center c of the rectangle with coördinates(x1,y1,x2,y2) |
||
|
|
|
|
Idiom #70 Use clock as random generator seedGet the current datetime and provide it as a seed to a random generator. The generator sequence will be different at each run. |
||
|
|
|
|
75% of the Perl snippets don't have a runnable demo yet.
For example, these implementations would need a demo URL:
Idiom #159 TrieDefine a Trie data structure, where entries have an associated value. |
||
|
|
|
|
Idiom #312 Test for list equalitySet b to true if the lists p and q have the same size and the same elements, false otherwise. |
||
|
|
|
|
Idiom #246 Count distinct elementsSet c to the number of distinct elements in the list items. |
||
|
|
|
|
Missing implementations
🗘A Perl implementation is missing for 38 idioms out of 372 idioms.
You may help by writing a Perl snippet for these idioms:
|
|
Idiom #358 Format a value in unit notationCreate the end-user text, s, specifying the value a, in units of x. |
|
|
Idiom #365 Convert an angle to a directionConvert a degree, x, of 360, to a Compass direction, y. |
|
|
Idiom #368 Parse a millisecond valueParse the millisecond value a, to a collection of duration values, m. |