I haven't gone through your entire program or understood the logic, but some of the messages seem to be due to standard beginner errors.
Check the line right above the "my " on line 73. You are probably missing a semi-colon. All Perl executable statements end with a semi-colon.
You have declared "patientinfo" as a hash i.e. "%patientinfo", but are using it as a list/array i.e. "$patientinfo[1] = $gender;"
Check the Perl documentation for the differences between lists and hashes and decide what you want to do.
"else" cannot be followed by a condition i.e. "else ($inpnum == 3)" is a syntax error. The fact that you are using an "else" branch means that you have exhausted all your conditions and want a catch-all provision at the end. If you do want to test a condition, then use "elsif" instead. But do understand it is not the same as "else".
This one is interesting because although you have done a strict declaration of $name i.e. "my $name", Perl sees "my" as continuation of the previous line. That's because the previous line does not end with a semi-colon.
Again, all Perl executable statements end with a semi-colon.
Check the spelling: "patieninfo" is not the same as "patientinfo". Thereafter, decide what you want to use - the hash or the list. Or if you want to declare a separate list etc.
Use the suggestions above to fix the rest of the errors. I haven't gone through your program thoroughly, but I hope the above pointers help you in at least running the program successfully.
This User Gave Thanks to durden_tyler For This Post:
I need to query a http site and then parse the xml results, this works well if I use the string in IE but I require an automated solution.
I have tried using the following as well as HTTP::Request, nothing seems to work any suggestions would be appreciated, I have tried diffrnt things I found on... (7 Replies)
I'm attempting to create a Perl script that will:
Take the contents of the usernames.tmp file
(usernames.tmp is created from an awk one-liner ran against /etc/passwd)
Take one line at a time and pass it to the su command as a users name.
This should go on until there is no more name to... (10 Replies)
I have a script that I need to create tha involves moving files and renaming them(see previous post)
Are there any websites with user made shell scripts? (5 Replies)
ok, so what i want to do is make a script that will do the following:
take out from a command in the terminal
put that output into a text file already on my computer.
the only thing is that i need to put the output in the file kinda weird: i need to take it and put each character of output... (13 Replies)
I need to write a perl script to execute external programs and grab the output and return code. Each program should be killed if it has not completed within X seconds.
Imagine that the script goes something like this :
@commands = &get_commands();
foreach $cmd (@commands) {
$pid =... (4 Replies)
PFA file "color.txt".
Note : There is no newline character in the file. I have manually inserted the newline char to make it easy to understand.
I am expecting out in the form as specified in second file "out.txt"
I need a perl script to perform the task.
Thanks in advance. (2 Replies)
I have a text file for which i need a script which does some fancy search and replace.
Basically i want to loop through each line, if i find an occurance of certain string format then i want to carry on search on replace another line, once i replaced this line i will contine to search for the... (7 Replies)
Hello,
Please advise. Scoured this site, as well as google for answers. However if you do not know what to search for, it's a bit hard to find answers.
INPUT:
ACTASS=
802
BASECOS=
279
COSNCHG=
3
CUSCOS=
52
UPLDCOS=
2
DESIRED OUTPUT:
ACTASS=802
BASECOS=279 (13 Replies)
Hello,
also with the help of some great users of this forum, I have created following shell script.
MM=120
GG=5000
# get size of directory
szm=$(du -s --block-size M ./192.168.1.xxx | awk '{print int($0)}')
data=$(date --rfc-3339=seconds)
if ; then # too big delete older files
... (10 Replies)