Hello,
I met a problem with following code:
which looks fine and was running successfully except an warning message:
The diagnostics tells me the problem is with line 20 and I googled around and, found it is a very popular scope problem with $field, which actually should be related to @$record. But,
1)$record was declared, so was $field;
2)how the scope change within the while and for loops, or/and outside the while loop? which is what I am not sure about;
3) the interesting thing is not every line of the loop issued the same warning. Why?
Can anybody tell me exactly what was wrong in my case and the correct way to eliminate this warning?
Thanks a lot!
Thanks so much! That is exactly what you predicted, as I have some columns empty. After I used the way you suggested, the warning disappeared!
Thank you again!
I have to admit that i have not used Perl at all and this is a singular occasion where i have to patch an existing Perl script. I dearly hope i do not have to do it again for the next 15 years and therefore try to avoid having to learn the programming language in earnest.
The OS is AIX 7.1, the... (2 Replies)
Hello,
I have some difficulty to understand the scope of this program adapted from C++ book of D.S. Malik I am reading.
I put the header and the main program as attachment to save space. My problem is the output:$ ./prog1009_die
Line 4: Not yet rolled, die1 gets default number: 1
Line 5: Not... (5 Replies)
Occasionally I make a mistake in my shell that results in there being a > for the prompt instead of the normal $.
Today I accidentally left off a " in a sed command,
sed s/\"//g" infile > outfile
and then I get
$ sed s/\"//g" infile > outfile
>
>
I have never figured out how to get... (3 Replies)
The scope of the shell/perl script is to read the input text file. Validate the expiry date of each certificate and send the mail to the user. The user takes action to add the new certificate to the storage file and user owns the responsibility to update the input text file with the new certificate... (5 Replies)
Hello
I am having issues with a script I'm working on developing on a Solaris machine.
The script is intended to find out how many times a particular user (by given userid) has logged into the local system for more than one hour today.
Here is my while loop:
last $user | grep -v 'sshd'... (7 Replies)
cat test.ksh
#!/usr/bin/ksh
VAR="Dear Friends \n How are you? \n Have a nice day \n"
export VAR
echo "Inside test.ksh";
./test.pl
cat test.pl
#!/usr/bin/perl
print "Inside test.pl \n";
print "$VAR";
Output:
./test.ksh
Inside test.ksh
Inside test.plWhat I want to achieve is, I... (1 Reply)
Hi,
I am stuck while developing a shell sub-routine which checks the log file for "success" or "failure". The subroutine reads the log file and checks for key word "success", if found it set the variable (found=1). It returns success or failure based on this variable.
My problem is, I can... (2 Replies)
This is my home set up
I have 2 solaris boxes at home. One is a nis server and one is client.
everytime I start the client without server, it will hang permanently looking for for nis server.
is there a way to get around this? Can you set timeout the nis client?
I use nis becuase my... (4 Replies)
Hey Guys
I have an extremely annoying problem with regular expressions! At this point i believe the command 'read' is causing the problem due to the carriage return it places once its done.
I have an continuous loop until the input is correct: (After initial read statement)
while ... (7 Replies)
hi
i got fbsd here,when i try to start my X server as an user I got hte following error.
Fatal server error:
xf86OpenConsole: Server must be running with root permissions
You should be usig Xwrapper to start the server or xdm.
We strongly advise against making the server SUID root!
But... (2 Replies)