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;
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;