strange replacement of . and , with octal counterpart

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kermit Lowry

    strange replacement of . and , with octal counterpart

    The following code produces fine result when everything is hard wired
    but replaces '.' and ',' with there octal counterparts when the
    variables are passed to it. Can't figure out why. I would appreciate
    if anyone could shed some light to the darkness.
    ex.

    hard wired
    kermit.lowry,fo od

    Passed variables
    kermit\056lowry \054food

    TIA,

    Kermit


    #!/usr/bin/perl
    $pid=shift;
    open DATA, "/usr/local/data/mra/archive/${pid}Diagnosis .dat"
    or die "Can't open this file!";

    open REMINDER, ">>/usr/local/data/mra/archive/${pid}Reminder. dat"
    or die "Can't open this file !";

    open CHRONIC, ">>/usr/local/data/mra/archive/${pid}Chronic.d at"
    or die "Can't open this file !";

    open ACUTE, ">>/usr/local/data/mra/archive/${pid}Acute.dat "
    or die "Can't open this file !";

    while ($line = <DATA>){
    (
    $last_seen,
    $description,
    $code,
    $first_noted,
    $times_seen,
    $provider,
    $mra_prvlge_fla g,
    $priority_flag,
    $reminder_flag
    )
    = split("~",$line );
    if ($reminder_flag =~1) {
    if ($priority_flag =~1) {
    print REMINDER $line;
    } else {
    print CHRONIC $line;
    }
    } else {
    if ($priority_flag =~1) {
    print CHRONIC $line;
    } else {
    print ACUTE $line;
    }
    }
    }
    close DATA;
    close REMINDER;
    close CHRONIC;
    close ACUTE;
Working...