Slash Boxes
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

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Anyone have any interesting and innovative uses of the map function?
    Take a look at mapcar [] from Tye McQueen. I see he also uploaded an even more generalized version to CPAN as Algorithm::Loops
  • I came up with this to dump database tables to XML (using DBI and XML::Simple):

      my $xs = XML::Simple->new(rootname => 'record', suppressempty => undef);
      print qq!<TABLE name="$table">\n!;
      my $sth = $dbh->prepare("select * from $table");
      my @row = map { { name => $_ } } @{ $sth->{NAME_lc} };
      my $record = { column => \@row };
      my @values = map { \$_->{content} } @row;
      $sth->bind_columns( @values );