HI
I'm passing $text, which is text from a file with funny characters into a filehandle that has been opened for sqlldr like so:
-------------------------------
open(FILE,"c:\\file.txt") or die "Cannot open text file\n";
my $text = do {local $/; <FILE>};
close(FILE) or die "Cannot close file\n";

SQLLDR FILEHANDLE
-----------------------
open (my $sqlldr, "|sqlldr usr/pass \@db");
print $sqlldr "$text";
close($sqlldr);
The text in my file isn't in ascii format, it looks like this below:
                           !"   #

--------------------------------
it looks like a bunch of funny characters that contain mostly non ascii chars, I have no problem loading this data from a sqlldr dat/txt file, but when I try to pass this data as $text to $sqlldr file handle it will not load correctly. It seems as though STDOUT doesn't like the special characters in the scaler variable $text that gets passed to the file handle. Does anyone have any idea why it doesn't load/pass these funny characters correctly? How ca I can change the way STDOUT encodes reads characters? Someone I know mentioned converting everything to base 64 then try passing it.

In reply to stdout and special characters by chuckd

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.