strange replacement of . and , with octal counterpart

K

Kermit Lowry

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,food

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.dat"
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_flag,
$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;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top