[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Problem with report formats



MacPerl does not seem to accept the STDOUT report format in the following
code when I syntax-check it. Can anyone tell me why? If I remove the report
format from the bottom of the code, MacPerl 5.0.7 tells me that the STOUT
format was not found.

# Nom : listdb.pl
# Date : 16/12/96
# Ecrit par : Philippe de Rochambeau
# Source : Perl 5 How-To, Waite Group Press, p. 252
# Objectif : lister le contenu du fichier convert.dbm

#!/usr/local/bin/perl -w

# User the DBM module.
#use Getopt::Long;
use English;
use DB_File;

# Set up the command line options.
#my $ret = GetOptions ("d|database:s");
#my $database = $opt_d || die "Usage: $0 -d database\n";

my $database = "Performa:MacPerl 5.07 Ä:Mes scripts:Dossier DBM:convert.dbm";
my (%contents,$count,$type,$name,$price,$desc,$record);

# Open the input file.
dbmopen (%contents, $database, 0700) || die "Could not open DBM file
$database : $!\n";

# Force the top of page.
$FORMAT_LINES_LEFT = 0;
$count = 0;

# Start printing out the database information.
for $number (sort keys %contents)
{
                                # Get the contents from the hash.
                                $record = $contents{$number};

                                # Split up the record.
                                ($type,$name,$price,$desc) = split (/\|/,
$record);
                                $count++;

                                # write it (write $_)
                                write;
}

# Close the dbm
dbmclose %contents;

format STDOUT=
@>>>> @|||||| @<<<<<<<<< @<<<<<<<<<<<<< $@####.##
^<<<<<<<<<<<<<<<<<<<<<<<<
$count,$number,$type,$name,$price,$desc
~
^<<<<<<<<<<<<<<<<<<<<<<<<<
$desc
~<<<<<<<<<<<<<<<<<<<<<<<<<
$desc