Perl Books « Perl
Perl Books
Wednesday 26 August 2009 @ 2:52 pm

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!



Open those books in new page »

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • email
  • LinkedIn
  • MySpace
  • Reddit
  • RSS
  • Slashdot
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Technorati
  • Twitter
  • Twitthis
  • Yahoo! Bookmarks
  • Yahoo! Buzz

Comments (0) - Posted in Uncategorized by Lech  



 No responses to “”

  •   Chas. Owens wrote:

    Another WTF related to regex delimiters: m?foo? has special behavior (http://perldoc.perl.org/perlop.html#?PATTERN?).

    Also, &my_subroutine() bypasses prototype checking, so

    sub foo ($) {
    print “@_\n”;
    }

    foo(1, 2); #error, one one parameter allowed

    &foo(1, 2); #not an error

    Of course, that brings up prototypes which are full of WTF. Examine

    my @a = qw/ a b c /;
    foo(@a); #not an error, 3 is passed to foo

  •   Gabor Szabo wrote:

    Join a Perl project that helps newbies or makes it easier to develop modern web applications in Perl, or write games in Perl just to name a few.

  •   Moritz wrote:

    Skip the negations – just tell everybody that Perl is alive and kicking.

  •   Manni wrote:

    The point is not that the variable isn’t visible outside the loop, the point is that the variable gets restored to its original state after the loop is done.

    By the way: Doesn’t your blog have a feature that makes source code more readable? And why are you calling print with parens? There’s also no reason to prefix functions with an ampersand when calling them.

  •   Michele Beltrame wrote:

    I mostly work hope (I’m the employer of myself) and I find it quite pleasant.

    As you pointed out, the only disadvantage is that you are… home, so it becomes difficult to distinguish life at home from life at work. And it can be frustrating sometimes.

    Michele.

  •   David Burch wrote:

    I love Perl, but the main problem I see with writing modern web applications in Perl is with problems setting the up development environment.

    I use Perl for lot’s of day-to-day tasks and cronjob programs at work. But it’s the last tool I think of when I’m freelancing and client comes to me needing a website.

    In darn near any hosting account the client has I can install WordPress in one click, and write PHP plugins that very quickly get the job done. Or better yet, install the Thesis theme and use custom functions instead.

    BTW: I have tried setting up Catalyst multiple times in multiple environments and have always met with failure. IMHO, it only works if you have complete control over the environment, which is often not the case.

    I would love to see a WordPress-type app written in Perl, with a one click install, but it ain’t gonna happen–I’ve been waiting too long [Prove me wrong please and I'll happily eat my words as I'll have a dream development environment].

  •   Darren Duncan wrote:

    I find that details of pay and working conditions can be orthogonal to the office/home thing. For example, you can have variable hours and remuneration by the hour in both cases, or fixed hours and salary in both places. I and/or colleagues have experienced both. So I find that the decision of office vs home is more a matter of, do you want to be physically located where your coworkers or clients are and have their commaderie and little things, or do you like to feel free to geoarbitrage.

  •   zloyrusskiy wrote:

    I think, Perl is no so popular, bacause it’s hard for newbie to install modules for it. CPAN is cool for use for users who’s working in linux, but the most mass of people works in windows and for them needed CPAN with GUI and one button “install this module”

  •   john napiorkowski wrote:

    I don’t think Perl is unpopular, relative to the other scripting languages. Java and C# own the bulk, which is no surprise given that most of the programming work is in big enterprises and they always go for Java or MS. Reasons for this fact are varied and explored elsewhere. Perl is not far behind PHP, which is the most popular of the scripting languages. Given how much easier PHP is to build quick and dirty apps, the fact Perl is so close is very positive. So personally I don’t think Perl is far behind statistically. Mindshare I think we have an issue, but that’s going to change with time and effort.

  •   Alexandr Ciornii wrote:

    Java is very popular because of corporations. Maybe same for C#. PAR creates executables easily – I done it for perlcritic, ack and web program with Catalyst-based server.

    zloyrusskiy:
    ppm in ActivePerl

    john napiorkowski:
    On IRC, Perl is more popular than PHP. Perl has it’s own IRC network and large number of regulars on other networks.

  •   Zbigniew Lukasiak wrote:

    If you are working with Catalyst then I would recommend http://search.cpan.org/~flora/CatalystX-SimpleLogin-0.01/ It’s just the first version released and we have still a lot of changes to it in out heads – but the core functionality should be already stable enough, and if something does not work for you – then the dev team is very responsive (I promise to be:).

  •   Barbie wrote:

    Glad you found the feedback useful. I hope to write up a more detailed explanation of the surveys for next year, so that people have a better understanding of what they are about, and why they’re useful.

    For the full conference survey results you can find them at the YAPC Conference Surveys – http://yapc-surveys.org

  •   Simon Wilcox wrote:

    Terrible idea. As soon as someone steals the cookie they can impersonate the user and access the system. The only way to invalidate the cookie is to change the password.

    Or am I misunderstanding how your scheme works ?

    Simon.

  •   Michael Peters wrote:

    The main reason is to not store the password as plain text in the database. Perl Monks did this and when they got hacked lots of accounts were exposed. People who used Perl Monks had to run around and make sure they weren’t using the same login credentials on any other site. And you store them hashed with a salt so that if you get hacked, no one can use a Rainbow Table to crack the hashes.

  •   mj41 wrote:

    “Crypted password from database” isn’t a temporary token. E.g it can be used after user do logout.

  •   Lech wrote:

    @Simon: yes, this is true – is someone steals cookie (and do not let it expire :-) ) he can log in. This is why this solution made me unease – “The only advantage is that the password is not stored in cookie – but it is not needed, as just the digest is needed to pretend to be logged in.”

    @mj41: yes, this isn’t a temporary token, as I did not implement what the design pattern said. Now I am wondering whther I should do this, or is the solution good enough.

  •   Sid Burn wrote:

    Here is another bit of code with UTF-8 Handling in Perl. The important part of the “utf8″ documentation is:

    > “Bytes in the source text that have their high-bit set will be treated as being part of a literal UTF-X sequence.”

    > #!/usr/bin/env perl
    > # Core Module
    > use strict;
    > use warnings;
    > use utf8;
    > # If you print string out to (file)handles that has UTF-8 Flag on,
    > # perl does automatically encode everything to “ISO-8859-1″
    > # is also does this with STD* With this line of code we say that
    > # “all” handles should encode everything to UTF-8
    > use open ‘:encoding(UTF-8)’;
    > # But “all” is a lie, it does this not with the “STD*” Handles
    > # With this line we say that the STD* handles gets the same threatment.
    > # You need this if your terminal is already (UTF-8) (today any Linux
    > # Distribution should have this)
    > use open ‘:std’;
    >
    > # “Hello, World!” in german
    > my $world = ‘Hallo, Welt!’;
    > print utf8::is_utf8($world) ? “UTF-8 ON\n” : “UTF-8 OFF\n”;
    >
    > # “apples” in german
    > my $apples = ‘äpfel’;
    > print utf8::is_utf8($apples) ? “UTF-8 ON\n” : “UTF-8 OFF\n”;
    >
    > my %hash = (
    > foo => 1,
    > ‘bar’ => 1,
    > äpfel => 1,
    > ‘häuser’ => 1, # “Houses” in german
    > );
    >
    > while ( my ($key, $value) = each %hash ) {
    > print “Key ($key) has “, utf8::is_utf8($key) ? ‘UTF-8 ON’ : ‘UTF-8 OFF’, “\n”;
    > }

    Output is:
    > UTF-8 OFF
    > UTF-8 ON
    > Key (bar) has UTF-8 OFF
    > Key (häuser) has UTF-8 ON
    > Key (foo) has UTF-8 ON
    > Key (äpfel) has UTF-8 ON

  •   admin wrote:

    Thaks for comments Sid :) This will be covered in next parts of the series, that were already written and scheduled :)
    If you’ll find anything wrong or not enough described in the serie (this post and next ones), please write a comment. Thanks!

  •   Steve Sabljak wrote:

    There’s also Encode::Detect on CPAN which uses Mozilla’s universal charset detector. It works by using a character distribution model to guess the encoding.

  •   admin wrote:

    Thanks, Steve!

  •   anon wrote:

    Not “and/or”. Definitely “and”. The correct Content-Type is a MUST. On the other hand, the meta element can be left out. – Avoid the transitional document types for new documents! As the name says, it is for transitioning up from HTML 3 or untyped HTML. When generating documents, you are completely under control. Use the strict document type.

  •   admin wrote:

    > Use the strict document type.

    And what benefit will this give to me? :)

  •   Pedro Melo wrote:

    Yes, I’ve used it.

    One place where you have to use it is if you want to include a form in a ISO-8859-1 page that will be processed by a more modern CGI/FastCGI app that expects utf8.

    Quite common on mixed legacy/new environments.

  •   Barbie wrote:

    The bots are still attacking the site for around 10 minutes every hour. Around 40-50 different IPs, though their rate is down to roughly 1 requests every few seconds. Enough to still be a nuisance. They are still banned and until I see much better co-ordinated requests that ban will remain in place.

    So much for the apology from the Bing developer.

  •   Adam Kennedy wrote:

    You’ve fallen into the obvious trap in that article.

    That graph shows the RELATIVE growth rate of each language, relative to itself.

    It does NOT show numbers you can compare BETWEEN languages.

  •   admin wrote:

    You are right. I will address this isuue in one of next posts.

  •   Matt S Trout wrote:

    It’s not neglected, what’s going on is that http://northwestengland.pm.org/ are finalising the new Ironboy code that’s going to replace the current plagger install.

    That also pulls everything into a DB, at which point we can make the badge code work again.

    If you’re interested in helping out please join #northwestengland.pm on irc.perl.org and report to ‘idn’.

  •   as wrote:

    just a few notes:
    * mason is still living, even if website was spammed. it’s great system, however, it’s not full framework.
    * example you published is not mason code but tempate-toolkit
    * when you use catalyst, you can use many templating engines, such as template-toolkit, or even mason.
    * i can only recommend mason, if it fits your needs and attitude. one of the best features is that it uses perl as template language, so for perl hackers, you do not need one language for program and another for templates (as most advanced template systems need).
    * there is great free book about mason at http://www.masonbook.com/

  •   Oliver Charles wrote:

    That’s Template Toolkit, not Mason

  •   Pedro Melo wrote:

    Hi,

    I have a production site running Mason since 2001, and I can say that it is great.

    It doesn’t split your app cleanly over the now-common three layers, MVC, and it requires a mod_perl installation (FastCGI support is awkward at best).

    On the other hand, deployment is a breeze, assuming that all your app required modules are already installed. You only need to rsync the files over to the production server, no need to “reload” the server.

    I still use Mason for quick-and-dirty sites, and even for some big sites. The lack of support for PSGI is my biggest gripe right now.

    Bye

  •   john napiorkowski wrote:

    There’s work out there for integrating Mason with PSGI: “http://github.com/miyagawa/HTML-Mason-PSGIHandler”

    Just not on CPAN yet. Sure people would love a hand getting it ready, not sure what’s considered unfinished.

    I’m building a new Catalyst based website using Mason as the View since the devs here are quite proficient with it. Although most of the Catalyst examples are Template::Toolkit the Mason view works and has done the job. So give it a go!

  •   hdp wrote:

    Why does your post about HTML::Mason have sample Template::Toolkit code and a link to an article about TT?

  •   admin wrote:

    @hdp, oliver:
    > Why does your post about HTML::Mason have sample Template::Toolkit code

    I do not know. Something must have happened, perhaps not enough coffee, unexpected attack of stupidity, or maybe aliens were messing with my brain ;) . Do not know how it happened, that I mistakenly put here TT. Sorry. :(

  •   PELeon wrote:

    I respect your honesty and your opinion. I’m a man. I never read comic books. I don’t know if i could have pointed to Iron Man in a lineup of comic book characters. And i don’t particularly like movies based on comic books. BUT I love Robert Downey Jr, Gwyneth Paltrow and Jeff Bridges, so i decided to give the movie a chance.

    [[ Spam link removed - this funny spammer wrongly assumed this blog is about movie ]]

  •   kixx wrote:

    Clicked an ad, was in Polish, didn’t understand a word, waste of time. IMO it proves that clicking on ads is counterproductive.

  •   Chris wrote:

    I have no problem clicking them but no one clicks them on my site either.

  •   oylenshpeegul wrote:

    It’s not just AdBlock. I read the text of your blog (and everything else on ironman) in a feed reader. I suspect many others do as well. I didn’t see the ads (or the colors or fonts you picked out) until I came here to comment.

    I wish more bloggers realized that not all of their readers visit their sites with graphical web browsers. The bad news is, we don’t see your ads or that fancy theme you picked out. The good news is, we likely don’t show up in your stats either, so you probably have (a lot?) more readers than you think.

  •   Martin Evans wrote:

    I don’t block ads, they have never bothered me and the company I work for uses adwords anyway. I have clicked on some of the ads from Gabor Szabo’s adserver although not on your blog (probably perl monks). I would comment that perhaps Gabor’s ads might not be clicked on that much because there “seems” to be so few of them e.g., I always seem to get a padre ad (surprise, surprise).

  •   Glen wrote:

    http://Mojolicious.org/

    The learning curve is much smaller in comparison to Catalyst, and it does much more for you than Mason. Moreover, it “feels” fresh, if that sort of thing appeals to you.

    The documentation is clear enough to start using it, and the IRC channel #mojo is much more n00b friendly than #catalyst.

    Join the revolution!

  •   Steven Haryanto wrote:

    PHP programmers are a dime a dozen, so expect them to be cheaper than most other kinds. But I’m mildly surprised that Perl is even higher than all other other corporate languages.

    But I’m not seeing Ruby there? (Ruby+Rails should still be today’s darlings of web programming).