1. Shlomi Fish
  2. perl-begin


perl-begin / DONE.txt

Shlomi Fish e431008 

Shlomi Fish 102321a 

Shlomi Fish e431008 

Shlomi Fish 102321a 
Shlomi Fish 2b7d364 

Shlomi Fish b6c1080 

* Create a macro for a link to a CPAN distribution
(http://search.cpan.org/dist/MyDist-Here/), a self link (with MyDist-Here as
the contents), and a perldoc?MyModule::Here link.

* Put the TODO and DONE on the web-site so people will be able to view
them and contribute.

* Page about Bad Elements:
    - discuss commenting.
    - accessing object slots directly
        - use accessors.
    - Reference the sources the advice was taken from and further reference:
        - Perl Best Practices
        - The Ancient Perl pages on the Perl 5 Wiki.
        - chromatic's Modern Perl book.
        - advice given by people on Freenode's #perl and on the Perl beginners
    - ^ and $ in regexes.
        - ambiguous.
        - better use \A and \z to mean start-of-string and end-of-string.
        - with /m can be used for start-of-line / end-of-line.
        mailing list.
    - refactoring:
        - magic numbers.
    - string variables interpolated by themselves - "$myvar".

* Add Perl-Monks to more relevant pages.

* Add a page explaining about Perl 6.
    - New language.
        - Not compatible
    - Is it still Perl?
    - Perl 5 and CPAN derive inspiration from it.
    - This site focuses on Perl 5.

* Add a page about E-mail-handling.

* Add a page about optimizing / profiling / etc.

* OO Programming Section:
    - maybe add the list of OO modules I composed.
        - rejected because they will only be confusing.

* Fix the site-resources/ Web Forum detail.

* Add a page about ssh/telnet.

* Update the uses/ and topics/ pages with the sub-pages.

* Credit tm604 about the CSS style tip.

* Typo in src/links/index.html.wml - "Perlin".

