Nov 4, 2009

Perl Error - Can't use string ("2") as a HASH ref while "strict refs" in use

Error:
Can't use string ("2") as a HASH ref while "strict refs" in use

Solution:
Object representing class is assinged or having numeric value "2"

if will be calling like 2->method() that makes compiler yelling

Perl Error - Can't do inplace edit without backup.

Error :
Can't do inplace edit without backup.

Cause & Solution:
This is a perl one line command execution error.
You have to supply bakup filename if you want to edit the file in command line.
ex:
perl -i.bak -p -e 's/this/that/ig' *.txt


If you find this information helpful, please click the ads below

Perl Error - Modification of non-creatable array value attempted, subscript -1 at /nfs/opt/scripts/build_output_parser.pl line 228.

Error:
Modification of non-creatable array value attempted, subscript -1 at parser.pl line 228.

Solution:
Accessing elements of an empty array with a negative index value.
ex - @a = (); $a[-1];
can be overriden by    "$a[-1]"


If you find this information helpful, please click the ads below

Perl Error - Unquoted string "callFunction" may clash with future reserved word at prg.pl line 4

Error:
Unquoted string "callFunction" may clash with future reserved word at prg.pl line 4.
Useless use of a constant in void context at prg.pl line 4.

Cause & Solution:
If you are calling a function without "&" as prefix (&FunctionName) and if that function is defined after this statement then this error will occur. Since Perl is a interpreted language it executes line by line. so it assumes function name as some bareword.


If you find this information helpful, please click the ads below

How to create Mailing list in Linux

Edit /etc/aliases

example - 
 To create a mailing list called x-product-notification@yourdomain.com

1) At the end of /etc/aliases add
x-product-notification@yourdomain.com: user1@yourdomain.com, user2@yourdomain.com

2)After saving above changes, run command "newaliases" in shell.

Now mailing list will be created.

Perforce error while trying to remove folder from workspace

Error:
 Can't clobber writable file C:\thiagu\Perforce\thiagu_p4server.net_1777\dev-app\Application.Properties
Solution:
files are having write persmission. check in or submit and the try syncing.
or try removing the workspace and get the latest revision again

Remove Generic Rootkit.g!rootkit virus from system

Symtoms:
This Rootkit is a very dangerous virus known for keylogger. so it can send your details and passwords without your knowledge.
Rootkit will be downloaded without you knowledge when you visit some less sucure sites. Antivirus like McAfee or IObit security are able to identify and clean but its not permanent.
Antivirus reports Rootkit files as
C:\WINNT\system32\drivers\synsenddrv.sys
and
C:\WINNT\system32\drivers\str.sys

Solution
Download and Install "Rootkit_Detective.exe" from http://download.cnet.com/
Run Rootkit_Detective.exe and after scanning it will ask you to reboot the system. Once you reboot it renames the virus files and solves the problem.


If you find this information helpful, please click the ads below