• 0 Posts
  • 731 Comments
Joined 8 months ago
cake
Cake day: June 24th, 2025

help-circle

  • And Harley Davidson.

    They go hard on branding. They’re one of the few motorcycle brands that let you go for a test ride (others might have a special event day at a dealership where you can ride around the parking lot). If you go for it, expect to be suited up in all the Harley leathers by the sales guy. It’s not a motorcycle, it’s a branded lifestyle where you ride around sometimes.

















  • A bit of Perl code from the late 90s/early 2000s that worked something like this (working from memory, untested):

    my $hits = `grep $search_string $file`;
    my @lines = split /\n/, $hits;
    my @real_hits;
    for( my $i = 0; $i < scalar(@lines); $i++ ) {
        my $line = $lines[0];
        if( $line =~ /$search_string/ ) {
            push @real_hits, $line;
        }
    }
    

    Let me explain a bit about what this does. Instead of reading a file line-by-line and using Perl’s regex engine to match, it uses backticks to call out to the shell for grep. Those are split up by line. Then go through those lines (in a C-style for loop, not the perfectly good foreach version that Perl has had for a long time) and now we use a regex to match that line. You know, just in case shell grep didn’t do its one job.

    If anything, I’m probably making this code look better by declaring variables with my and following use strict standards.

    This was written by a guy who was the main programmer before I was hired. I was told he was a real piece of shit. He often had some checks in his code that, if not passed, threw messages to the client like “WE HAVE DETECTED YOUR HACKING AND LOGGED YOUR IP ADDRESS WE’RE GOING TO GET YOU”. Never met him personally, but his code is a pretty good example of why everyone came to hate Perl.