in reply to Problem with larger files (and s/)

open(IN, $sqlfile) || die "cannot open $sqlfile for input: $!"; open(OUT, ">$outfile") || die "cannot open $outfile for output: $!";

If you are sure that the files are all ASCII, try this instead:

open(IN, '<:encoding(ASCII)', $sqlfile) or die "cannot open $sqlfile f +or input: $!"; open(OUT, '>:encoding(ASCII)', $outfile or die "cannot open file $outf +ile for writing: $!";

Are you really sure that the files are in ASCII? which editor did you open it with? Try to inspect the files with a hex editor/dumper and see if it's really ASCII.

Replies are listed 'Best First'.
Re^2: Problem with larger files (and s/)
by Cloudster (Novice) on Jun 25, 2008 at 14:51 UTC
    I was certain that the file was ASCII. Correction, I was absolutely certain that it was ASCII.

    It wasn't.

    There are two ways of generating scripts in SQL Server 2000's Enterprise Manager. The script generator can save them to a file, or preview them and you can copy/paste into whatever you want. This is the route that I normally go. I did not notice that the final option screen let you specify OEM, ANSI or Unicode, and it defaults to Unicode.

    *facepalm*
    *bang head against wall*
    *rinse, repeat*

    I couldn't find a hex mode in TextPad, turns out that you specify a binary file type in the Open dialog, and then it quite obviously was Unicode.