Sponsored Content
Top Forums Shell Programming and Scripting Assistance on complicated perl script Post 302998137 by durden_tyler on Thursday 25th of May 2017 11:04:44 PM
Old 05-26-2017
Quote:
Originally Posted by Eric1
...
When I get to part 2 without changing any information, and I input the name say, Celena Standard, I get these messages-

Code:
Use of uninitialized value $patientinfo[1] in concatenation (.) or string at ./patient.pl line 209, <STDIN> line 4.
Use of uninitialized value $patientinfo[2] in concatenation (.) or string at ./patient.pl line 210, <STDIN> line 4.
Use of uninitialized value $patientinfo[3] in concatenation (.) or string at ./patient.pl line 211, <STDIN> line 4.

The Info.txt file appears in my directory but with nothing in it at all too.
...
Since it is printing "$patientinfo[1]" in the error message, my hunch is that you have now added a declaration of the array "patientinfo".
However, that array never got populated because you have a hash "patientinfo" near the beginning of your program. Since the array is uninitialized, Perl prints that message.

The file Info.txt has nothing in it because the lines that were supposed to write in that file errored out as seen above. The open() function created an empty file and the close() function closed that empty file.
 

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
upet2mnc(1)															       upet2mnc(1)

NAME
upet2mnc - convert a Concorde microPET format file to a MINC format file. SYNOPSIS
upet2mnc [<options>] <infile> <outfile.mnc> upet2mnc -help DESCRIPTION
The upet2mnc command is used to convert Concorde microPET format files to MINC format. The microPET format consists of two files, a binary image and a text header. The header file generally has the same name as the image with the suffix ".hdr" appended. Normally you can specify the name of either the binary image or the text header file on the command line. However, both of the files should be in the same directory for the converter to locate both files correctly. OPTIONS
Note that options can be specified in abbreviated form (as long as they are unique) and can be given anywhere on the command line. -head Orient the image according to typical neurological conventions, with the Y axis oriented from the posterior to anterior, the Z axis oriented from inferior to superior, and X oriented from patient left to patient right. -body Orient the image such that the Y axis is oriented from superior to inferior, the Z axis is oriented from posterior to anterior, and X from patient left to patient right. -quiet Quiet operation - do not print progress or debugging information. Generic options for all commands -help Print summary of command-line options and abort -version Print the program and library versions and abort AUTHOR
Robert Vincent (bert@bic.mni.mcgill.ca) COPYRIGHTS
Copyrights 2005 by Robert Vincent for the Montreal Neurological Institute. $Revision: 1.3 $ May 03 2005 upet2mnc(1)
All times are GMT -4. The time now is 07:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy