Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

merlyn (47)

merlyn
  merlyn@stonehenge.com
http://www.stonehenge.com/merlyn/
AOL IM: realmerlyn (Add Buddy, Send Message)
Yahoo! ID: realmerlyn (Add User, Send Message)

PAUSE-ID: MERLYN [cpan.org].
See my home page [stonehenge.com].

Journal of merlyn (47)

Friday July 26, 2002
07:26 PM

TPC6, Day 5, Part 2

[ #6675 ]
I sat in a Perl Script Security talk, noting that /^[a-z]+$/ on the slides would erroneously match foo\n, and that you can't use the open FOO, "< $bar\0" trick unless you've also preprocessed $bar with an initial ./ if it needs it. Ugh. People need to read perlsec, please.

Then it was the arrest that never happened. Bruce Perens talked about freedoms erroding, and what we could do.

Finally, during the town meeting, we were all chatting on IRC together. When Rael at the front "couch" also got online, I started sending comments to make him chuckle on stage.

It was cool that someone wanted to institutionalize the Stonehenge party. How can I be a rebel when I've been so readily accepted into the fold? Oh well.

It's over. Yeay. Another year to plan and implement the next conference.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I sat in a Perl Script Security talk, noting that /^[a-z]+$/ on the slides would erroneously match foo\n

    Is using [:lower:] the appropriate approach? Just curious.

    • The correct thing is to use \z:

      $_ = "blah\n";
      print "dollar\n" if /^[a-z]+$/;
      print "z\n" if /^[a-z]+\z/;
      __END__
      dollar

      I don't quite like the \a or \z modifiers. They seem a bit funky to me.

      I tend to solve this problem by getting rid of leading and trailing whitespace with something like:

      my %params = map { $_ => trim($cgi->param($_)) } qw(var_a var_b var_c);

      sub trim {
        my $str = shift;
        if ($str) {
           $str =~ s/^\s+//;
           $str =~ s/\s+$//;
        }
        $st

  • It just wouldn't be the Open Source way to take all the thunder when you produce such little lightning.

    IOW, it was not the Stonehenge Party. This year, my party swallowed the Stonehenge Party. I'm glad people liked it enough to see it next year, I suppose I'll just have to do it again.
    --
    Casey West
    • I said:
      It was cool that someone wanted to institutionalize the Stonehenge party.
      That's not a dig at the party that actually happened. I was merely quoting what I heard in the room. I know it was our party.
      --
      • Randal L. Schwartz
      • Stonehenge
  • you can't use the open FOO, "< $bar\0" trick unless you've also preprocessed $bar with an initial ./ if it needs it. Ugh.
    The proper thing to do is of course to use the three argument open(), which was new in 5.6. No parsing of the file name there. sysopen() would work too, but is much clumsier.