• About: Master Programmer, Perl Guru, & Avid Gamer
  • Commented on Dave Cross and Modern PERL
    @Ovid: POSIX is a standard module. It comes installed with Perl. For a list of all the standards modules, see perldoc perlmodlib
  • Commented on Dave Cross and Modern PERL
    Why not use strftime() from POSIX? use POSIX; print strftime( '%Y%m%d%H%M%S', localtime ), "\n"; BTW, SI standard is year, month, day, hour, minute, second....
  • Commented on Converting glob patterns to regular expressions
    Or you could use a hash for the convertion: my %convert = ( '*' => '.*', '?' => '.', ); s/(\W)/$convert{$1}||$1/eg;...
  • Commented on What is in The End?
    What's wrong with recursion? A look at recursion....
  • Commented on Is Perl really short of newbies?
    TIMTOWTDI: That's because there is always more than one way to do it, regardless of language. Perl just acknowledges the truth. I've been programming in Perl since version 4. Before that, I used awk, sed, and grep. Back then, Perl...
  • Commented on On Readability
    Saying syntax has no effect on the usability of a language is like saying arithmetic is just as easy with Roman numerals as it is with Arabic numerals....
  • Commented on Change Counting Problem - Feedback Requested
    Put 1¢ to 24¢ in an array: my @small = ( "", "1 penny\n", "2 pennies\n", "3 pennies\n", "4 pennies\n", "1 nickel\n", "1 nickel\n1 penny\n", "1 nickel\n2 pennies\n", "1 nickel\n3 pennies\n", "1 nickel\n4 pennies\n", "1 dime\n", "1 dime\n1 penny\n", "1...
  • Commented on A Tiny Code Quiz
    Try this one: use Data::Dumper; my @a = ( 1 .. 10 ); my $count = () = @a; my @list = () = @a; print Data::Dumper->Dump( [ \@a, $count, \@list ], [qw( *given *count *list )]);...
  • Commented on What if Perl OO was a Core Feature?
    sub new { my $class = shift @_; my $self = { @_ }; return bless $self, $class; } That is not simple?...
  • Commented on What if Perl OO was a Core Feature?
    @Toby Inkster -- my point is that OO should not be used for everything. @Stevan Little -- see above comment about OO fanatics insisting that OO be use for everything. @Olivier Mengué -- You will note how popular Perl 6...
  • Commented on What if Perl OO was a Core Feature?
    Stevan Little -- "Once you start down the dark path, forever will it dominate your destiny." I simply don't believe that once OO is added to Perl, the religious fanatics won't insist OO for everything....
  • Commented on What if Perl OO was a Core Feature?
    If OO becomes part of the core of Perl, I'll learn a new language. The only part of OO that's worth anything is encapsulation and Perl does that with packages. Inheritance is a distraction; Perl already does polymorphism; and code...
  • Commented on I translate "Modern Perl Writing Style" to English
    You should add a section on using Perl::Critic and its script, perlcritic. This will tell you everything about a Perl script or module that is not compatible with PBP. If you use the three argument open, you can use an...
  • Commented on Writing the Perl I Want to See in Others
    Have you tried Perl::Critic and Perl::Tidy?...
  • Posted A Look at Finding Out-of-Date Files to shawnhcorey

    A function for comparing the modification time of files to determine if a file is out of date with respect to its sources.

    A Look at Finding Out-of-Date Files

  • Posted A Look at Perl to shawnhcorey

    Two new articles for my blog. The first is on creating a trim() function and its test. The second, is on creating a friendlier interface to Data::Dumper.

    A Place for the Tests

  • Commented on function return in scalar context
    I don't like it because it changes the behaviour of Perl by placing two relevant items far apart. As far as programmers go, out of sight is out of mind. The `use Function::ScalarReturn` has to be place near where the...
  • Posted A Look at Conditional Compiling of Diagnostics to shawnhcorey

    Is it possible to have conditionally compiled diagnostics in your script and to ensure they don't get printed in production?

    Yes, it is.

  • Posted A Look At My Utility Library to shawnhcorey

    I am creating a utility module and will be posting about it on my blog.

  • Commented on Encapsulating Responsibility in Methods
    @Ovid: Why should Y be derived from X? That's a big assumption. @Gabor: Big systems that work started as small systems that work. Or, "Whatever happened to FORTRAN III?"...
  • Commented on Encapsulating Responsibility in Methods
    Suppose you have a object A that calls a method in B that calls C that throw an exception X that is caught by A. Now, suppose you change C in B to D, which throws exception Y. You now...
  • Commented on Encapsulating Responsibility in Methods
    Except for exceptions. If you have to change one, you must scan all the code to find were they are caught, to make sure the version will work....
  • Commented on Please provide an abstract for posts to
    I hear you.
  • Posted A Look at Cartesian Products to shawnhcorey

    A new post in my blog about Cartesian products.

    Problem: You have a number of sets and you want all the combinations when choosing one element from each set.

    In mathematics, these…

  • Posted A Look at Recursion to shawnhcorey

    I created a blog about Perl over on Blogger and I have just posted an new article on recursion.

  • Commented on C Programming: What is the difference between an array and a pointer?
    Yes, pointers in C will drive you batty. Perl's references are much easier to understand....
  • Commented on Algebra of Grammars?
    "'putting F first means I never gets a chance to parse anything' has more to do with algebra of parser combinators that is defined in terms of parse results rather than parseable sets." Yes but why build a parser if...
  • Commented on Algebra of Grammars?
    Note that: I ⊂ F I <+> F can parse I or F but it is not commutative. F <+> I = F Since F can parse everything I can, so putting F first means I never gets a chance...
  • Commented on ----perl--hello
    It worked! ;)...
  • Commented on The comma operator
    consistency = predictability inconsistency = gotchas...
Subscribe to feed Recent Actions from shawnhcorey

  • mauke commented on Converting glob patterns to regular expressions

    Eh, it's generated code. I don't care much about how readable it is. :-)

    I don't think your version handles the last case with backslash escapes.

  • mauke commented on Converting glob patterns to regular expressions

    Text::Glob doesn't treat repeated * specially, no. But it supports many other features (wildcards don't match a leading dot, curlies, etc) plus it uses a rather C-like approach to converting the pattern (iterating over single characters, state machine) so it would take more than 10 seconds of looking at it to make any major changes to the algorithm.

  • Ovid commented on Dave Cross and Modern PERL

    shawncorey: we're not going to use that because that's a part of the system we're no longer using, nor do we need its functionality. I promise you we didn't write that code :)

  • confuseAcat commented on Dave Cross and Modern PERL

    This is ... creative. In our code, I usually just find very, very boring if ( $hour < 9 ) stuff. But modulo 100? Too good to call it PERL.

  • Dave Cross commented on Dave Cross and Modern PERL

    @shawnhcorey: I'm pretty sure that Ovid knows that POSIX is a standard module :-)

Subscribe to feed Responses to Comments from shawnhcorey

About is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is hosted by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.