Help for this page

Select Code to Download


  1. or download this
    my $TEMPLATE = '@8A6'; # oops, originally posted without the quotes  
    while (<DATA>) {
        my @fields = unpack $TEMPLATE, $_;
     
        # for output try pack or printf
    }
    
  2. or download this
    use DBI;
    my $dbh = ...
    my $sth = $dbh->prepare(
    ...
        # you've got your current record in a hash
        # print it or save it somewhere
    }