in reply to XBase File output

The undefs to types, lengths and decimals looks real suspicious. Also the name should be given without extension, XBase will default to .dbf, you will have to rename explicitely.

Did you check

XBase->errstr;
HTH

Replies are listed 'Best First'.
Re: Re: XBase File output
by michellem (Friar) on Feb 08, 2004 at 00:32 UTC
    According to the Docs "If you set some value as undefined, create will make it into some reasonable default." So I figured I was OK.

    The XBase->errstr is what I posted ("Error opening file xxx.dbf: No such file or directory").

    I'll try using the name w/o an extension (I've used XBase before for reading files, and I used the extension there, so I figured I should use it here, too).

      Anyway the docs talks about references to list. You have given an array for the fieldnames argument.

        You are absolutely right, it does. Thanks for pointing that out, I'd missed it (probably because there wasn't an example that used it). However, changing the code to:
        my $new_table = XBase->create("name" => "$filename.$ext", "field_names" => \@column_names, "field_types" => undef, "field_lengths" => undef, "field_decimals" => undef);
        had no effect - I still get the same error.