Sponsored Content
Top Forums Shell Programming and Scripting Assistance on complicated perl script Post 302997920 by Eric1 on Monday 22nd of May 2017 02:03:17 PM
Old 05-22-2017
First thing I'll note is that the very first line I submitted as my code is actually line 8 (due to comments I made on previous lines).

These are the error messages I'm receiving on my terminal-

Code:
syntax error at ./patient.pl line 73, near "my "
Global symbol "@patientinfo" requires explicit package name (did you forget to declare "my @patientinfo"?) at ./patient.pl line 79.
Global symbol "@patientinfo" requires explicit package name (did you forget to declare "my @patientinfo"?) at ./patient.pl line 88.
syntax error at ./patient.pl line 90, near "else ("
Global symbol "@patientinfo" requires explicit package name (did you forget to declare "my @patientinfo"?) at ./patient.pl line 105.
syntax error at ./patient.pl line 126, near "my "
Global symbol "$name" requires explicit package name (did you forget to declare "my $name"?) at ./patient.pl line 126.
Global symbol "$name" requires explicit package name (did you forget to declare "my $name"?) at ./patient.pl line 127.
Global symbol "$name" requires explicit package name (did you forget to declare "my $name"?) at ./patient.pl line 128.
Global symbol "$name" requires explicit package name (did you forget to declare "my $name"?) at ./patient.pl line 129.
Global symbol "@patientinfo" requires explicit package name (did you forget to declare "my @patientinfo"?) at ./patient.pl line 132.
Global symbol "@patieninfo" requires explicit package name (did you forget to declare "my @patieninfo"?) at ./patient.pl line 133.
Global symbol "@patientinfo" requires explicit package name (did you forget to declare "my @patientinfo"?) at ./patient.pl line 134.
Global symbol "@patientinfo" requires explicit package name (did you forget to declare "my @patientinfo"?) at ./patient.pl line 135.
syntax error at ./patient.pl line 167, near "my "

What I basically want as an output is for the program to run, and for there to be a new file in the directory called Info.txt with information inside it specific to how the user interacted with the program. For example, if the user changed the info for Celena Standard from F to M (in terms of the value for gender) and designated that name to be written into Info.txt, then that file should appear in the directory with this inside it-

Code:
Name: Celena Standard
Gender: M
DOB: 01/24/94
Disease: Cancer

Or on the flip side, say they didn't change the information and still chose that name (or they changed the info for one name but didn't choose that same person to write the info to Info.txt for the second part) then Info.txt would look identical to above but with the same values present in the Patient.txt file I gave above.
Moderator's Comments:
Mod Comment I repeat: Please use CODE tags (not ICODE tags) when displaying full-line and multi-line sample input, output, and code segments.

Last edited by Don Cragun; 05-22-2017 at 05:27 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Assistance with Perl and HTTP

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)
Discussion started by: bryanthomas
7 Replies

2. Shell Programming and Scripting

Perl script assistance; paste word into external command

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)
Discussion started by: bru
10 Replies

3. Shell Programming and Scripting

Very complicated script..

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)
Discussion started by: rocinante
5 Replies

4. Shell Programming and Scripting

need help with script - output to file, but complicated

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)
Discussion started by: twoodcc
13 Replies

5. Shell Programming and Scripting

In need of multi threaded perl assistance

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)
Discussion started by: SandmanCL
4 Replies

6. Shell Programming and Scripting

Assistance needed with perl script

Ok, theres a log file containing the below. Lets call the logfile log_fantastic: 2009/03/16 21:42:45 USER: tonnabo - MAC: 0014BF2D385A - STATUS_ID: 30 - STATE: ERROR 2009/03/16 21:42:45 USER: tonnabo - MAC: 001310AC120D - STATUS_ID: 15 - STATE: OK 2009/03/16 21:42:45 USER: tonnabo - MAC:... (5 Replies)
Discussion started by: SkySmart
5 Replies

7. Shell Programming and Scripting

Assistance in Perl scripting

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)
Discussion started by: deo_kaustubh
2 Replies

8. Shell Programming and Scripting

Script Search replace - complicated

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)
Discussion started by: kelseyh
7 Replies

9. Shell Programming and Scripting

awk, sed, perl assistance in outputting formatted file

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)
Discussion started by: abacus
13 Replies

10. Shell Programming and Scripting

Help on a fairly complicated shell script

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)
Discussion started by: dcaccount
10 Replies
All times are GMT -4. The time now is 10:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy