in reply to Re: split file
in thread split file

When I ran this script, the output was actually the same as the DATA file. In addition, it results in the following warning: useless use of a variable in void context at sp_new_load_script.pl line 6 (referring to my %bills;) I can't quite figure out where it's going wrong. Any ideas? Thanks.

Replies are listed 'Best First'.
Re^3: split file
by GrandFather (Saint) on Feb 10, 2006 at 05:46 UTC

    I just copied the code as posted and ran it using AS Perl 5.8.7 (815). It performed as expected. You could try adding use diagnostics; at the start of the code - it may give you more information about the warning.


    DWIM is Perl's answer to Gödel
      Thanks for your help so far. I've got through the previous error and this code works fine with the data I've posted. I made some changes to reflect the actual data, but I now have the same problem where the output doesn't show up in the right order.
      This's my actual data file: I have spent much time on this but I still cannot have it working properly. Please help.

        You need to select the bill number for $currBill. Your current regex match patterns don't include capture brackets so there is no meaningfull value in $1. Try something like these:

        if (/^1010100.{17}(.{13})/) { } elsif (/^3010330.{17}(.{13})/) {

        DWIM is Perl's answer to Gödel