* Page about Bad Elements:
    - Array element: @array[$idx] instead of $array[$idx].
    - using $a and $b as variable names.
    - last/next/redo/etc. without explicit LABELs.
    - Add a note about using $ARGV[0] and $ARGV[1].
    - abuse of $#array (like $#array + 1 for array length).
    - $array[$#array] instead of $array[-1]
    - Accessing the last element using $array[$#array] - use $array[-1]
    - interpolating strings directly into regex.
        - either comment that you want to inject a sub-regex or use \Q and \E.
    - don't overuse $_ - it's prune to errors.
    - Mixing tabs and spaces.
    - qx/`....` instead of system().
        - also open.
    - Always add an explicit return from the subroutine.
        - <<return 0;>> instead of <<return;>>
    - varvarname - using a variable as a different variable's name.
    - leading underscores ("_") for non-API methods and functions.
    - print {$fh} @args instead of "print $fh @args" which is too easy to miss.
    - STDIN instead of ARGV.
    - modifying an array/hash while iterating over it.
    - comments and identifiers in a foreign language.
    - avoid using perlform - use Perl6::Form instead (also see the text
    generation page).
    - C-style for loops.
        - rejected because it is a PBP-recommendation that we do not necessarily
        accept. They are shorter than the eqvuivalent while...continue loops.
    - http://www.stonehenge.com/merlyn/UnixReview/col52.html
        - $object->new() to create a new instance.
    - Law of Demeter
    - EEK
        - pass items from one subroutine to another.
            - use objects.
            - assign them to slots.
    - refactoring:
        - long functions and methods.
        - duplicate code.
    - using map instead of for/foreach/while (each) for its side-effects.
    - using grep instead of first/any/all/etc or a hash lookup.

* Link to Perl/Qt once it's ready.

* Revamp the Testimonials on the pages.
    - What about it?

* Link to Fomberg's Hebrew with Perl site.
    - linked from the Perl 5 Wiki "Hebrew" Page:
        - https://www.socialtext.net/perl5/index.cgi?hebrew
        - It didn't belong anywhere on the site.

* Add screenshots to the IDEs page and other relevant pages.
    - there are screenshots.

* Restore a copy of "Life with CPAN" under /topics/cpan/ .

* Add a page with exercises/challenges:
    - Learning Perl
    - Beginning Perl
    - Project Euler
    - 99 Problems in Lisp
    - Perl Quiz-of-the-Week

* Add Plack/PSGI to src/uses/web/index.html.wml.

* Fix the other links in the life-with-cpan.

* Add a section about graphical debugger front-ends.

* Add a page about modules.

* Add a recommendation to read Modern Perl in the various topical pages.
    - create a tag for that.

* Add more id="" attributes to the <h2 /> | <h3 /> | etc. tags.

* Bad elements page:
    - The FileHandle module.
    - include/do/eval "$file_contents" instead of using a module.
        - pre-req - the modules page.
    - global variables as an interface to a module.
    - declaring all variables at the top of the file, instead of when they
    are first used, and in the innermost scope.

* Add a page about games and multimedia programming using Perl.
    - See the IRC conversation on #perl .

* Bad elements page:
    - Switch.pm.
    - threads.

* Add a page about "Perl"-vs.-"perl"-vs.-"PERL".

I enjoyed the article, "Perl Elements to Avoid" at perl-begin.org.

However, I suggest it isn't sufficient to tell people what to not do. They need
suggestions on suitable alternatives. "Avoid  nested calls" is fair advice, but
now the beginner is lost, with no alternatives. They can figure out to save
intermediate results, and call routines on those, but that is just a more
verbose  way of doing the same thing. The beginner is unlikely to consider

* Add a page about web automation (maybe networking in general) :
    - WWW::Mechanize.
    - LWP
    - WWW::Curl and LWP::Curl
    - HTML::TreeBuilder / HTML::TreeBuilder::LibXML.
    - WWW::Selenium
    - Mozilla::Mechanize
    - IE::Mechanize
    - Networking modules for various protocols.
        - refer to the email page.
    - Web::Scraper

* Bad elements page:
    - using the ternary conditional operator (?:) instead of
    if/else for statements with side-effects.
        - see http://www.nntp.perl.org/group/perl.beginners/2012/04/msg120480.html
    - nested top-level subroutines.
        - sub outer { ... sub inner { ... } }
        - lexical variable initialisation problem.
        - use closures instead.
    - calling too much for the shell for help.
    - missing semicolons in the last statements of blocks.
    - list-form of open with potentially one argument:
        - will be interpreted as a shell command.
        - no way to avoid it for one argument.
        - use IPC::Run or IPC::System::Simple
    - trailing whitespace.
    - Using string eval.
        - Two or more /e flags for s/// .

* Update the modules_and_objects_perldocs block - remove perlboot, perltoot,
perlbot, and add perlootut .

* Mirror http://shlomif-tech.livejournal.com/35301.html (Code/Markup injection
) locally and enhance it.

* Bad elements page:
    - "-param" (parameters starting with a dash) for subroutines or methods.
        - should be plain names instead.
    - Code/Markup injection:
        - shell code injection.
        - cross-site-scripting / HTML injection.
        - SQL injection.
    - initialising arrays (not array refs) using [...] and hashes (not
    hashrefs) using { ... }.
    - long lines in source code.
    - grep !/\A\./ for getting rid of "." and ".." in readdir().
    - assigning a list to a scalar.
    - Regular expressions starting or ending with .*? or .*

* Update the copy of Modern Perl to the latest edition.

* "So benchmark your code, see how well it performs and then continue
reading this page if it is indeed too slow." - missing comma.

* Mention Strawberry Perl and DWIM Perl on the MS Windows Page.

* Page about Perl Humour.
    - http://perl.net.au/wiki/Perl_Humour .

* Further work on src/uses/chat-scripting/index.html.wml .
    - Maybe trim the introduction.
        - remove the what is IRC? stuff almost completely and just say
        "Perl has good support".
            - we can assume people will know what it is, and if not
            there's the link.
    - Add Jabber/XMPP.
    - Add the other frameworks:
        - <perlbot> rindolf: Don't parse IRC with regex! See
          POE::Component::IRC, Bot::BasicBot. Avoid Net::IRC. See also
          http://poe.perl.org/ or Net::Async::IRC or AnyEvent::IRC .
        - Not sure it's a good idea.

* Books:
    - http://oreilly.com/catalog/9780596004927/ - Programming Perl, 4th ed.
    - http://oreilly.com/catalog/0636920018452/ - Learning Perl, 6th ed.

* Add a tutorial on how to create CPAN distributions.
    - an up-to-date one is really needed.
    - There is one at http://www.perlmonks.org/?node_id=879515 .

* Bad elements page:
    - Recursively iterating over directories and sub-directories instead of
    using File::Find, F::F::O, File::Next, etc.
    - Using File::Find and friends for listing the entries of a single
    directory (non-recursively).
    - Populating an array of references with the same reference:
        - ([]) x $count
        - my @array;
          my @array_of_arrays;
          foreach my $elem (@other_array)
              push @array_of_arrays, \@array;
    - Conditional "my"s:
        - my $x if EXPR();
    - Using one variable for two different purposes
        - assignment to a different value in the middle of the subroutine.

* Add http://rosettacode.org/wiki/Main_Page .

* #perl FAQ:
    - randomising an array:
        - shuffle.
        - picking a random element: $my_array[rand @my_array]
    - references.
        - What's the difference between an array reference and an array?
        - Same for hash.
        - "I've tried doing $my_array_ref[3] but it didn't work."

* Page about Bad Elements:
    - Premature Optimization.
    - clarify and expand the section about the open function:
        - give more examples for the anti-patterns:
            - not using lexical filehandles
            - using two-args open.
            - not using autodie or "or die".
    - Using version control.
    - Writing automated tests.

* XML Page: ( src/uses/xml/index.html.wml )
    - mention XPath and XSLT / XML::LibXSLT .
    - Recommend against XML::XPath
    - Recommend against XML::XSLT .
    - mention http://metacpan.org/release/HTML-Selector-XPath
    - Refer to the Zvon tutorials:
         - http://www.zvon.org/comp/r/tut-XPath_1.html#intro (Requires enabling
         - http://www.zvon.org/comp/r/ref-XPath_1.html (Requires enabling
         - http://zvon.org/xxl/XSLTutorial/Output/
            - Done.
         - http://zvon.org/xxl/XSLTreference/Output/
            - Done.
    - http://ponderer.org/download/xpath/ - Interactive XPath tester.
    - http://www.xsltcake.com/ - Interactive XSLT tester.
        - Best results are achieved with Firefox, because Google Chromium
        and Opera do not handle XML namespaces well.

* Add the hyperpolyglot:
    - http://hyperpolyglot.org/scripting

* Add blogs.perl.org to:
    - http://perl-begin.org/blogs/

* Extract the common modules section out of src/uses/sys-admin/index.html.wml
and src/topics/files-and-directories/index.html.wml
    - Add File::Basename

* Page about Bad Elements:
    - Using \1 instead of $1 (on the Right Hand Side).

* Add a link to perlweekly.com somewhere.

* Add a page about file/directory-handling :
    - TODO: Add cookbook:
        - appending to files.