Sunday, November 21, 2010

Movie to see

1. The proposal :
To see use : http://www.imdb.com/title/tt1041829/

The Proposal is a romantic comedy starring Sandra Bullock and Ryan Reynolds directed by Anne Fletcher. Margaret Tate (Sandra Bullock) is the executive editor-in-chief of a book publishing company, Colden Books, who forces her assistant Andrew Paxton (Ryan Reynolds) to marry her in order to avoid being deported to Canada. He grudgingly accepts, under the condition that he is promoted to the position of editor. When the government investigates, the two are forced to spend the weekend with his parents in Alaska in order to sell the lie.
The unlikely couple heads to Alaska to meet his quirky family and the always-in-control city girl finds herself in one comedic fish-out-of-water situation after another. With an impromptu wedding in the works and an immigration official on their tails, Margaret and Andrew reluctantly vow to stick to the plan despite the precarious consequences. The family suggests they could marry the same weekend, and they reluctantly accept. They start to fall genuinely in love as they spend more and more time together.
Because of this, during the wedding ceremony, Margaret decides she cannot do this to Andrew and confesses the business arrangement in front of everyone--including the immigration officer handling their case. She is then told that she has 24 hours to get back to Canada, and thus goes back to New York to pack her things. Upon doing so, however, Andrew shows up at the office and confesses his love for her in front of the entire office staff, proposing marriage all over again.
Michael Mosley, Dale Place, Alicia Hunt, Oscar Nunez, Mary Steenburgen, Craig T. Nelson, Betty White, Denis O Hare and Aasif Mandvi also starrs.

2. Twilight :

Use : http://www.imdb.com/title/tt1099212/TWILIGHT is an action-packed, modern day love story between a vampire and a human. Bella Swan (Kristen Stewart) has always been a little bit different, never caring about fitting in with the trendy girls at her Phoenix high school. When her mother remarries and sends Bella to live with her father in the rainy little town of Forks, Washington, she doesn’t expect much of anything to change. Then she meets the mysterious and dazzlingly beautiful Edward Cullen (Robert Pattinson), a boy unlike any she’s ever met. Intelligent and witty, he sees straight into her soul. Soon, Bella and Edward are swept up in a passionate and decidedly unorthodox romance. Edward can run faster than a mountain lion, he can stop a moving car with his bare hands - and he hasn’t aged since 1918. Like all vampires, he’s immortal. But he doesn’t have fangs, and he doesn’t drink human blood; Edward and his family are unique among vampires in their lifestyle choice. To Edward, Bella is that thing he has waited 90 years for - a soul mate. But the closer they get, the more Edward must struggle to resist the primal pull of her scent, which could send him into an uncontrollable frenzy. But what will Edward & Bella do when James (Cam Gigandet), Laurent (Edi Gathegi) and Victoria (Rachelle Lefevre), the Cullens’ mortal vampire enemies, come to town, looking for her?

EJB overview

EJB Overview

Session beans execute a particular business task on behalf of a single client during a single
session. Session beans can be stateful or stateless, but are not persistent; when a client finishes
with a session bean, the bean goes away.
Entity beans represent business objects in a data store, usually a relational database system.
Persistence—loading and saving data—can be bean-managed or container-managed. More than
just an in-memory representation of a data object, entity beans have methods that model the
behaviors of the business objects they represent. Entity beans can be accessed concurrently by
multiple clients and they are persistent by definition.
The container creates an instance of the message-driven bean or it assigns one from a pool to
process the message. When the message is received in the JMS Destination, the message-driven
bean assigns an instance of itself from a pool to process the message. Message-driven beans are
not associated with any client. They simply handle messages as they arrive.

Internetworking questions

Q—
What are the layers of the OSI model?
A—
“All people seem to need data processing.”
Application, presentation, session, transport, network, data link, physical. Remember the sentence
Q—
Which layer determines path selection in an internetwork?
A—
Layer 3, the network layer.
Q—
What types of things are defined at the physical layer?
A—
physical connectors, and type of media.
Voltage levels, time of voltage changes, physical data rates, maximum transmission distances,
Q—
What is one method of mapping network addresses to MAC addresses?
A—
ARP, Hello, predictable.
Q—
Which includes more overhead, connection-oriented or connectionless services?A—Connection-oriented.

Tuxedo Administrator servers

ADMINISTRATIVE SERVERS
BBL - Bulletin Board Liaison. A server process that is started when Tuxedo application is started.
DBBL - Distinguished Bulletin Board Liaison. A BBL that plays the role of DBBL, activated when a networked Tuxedo application is started.
local machine to servers on other machines.
BRIDGE - A server process that is activated when a networked Tuxedo application is started to transfer messages from local messages from

Tuxedo Environment Variables

ENVIRONMENT VARIABLES
Commonly used Environment Variables:
TUXDIR, TUXCONFIG, APPDIR, PATH, SHLIB_PATH (Only HP-UX), TLOGDEVICE
FIELDTBLS, FLDTBLDIR, FIELDTBLS32, FLDTBLDIR32VIEWFILES32, VIEWDIR32
 

Data structure interview questions

Data Structures Interview Questions
1. What is linear and non-linear data structures?
2. what is the size of a void pointer ?

3. How is memory reserved using a declaration statement?

4. Data Structures declared as Volatile and Const

5. function f(x) is continuous

6. Data Structure - character that repeats itself

7. What would be the output of the following progam?union check{ char name[10]; int age;}A;void main(){ printf("Enter your name: "); scanf("%s",&A.name);printf("Enter your age: "); scanf("%d",&A.age);printf("Name=%s Age=%d",A.name,A.age);}

8. Why does the StackLinkedList class inherit the LinkedList class?

9. What are the various kinds of sorting techniques? Which is has least worst case?

10. What is hashing?

11. Why is it necessary to hash?

12. _____________ Memory is Volatile.

13. A Linked list can grow and shrink in size dynamically at _______.

14. Link list does not have any advantage when compared to an Array.

15. An _________ data type is a keyword of a programming language that specifies the amount of memory needed to store data and the kind of data that will be stored in that memory location.

16. What is nonvolatile memory?

17. data structures questions

18. the process of transforming one bit pattern into

19. What is the difference between declaration and definition?

20. How can a node be inserted in the middle of a linked list?
21. the way a card game player arranges his cards as he picks them up one by one, is an example of 1. bubble sort 2. selection sort 3. insertion sort 4. merge sort

22. The benefit of using a stack-linked list is that the number of nodes on the stack can increase or decrease as needed while the program runs.

23. Without using /,% and * operators. write a function to divide a number by 3.

24. if a function y=f ( x ) has an inverse function, then f ( x ) cannot be 1. symmetric about x-axis 2. an odd function 3. symmetric about y-axis 4. an even function

25. QueueLinkedList class inherit the LinkedList class.

26. What is the use of fflush() function?

27. The node in a single linked list can reference the previous node in the linked list.

28. which of the following symbol table implementation is based on the property of locality of reference ?

29. What is a Register?

30. ln E-R diagram 'the customer is paying his payment' The relationship is 1. one the many 2. many to one 3. one to one 4. none ofthese

31. Which of the following abstract data types are NOT used by Integer Abstract Data type group?

32. An array is a way to reference a series of memory locations using the ______.

33. What is a server and What is meant by server side implementation of com in Visual C++?

34. An application iterates the hashtable by calling the ______ and ______ member functions.

35. Data members of the Hashtable class stored in the private access specifier.

36. How many parts are there in a declaration statement?

37. What is a user-defined data type?

38. What happens when you push a new node onto a stack?

39. Boolean Expression

What is the difference bitween NULL AND VOID pointer?

41the anti-aliasing technique which allows shift of 1/4, 1/2 and 3/4 of a pixel diameter enabling a closer path of a line is 1. pixel phasing 2. filtering 3. intensity compensation 4. sampling technique

42. Fuzzy logic system rely on 1. crisp binary choices 2. ambiguous data 3. decision makers 4. all of them

43. which of the following is not primitive recursive but computable ?

44. what is the total number of equivalent relations that

45. Each entry in a link list is called a node TRUE or FALSE ?

46. the number of swappings needed to short the numbers 8, 22, 7, 9, 31, 19, 5, 13 in ascending order using bubble sort is 1. 11 2. 12 3. 13 4. 14

47. What is the difference between ARRAY and STACK?

48. what is abstract data type?

49. A hashtable is a table in which each entry consists of a hashed key and a value.

what is the size of char pointer (IN BYTES)
51. A stack-linked list is a data structure that uses a ______ to create a stack.

52. What is a leaf node?

53. The depth of a tree is the _______ of a tree.

54. Parent Node is also called as _____ Node.

55. A parent node is a node that branches into one or two other nodes, which are called child nodes.

56. What is a Tree?

57. The size of an array queue can change during runtime?

58. New nodes are added to the _____ of the queue.

59. LinkedList.h file is the header file that contains the definition of the Node structure and the definition of the LinkedList class.

60. Linked list C++ application is organized into three files.They are _____, ______ and _____.
61. The last member function is _____________.

62. The destructor is responsible for allocating all the memory that was allocated for the linked list.

63. What is the use of displayNodesReverse() member function?

64. Look at the following example LinkedList(){ front = NULL; back = NULL;}In this example, Both the front and back pointers are assigned a NULL value.

65. The ~Queue() member function is the Constructor ?

66. What is a linked list?

67. The dequeue process removes data from the front of the queue.

68. The isFull() member method is called within the enqueue process to determine ?

69. What is a queue ?

70. What is the purpose of the isEmpty() member method?
71. __________ Method removes the value from the top of a stack?

72. Popping removes an item from the stack.

73. _________ method places a value onto the top of a stack.

74. Allocating memory at runtime is also called as?

75. The symbol * is also called as _________________.

76. What does the symbol * signifies?

77. Pointer to a pointer is used in a program to ?

78. Why is the binary numbering system used in computing?

79. The size of a structure is determines by the Product of sizes of all primitive data types within the structure?

80. Define datastructure?
81. What is the difference between bubble sort & quick sort?

82. How do you overload Increment and decrement operators?

83. A pointer to a pointer is a variable whose value is an ________ of another _______ variable.

84. The size of a tree is the number of nodes on the tree?

85. The destroyList() member function deletes the contents of the linked list and ________________.

86. You have a new assignment to design and develop a database to track incoming and outgoing harcopy letters for your division. 35 employees are expected to use the database, ranging from clerical to managerial staff. BAsed on the information provided.What steps would you take to complete the assignment?Describe three or more exceptional features that you would design as part of the database?

87. _____ is the common programming technique used for hashing in all hashing functions.

88. How to reverse all the no using a single link list?

89. Why would you use a structure?

90. If the depth of a tree is 3 levels, then what is the Size of the Tree?
91. Node on a queue linked list have more than one data element.
92. Why is the constructor of the QueueLinkedList class empty?

93. 119 Let say that you need to access a particular node on a linked list, but yo
119 Let  say that you need to access a particular node on a linked list, but you dont know the reference to the node or the position the node has on the linked list, although you do know the data is stored in the node. You can locate the node by calling the _____ function.

94. A linked list index is ____ that represents the position of a node in a linked list.

95. The size of a queue linked list can change during runtime?

96. The front of the stack in a stack-linked list ______________.

97. Astack is a data structure that organizes data similar to how you organize dishes in a stack on your kitchen counter.
98. ________ is the maximum number of nodes that you can have on a stack-linked list.

99. What is the most efficient way of finding a loop in linklist?

100. Value of the first linked list index is _______.

50 OOPS interview questions

OOPS Interview Questions
1. Explain the different forms of Polymorphism.

2. What is the race condition?

3. Why C?

4. What is OOPS?

5. What are enumerators? and what are in-line functions? giv ans with eg.

6. what is the use of procedure overriding

7. What are the major considerations related to well-written multi-threaded applications?

8. Void pointer

9. Array Address

10. What is global constructor?
11. What is the difference between ++*p and (*p)++

12. Which languages are included in object based languages other than VB and java script

13. difference between data abstraction & encapsulation.

14. What is the difference between implicit function & explicit function.

15. Explain the Polymorphism principle.

16. What is the use/advantage of function overloading

17. why friend function cannot be used to overload the assignment operator?

18. how to convert roman number into decimal number

19. is it ternary operator in c++?
20. What is the difference between docking container and splitter container?What is tree display?Explain with sample prgms.

21. what is the difference between encapsulation and datahiding.explain with example

22. What are data model and class model in Object Oriented Approach specially in C++?

23. difference between object-oriented programming and procedure oriented programming

24. what is the memory allocation for pointer?

25. Explain the Inheritance Principle

26. what is factory class?

27. Describe the principles of OOPS

28. Why do you need abstraction?

29. Can we inherit private members of class ?

30. what is size of class having no variable & 1 function which returns int
31. how macro execution is faster than function ?

32. while copying the objects if you say X a = b and asssume that '=' operator is overloaded then what it will call, a copy constructor or operator overloading function

33. What is VOLATILE/Mutable in c++

34. How do you differentiate between a constructor and normal function?

35. Which languages are included in object based laguages other than VB and java script

36. What are the advantages of Object Oriented Modeling?

37. what are the differences between class anad object?

38. Does C also supports abstraction

39. Explain the Encapsulation principle

40. Why C or C++ Stack index starts from 0.
41. what is difference between void and null pointer. is it same?

42. How do you differentiate a constructor from a ordinary function?

43. What is linked list? Explain with example program

44. What are these three elements typing, persistence, and concurrency in oop approach while studying system analysis and design?

45. what is ASSERT STATEMENTS?
46. Define Inteface , Implement a class , method , clearly with simple examples , Instance class

47. what is dangling pointer?where it is used ? what are the advantages?

48. what is the difference between dos & windows?what is the use of overloading?

49. what is the similarities between macro and function?

50. What is the difference between instance and object?

useradd command UNIX

DESCRIPTION
      The useradd command creates a user login on the system by adding the
      appropriate entry to the /etc/passwd file and any security files,
      modifying the /etc/group file as necessary, creating a home directory,
      and copying the appropriate default files into the home directory
      depending on the command line options.  The new login remains locked
      until the passwd (see passwd(1)) command is invoked.
    New Behavior
      login will not be added to the primary group entry in the /etc/group
      file, even if the primary group is specified in the command line.
      However, the  login is added to the corresponding supplemental group
      in /etc/group file.
    Options
      The useradd command supports the following options:
           -u uid         Specifies the UID for the new user.  uid must be a
                          non-negative decimal integer less than MAXUID as
                          it is defined in the <param.h> header file.  uid
                          defaults to the next available unique number above
                          the maximum currently assigned number.  UIDs from
                          0-99 are reserved.
           -o             Allows the UID to be non-unique (i.e., a
                          duplicate).
           -g group       Specifies the integer group ID or character string
                          name of an existing group.  This defines the
                          primary group membership of the new login.  The
                          default for this option can be reset by invoking
                          useradd -D -g group.
           -G group       Specifies the integer group ID or character string
                          name of an existing group.  This defines the
                          supplemental group memberships of the new login.
                          Multiple groups may be specified as a comma
                          separated list.  Duplicates within group with the
                          -g and -G options are ignored.

RETURN VALUE
      useradd exits with one of the following values:
           0    Successful completion.
           2    Invalid command syntax.
           3    Invalid argument supplied to an option.
           4    uid is not unique (when -o is not used).
           6    The group specified with the -g option does not exist.
           9    login is not unique.
           10   Cannot modify the /etc/group file.  The login was added to
                the /etc/passwd file, but not to the /etc/group file.
           12   Unable to create the home directory (while using the -m
                option) or unable to complete the copy of skel_dir to the
                new home directory.
           13   Unable to open /etc/ptmp file or /etc/default file, or
                /etc/passwd file is non-existent.
           14   /etc/passwd, or /etc/ptmp, or /etc/default file busy.
                Another command may be modifying the /etc/passwd file.
           16   Cannot add the entry into the /etc/passwd file.
           54   Exceeding permissible limit of maximum members in a group.
                The /etc/group file is not modified.

Phrases in Spanish

Greetings

Hello / Hola
Goodbye / Adios
Good morning/good day / Buenos dias
Good afternoon / Buenas tardes
Good evening/night / Buenas noches
How are you? / Como esta usted?
Very well thank you / Muy bien, gracias
See you soon / Hasta luego
That’s all right / Esta bien
Don’t worry / No se preocupe


Useful Statements

I (don’t) like it / (No) me gusta
I’m not sure / No estoy seguro
I don’t know / No se
I think so / Creo que si
I’m hungry (thirsty) / Tengo hambre (sed)
I’m tired / Estoy cansado
I’m ready / Estoy listo
Leave me alone / Dejame solo por favor
Just one minute / Un minuto por favor
One moment please / Un momento por favor
Come in / Adelante
It’s cheap (expensive) / Es barato (caro)
It’s cold (hot) / Hace frio (calor)
It’s too much / Es demasiado
That’s all / Es todo
Thank you for your help / Gracias por tu ayuda
Taxi please / Taxi por favor


Opposites

Before (After) / Antes (Despues)
Early (Late) / Temprano (Tarde)
First (Last) / Primero (Ultimo)
Here (There) / Aqui (Alli)
Now (Then) / Ahora (Entonces)
Small (Large) / Pequeño (Grande)
Empty (Full) / Vacio (Lleno)
Few (Many) / Pocos (Muchos)
More (Less) / Mas (Menos)
Beautifu l(Ugly) / Bonito (Feo)
Better (Worse) / Mejor (Peor)
Clean (Dirty) / Limpio (Sucio)
Cold (Hot) / Frio (Caliente)
Free (Taken) / Libre (Ocupado)
Open (Closed) / Abierto (Cerrado)


Common Phrases

Yes / Si
No / No
Please / Por favor
Thank you / Gracias
You’re welcome / De nada
No thank you / No gracias
Sorry / Perdone
What is your name? / Como se llama?
My name is ___ / Me llamo ___


Language Problems

Do you speak English? / Habla Ingles?
Do you understand me? / Me entiende?
I don’t speak Spanish / No hablo Español
Please speak slowly / Hable despacio por favor
I don’t understand / No entiendo


Questions

Where is(are)? / Donde esta(estan)?When? / Cuando?
Who? / Quien?
Why? / Por que?
What? / Que?
How much is (are)? Cuanto es(son)?
How far? / Que distancia hay?
I want (would like...) / Quiero...
What is the matter? / Que pasa?
Can you help me? / Puede usted ayudarme?
Can you show me? / Puede usted enseñarme?
Can you tell me? / Puede usted decirme?


In A Restaurant

I’ve reserved a table / Reserve una mesa
Waiter(Waitress) / Camarero(Camarera)
May I have the menu? / El menu por favor?
May I have the wine list? / La lista de vinos?
I’d like... / Quiero...
A little more / Un poco mas
What will you drink? / Que desea beber?
This is bad / No esta buena
One beer please / Una cerveza por favor
Glass of water / Un vaso de aqua
Ice (cubes) / Hielo
The bill please / La cuenta por favor
Cheers! / Salud!
Breakfast / El desayuno
Lunch / El almuerzo
Dinner / La comida(la cena)

                                                                -------------------------

Siebel - CRM

What is CRM?

Any successful company consists of Employees, Business Processes, Technology and Customers. Customer loyalty and satisfaction is the number one priority for any company. So managing the customer information is very crucial for a company. Also the processing of customer requests like orders, service request, payments are very important. All these factors including many others make up a concept called CRM or Customer Relationship Management.
CRM is a business wide strategy designed to reduce costs and increase profitability without compromising the customer satisfaction and loyalty. It also improves the call center efficiency where customer data is accessed real-time. It is also used to automate processes by being a less burden on employees. It also integrates data with other systems so that all needed information is available at one central place saving time and operating costs. It helps the management to make right decisions like where to invest money and tap the right opportunity to keep up with the market trends by looking at the sales, marketing and customer information at one central place. So the overall objective of CRM is reduce costs, improve operating efficiency and customer satisfaction.

There are many CRM softwares available in the market. They come in different forms. Some are low cost softwares which are very simple to implement and have very limited functionalities while some softwares available have very complex functionalities and could cost millions to implement it. The company management needs to determine which CRM software best suits their business needs in terms of its operational efficiency and budget. Among all of those available softwares in the market, the most popular ones is Siebel CRM.

Siebel Basics

Siebel is the most popular CRM software available in the market. It was first started by Siebel Systems Inc, and later taken over by Oracle Corporation on 2006. So Siebel products are now Oracle CRM product.
Siebel Systems, Inc. was founded in 1993 by Thomas M. Siebel and Patricia House. The company grew very quickly and their revenue in 1996 was $39 million. It went public on 1996 and on 2000 their revenue surpassed $1 billion mark. On 2006 Oracle acquired Siebel Systems for $5.8 billion.
The major releases of Siebel include
Siebel 98
Siebel 99
Siebel 6 (also known as Siebel 2000)
Siebel 7 (Released in 2001)
Siebel 8 (Released on 2007)- Current Version
There are still many companies working on Siebel 6 but most companies now are currently working in Siebel 7.x version.


There was a major change in architecture from Siebel 6 to Siebel 7. While Siebel 6 has mainly Client-Server model, Siebel 7 introduced Web based architecture which revolutionized the whole product having more advanced features.
Siebel provides industry specific versions of their CRM software called the Verticals like
Siebel Automotive (used by auto companies)
Siebel Energy (used by energy companies)
Siebel Consumer Goods (used by consumer goods companies like Procter and Gamble)
Siebel Financials (used by finace companies like Chase)
Siebel Pharma (used by pharmaceuticals companies)
Many people might argue that it is too expensive to implement CRM applications and would instead like to develop their own home grown custom software application to help Sales. But there are many other reasons to believe as to why applications like Siebel CRM available outside market would be much more beneficial in the long. Home grown applications could become very complicated and would take a hell lot of time to implement it and they are often not implemented at its best level. Also supporting and upgrading home grown application will be a pain as employees leave and the knowledge base will be gone. Home grown applications will often prove expensive. But if an application like Siebel CRM is implemented, even a complicated implementation wouldn’t take long and the Return of investment (ROI) is really great.
Siebel has been implemented by most major companies like Chase Manhattan Bank, Yahoo, Procter and Gamble, Lucent Technologies, Home Depot etc.

Installing Siebel

Installing Siebel on your Local machine is not complicated. Normally there as Siebel Administrators who do assist in having this setup. To complete the installation and getting started you will need client and tools config files provided either by your Siebel Administrators or your coworker. Also you will need ODBC DSN Name entry details from them for connecting it to the server. Before you attempt to install client make sure you have Windows 2000/2003/XP with minimum 1GB of RAM.
We will here cover installing Client software for developers. Follow these basics steps and you should be able to start working on Siebel.

Go to http://edelivery.oracle.com/
Login with your support-web username and password. (Provided by your manager)
You will be given a choice of which software you want to download along with the OS. There will be multiple files depending upon what version you would like to download.
Download all the related files in on single directory.
Extract all these files into another directory. Extract all of them in one single directory. This is called the Image Directory.
Under the Image Directory go into Windows and then Client directory
You will see Siebel Tools and Siebel Web client. As for a developer we need both Tools and Client. More information on these is provided in further sections.
First we will install Client. Click setup under Siebel Web Client directory.
Go through the steps appropriately. Accept default parameters or skip any parameters that it would ask or enter some dummy parameters if required. All the parameters that you enter here is stored in config file which will be replaced by the config file you have received.
With this you will be able to connect to the sample database. Next few steps will guide in connecting to Local and Server database. More information about Sample, Local and Server database will be covered under Siebel Tools and Client section.
Copy the client config file that you got previously from your Siebel Admin into the $installation_dir\web client\BIN\ENU from step 9. For example like C:\Program Files\Siebel\7.7\web client\BIN\ENU
Enter the ODBC setting provided by Siebel Admin under Windows Control Panel -> Admin Tools -> Data Sources -> System DSN. When you add make sure you select Siebel Oracle Driver.
With this you should be able to connect to the Server Database.
Request for Database Extract for your account to the Siebel Administrator. Details provided under . When this is done go to the next step.
Then login into local environment and it would ask if you would like to connect for extract the local database. Once done you will see a database file “sse_data.dbf”either under $install_dir\Tools\Local or $install_dir\WebClient\Local depending on how it is setup in config file. Make sure your tools and client config files are pointing to this one single dbf file for connecting to local DB. All this help will connect to the local database for both Client and Tools.
Similarly to install tools, under the Image directory go to Windows Client and then Tools and click setup.
17. Go through the steps appropriately like previously. Accept default parameters or skip any parameters that it would ask or enter some dummy parameters if required.
Copy the tools config file provided by the Siebel Administrator under $install_dir\Tools\BIN\ENU. For Example C:\Program Files\Siebel\7.7\Tools\BIN\ENU
If you have already extracted the local database make sure that in tools.cfg file local db is pointing to that extracted database as explained in step 15.
This should complete installation. In our next section we will cover the details about config file.

Siebel Configuration File

Configuration file contains parameters that are used by Siebel Applications during startup. It is a place holder for parameters. It is a normal text file having a file extension of cfg. Different verticals have its own config file, for example eauto.cfg is used by Siebel Automotive, uagent.cfg is used by Siebel Call center application and siebel.cfg is used by Siebel Sales. These config files are created during installation under "[install directory]\Siebel\7.7\web client\BIN\ENU" assuming you have installed Siebel 7.7 version. For a sample Siebel config file click here. Open it using your normal text editor like notepad or textpad.
Similarly we have tools.cfg file which is used by Siebel Tools. Siebel Tools is used to configure Siebel Application. More about Siebel Tools will be covered later. You will normally find this config file under "[install directory]\Siebel\7.7\Tools\BIN\ENU". For a sample tools config file click here.


If you observe the config file esales.cfg, there are several parameters defined that are used by the Siebel Application. There are two most important sections in this file. The first one is [DataSources] in line 92. This lists the possible sources where Siebel could connect to. Like the Local, Server, Sample and Gateway. The definition for each of these is defined in separate sections. Line 98 defines parameters for connecting to Local. Similarly parameters are defined for connecting to Sample and Server Data Src under line 115 and 130 respectively.
The second important section is the [Siebel] section on line 25 where you define some common parameters that are used by any of the data sources. It is a part of object manager parameters for the server components. It defines the parameters like the srf file to use, application name, ODBC connections, Language, directories etc.
Similar explanation applies to tools.cfg file.

Siebel Client

Siebel Client is the User Interface of Siebel for users. In other words it is the Siebel software users use to access Siebel Database.
There are three types of Siebel Clients
Mobile Client
Dedicated or Thick Client
Web or Thin Client

Mobile Client:
They have Siebel Client Software installed locally, Have their own database, Have their own File System and directly access and modify their own database. This mobile client periodically connects to their designated Siebel servers for updating the server database. It meets the need of Field professionals who do not need to have continuous access to the Siebel Network
Example: any HandHeld device in which siebel is installed.
Dedicated or Thick Client:
They have their Siebel Client Software installed locally but however they can either be configured to always be connected to the Siebel Server or can operate on a locally without having to connect to the server.
For first type where it is always connected to the server, they do not have their own database or Siebel File System. All changes that are done locally are immediately reflected on the server.
In the second type where the Siebel Client operates independent to the server connection, they have their own local DB and local Siebel File System.
Example: For first type, dedicated client connected to the server. This case was very prominent with Siebel 6.x. Siebel users would have local installation and they logged into Siebel with server authentication and work on a central database shared by several users.
For the second type a good example is Siebel Developers Machine where the Developer can work locally for developing Siebel application with his own database.
Web or Thin Client:
Siebel Web Client does not need Siebel Client Software installed nor it has its own database. Web client users access Siebel via the web browser like Internet Explorer. Web clients are given a specific URL to access Siebel. All transactions are committed immediately. Web clients are served with the help of Siebel Web Servers.
Example: Typical end user having access to the URL with login and password accessing through Internet Explorer

Siebel Tools

Siebel Tools is an integrated environment for configuring the Siebel Application used by Siebel developer. It is a powerful application development environment used to configure to meet the business requirements.
Siebel Tools is not a programming environment like Visual Studio. Rather it is an interface primarily used to create or modify object definitions.

Below is the snapshot of Siebel Tools.


The left pane is called the Object Explorer. This displays all the object types like Business Components, Applets, Screens and Workflows. In other words it is the grouping of object definitions. This Object Explorer consists of hierarchical tree structure user interface displaying child object types.
The Right pane is called the object list editor window. This lists all the object definitions like Tables, Business Components and Applets. On navigating on the hierarchy it would also lists the child object type definitions.
Next we will see where these object definations are stored.

Siebel Repository


Siebel Repository refers to a subset of tables in which Siebel objects definitions and scripts are stored. These tables are Siebel database tables and contain all the configuration information that is shown in Siebel Tools. So Siebel Tools helps as a user interface to look at the object definitions stored in the database. All the object definitions are modified or added using Tools.
Note that, all the initial Siebel repository definitions that you would see in Tools get populated during the installation.


Just to illustrate that these object definitions are stored in the database, we can run a simple query on the Siebel database. (You can run this on Local DB also. See how to connect to Local Database)
Example:
select * from siebel.S_BUSCOMP; -- This lists all the business components that are defined in Tools.
select * from siebel.S_APPLET; -- This lists all the applets that are defined in Tools.
Select * from siebel.S_PROJECT; --Lists all the Projects defined in Tools.
Note that, all the initial Siebel repository definitions that you would see in Tools get populated during the installation.
Multiple repositories can exists in Siebel but only one can be active at a time. In Siebel Tools if you select the object type "Repository" on the object explorer, you could see multiple repositories listed but only one of them will be active.
Tip: If you are not able to see the object type "Repository" in Siebel Tools, then go to View => Options => Object explorer and select the object type "Repository" to show up in Siebel Tools explorer.
Importing and exporting of repositories is done using the Database Configuration Utility. Multiple repositories are created using this Database Configuration Utility while either backing up or importing from other environments. Example: Moving all the repository definitions from Development environment to Testing Environment.
Now that we know where these object definitions are stored, we will next learn where these object definitions are compiled and how it gets used by Siebel Application.

Siebel SRF

Siebel SRF file also known as Siebel Repository File (SRF) is a compressed, read only file that contains compiled version of Siebel repository. So all the object definitions and scripts that are defined in Siebel Tools are compiled into one single file which is will be used by Siebel Application at runtime.
This SRF file is normally found under “[install directory]\Siebel\7.7\web client\OBJECTS\ENU” with the file extension srf.

It is very important that the active Siebel Repository should always be in sync with the SRF otherwise you could see weird problems. So we will have to recompile every time an object definitions is changed in Tools.
To compile, in Siebel Tools go to Tools => Compile. Here you will have the option of selecting individual projects, multiple projects or you could do a full compile by selecting all projects.
There is also an option to choose the SRF you want to compile to by browsing for the SRF as shown the screenshot below.



So select the projects and the SRF file then hit compile.


Siebel Overview

Hopefully the previous topics have given you a little idea about what is Seibel CRM and how it can help a company to be effective.
We also learnt how to install Siebel and what the different entities are that Siebel application talks. Below is the summary. Pictorial representation of Siebel functions.

Configuration File: It is normal text file with a file extension of cfg. It contains all the parameters that Siebel uses during startup. It is a place holder for parameters.
Siebel Client: This is the User Interface of Siebel to which the employee or the customer access. There are different types of clients
Siebel Tools: It is an Interface or development environment used to configure Siebel Application. This is used by Seibel Developers.
Siebel Repository: This is a subset of tables in the Siebel Database which stores all the object definition or configuration details including scripts.
Siebel SRF: Also called as Siebel Repository File (SRF) is a file with extension srf and is the compiled version of Siebel Repository. In short it is a compiled file.
Below is the visual representation of how different components connect.



Next we will see how to get started on developing Siebel application.
Even though we have a local Siebel environment in our own machines, it is very important to sync up with the existing server environment. There are multiple people working on one project or on one Siebel server instance. Each one configures his portion of the project and then checks-in onto the server. So when a person joins a project and before s/he starts to work, we have to adapt to the environment. This process is explained under "Generate Database", "DB Extract" and "Get Process". These are normally a one time process but could be done multiple times if desired. Also note that this process is done on Development Environment.
After we adapt to the environment and before we start to make any changes, we "Check Out" projects to avoid multiple developers working on the same project.

After Check-Out we do the actual configuration. Configuration can be anything small like adding a pick list or big like adding a new screen with complex functionality in it. More information on actual development is explained under Configuration section.
After necessary changes are made, we compile the object definitions into the SRF file and test. If need go back and make changes compile again to test. This process is repeated until the desired result is achieved.
After the changes have been tested and the result is positive we check-in this onto Siebel server. This will now have object definitions both locally and in Siebel server. So now your changes have to be made available for the end users. For this we compile the server object definitions and deploy the SRF.
All the above process is explained in detail in the following tutorials.

Login Setup

Developers work on Siebel Tools to configure Siebel and they are connected to Local Database. Local database contains all the object definitions plus the subset of actual data from the server. To get all this information from the server, we essentially follow a process of extracting all the object definitions from the server and storing into our local database.
Before we connect to the server and be able to extract the database, following steps have to be done. These steps are as per the Siebel Version 7.7.

Create a Database User Account:
This is the first step to the whole process. Request a database account either to the DBA or Siebel Administrator. This is will be the login account. For example: MJONES. This login account should be created and should be added to the group SSE_ROLE. This is a server database account and should be able to login to the database directly using DB tools like TOAD or SQL-Plus.
Setup Developers as Siebel Employees:
Setup each developer to be a Siebel Employee as described in the steps below.
Login to Siebel Server using the login SADMIN/SADMIN or as any other account having access to add Siebel Users. Normally Siebel Administrators have this.
Go to Site-Map -> Administration-User-> Employees
Create a new Record with First Name, Last Name and desired login Id.
Password will be the same as that mentioned while creating the Database User Account above.
Assign a Position and Responsibility to this User. This would normally be Siebel Administrator. But might change depending on the setup. This is very important otherwise the database extract would fail.

Setup Developers as Mobile Clients:
After setting up developers as employees, you must register developers as mobile client. This will provide information for extracting local database for that user. Follow the steps below.
Login as either SADMIN or any other account having access to employee screens.
Go to Site Map -> Administration-Siebel Remote -> Mobile Clients
In the parent server form, choose the appropriate ones. Normally there is only one unless there are multiple implementations of Siebel on the same server.
In the Mobile Clients list, click New and fill up the following details.
Mobile Client Name Example: MJONES (Login Account Name)
User Id. Example: MJONES (Login Account Name)
Routing Model as Mobile Client - Extract Only.
Generate Database

Generate New Database Template commonly known as GenNewDb or GenDb, is process of capturing the physical representation of Siebel Tables and Indexes from the Siebel Server Database. Siebel Remote uses this template to extract the database which is done in the next step. (FYI, Make sure Siebel Remote is selected during Server Installation).
This template is created by running the GenNewDb Server component.

Following is the process of Generating a New Database Template:
From application level menu, go to SiteMap -> Administration-Server -> Jobs
On the top applet, click New to create a new job and enter the following parameters
Under Component/Job Field pick Generate New Database
Under Requested Server, enter server name where the job should run. Siebel Admins would know this or find out by navigating to Sitemap -> Administration-Server Configuration -> Servers
In the bottom applet, enter Job Parameters by clicking New
Under Name field, open pick applet and choose SQL Anywhere Database and click ok.
Under value field it would default to sse_utf8.dbf
There are other optional parameters that could be used. This is not covered here as it is not required. If needed refer BookShelf.
Now on the top applet click Start to submit the Job.
After few minutes refresh and check the status of the Job should change to Success. If so you have successfully created the Database Template.
This process is done every time a new database extract is requested.
Next we will extract the database which has actual data.

Generate Database

This process extracts data from the server database for the requested mobile user and stores temporarily into a compressed file onto the server. This file contains the data and it is downloaded into the local machine as explained in the next step.

Make sure the user has been assigned a position and responsibility as explained under previous steps and follow the below steps to extract data.
Go to SiteMap -> Administration-Server -> Jobs
On the top applet, click New to create a new job and enter the following parameters
Under Component/Job Field pick Database Extract
Under Requested Server, enter server name where the job should run. Siebel Admins would know this or find out by navigating to Sitemap -> Administration-Server Configuration -> Servers
In the bottom applet, enter Job Parameters by clicking New
Under Name field, open pick applet and choose Client Name and click ok.
Under value field enter the name of the Client Name Example: MJONES. Remember that this is normally a login name.
Now on the top applet click Start to submit the Job.
This will take a few minutes and the job status changes to Success.
After successfully running this step, you should now observe that a directory structure gets created normally under $siebsrvr_root\DOCKING\MJONES. Under this you will see folders inbox, outbox and dobjinst.dbf file. The outbox folder contains several other files which is needed for the next step.

Initializing Client

Now you have to download the database file into your local computer. This process is called initializing. For this make sure you have installed Siebel Tools as explained under Installing Siebel.

Follow the steps as mentioned below.
Launch Siebel Tools. Connect to Local.
When the login using the machine name as entered previous steps. Example: MJONES. The following message will appear "The local Siebel database was not found. Would you like to connect to the Siebel Remote server to initialize the local database?" This message appears because Siebel Tools could not find the database file see_data.dbf under "C:\Program Files\Siebel\7.7\Tools\LOCAL" This directory location may change depending upon the settings in your tools.cfg file. The parameter to check is ConnectString under the section [Local]. Note that if there is already sse_data.dbf this message might not show.
Click Yes. Siebel Tools will start downloading and would take a while.
If the initialization was successful you will see the database file see_data.dbf under "C:\Program Files\Siebel\7.7\Tools\LOCAL"
Troubleshooting:
For any reason if Siebel Tools is not able to connect to the server, check your tools.cfg file for the server it is trying to connect under the section [Local]. Parameter to check is the DockConnString and EnterpriseServer.
If the initialization gets stuck or ends abruptly, delete the sse_data.dbf file and redo the steps above.
Now you are almost done in starting your development step but there is one other important step you need to do before starting your work. This step is called the Get Process which is explained next.

Get Process

After all the initialization and login into Tools, the object definition and configuration information that you would see in there is the out of the box configuration which Siebel supplies. But this is won’t be in sync with the object definitions or any changes that have been made previously in the server. So we do a Get Process to sync up with the existing configuration or projects.

Follow these steps for Get Process:
Login into Siebel with connecting it to Local
Go to Tools -> Check Out
Choose the Repository. Normally this will be Siebel Repository.
Click on the radio button for All Projects
Click Get 
All the server definitions will start to copy into your Local Repository. Once completed, your repository will be in sync with the one on the server.
Troubleshooting:
It is very common for people to complain that they are not able to a Get or Check-Out. This would happen only when the server data source parameter is not set correct in Tools. To set this right, in Tools go to View-> Options ->Check In/Out tab. Change the server data source name to the ODBC Data Source which connects to the server. ODBC Data source is defined under Windows Control Panel -> Administrative Tools -> Data Sources (ODBC). Fix this and this should solve the problem.
Note that Get process is very similar to Check-Out except that the Get Process won’t lock the project on the server. Check out process syncs the object definitions and lock the project on the server, but the Get process only syncs the object definition between your local machine and the server. We will see the Check-Out process in detail in the next step.
Now that your repository in the local machine is current, the complied version of this that is SRF file needs to have this info. So we need to do a full compile. This will ensure that when you making changes later on and testing it, you will test with all updated information. Check the other topic on how to compile.
Next we will look at the topic of making changes.

Siebel CheckOut Process

All Siebel configurations should be done on your Local Environment. It is a very bad practice to make changes directly on the server because you can’t roll back. So making changes directly onto the server may lead to loose current configuration. So we checkout projects to get all the current configuration definition into your local machine and you could further configure as needed. It also helps in locking the projects onto the server so that no other person can make changes while your changes are progress. This way we know which developer is working on what project.

To checkout a project:
In Siebel Tools, choose Tools -> Check Out. A checkout box will appear.
Select single project or multiple projects for which you want to make changes. If the project has already been locked then it would show the name of the person who has checked out or locked and the date.
You might click on options to make sure that your tools are pointing to the right local and server database.
Click Check Out.
Tools will start to checkout and will take a little time to copy information from the server to your local client.
To undo checkout:
After checking out and making modifications on your client machine, you might want to undo all the changes you have done to the project. The only way you can do this is by undoing check out. To undo,
In Siebel Tools go to Tools -> Check In
Select the project you want to undo
Click Undo check out. This will remove the lock on the server without any modifications.
On object explorer select Project
Query for the project to which you want to undo project changes.
Remove the lock on the project by clicking on the locked property.
Note that after you undo check out, your local object definitions is out of sync with the server. So if you want to be in synch again with the server either do a Get on the project or Check out that project again.
After we are done check out, we can start making changes as per requirement. Changes could be any where from creating a pick-list to creating a whole screen. These changes are nothing but configuration which is covered under Siebel Configuration section. Assuming that the changes have been made, these changes need to be compiled and tested which is covered next.

Compile Siebel

After changes are made in Siebel Tools, it is important to test locally before moving those to the server. To test the changes we should compile and check in our local machine.
As already mentioned in the Siebel SRF section, all the object definitions defined in Siebel Tools have to be compiled into one SRF. So to test, compile into the SRF that the Siebel application is referring to and this normally would be "[install directory]\Siebel\7.7\web client\OBJECTS\ENU\siebel.srf"

To compile, in Siebel Tools go to Tools => Compile. Here you will have the option of selecting individual projects or you could do a full compile by selecting all projects.
Below is the snapshot of Siebel Tools.


There is also an option to choose the SRF you want to compile to by browsing for the SRF. When testing locally point the compilation to the SRF the local client application is referring to.

Testing Siebel
Any software development has to be checked for its correctness and accuracy before it finally available for use to the end user. So testing the software also popularly known as QA (Quality Assurance) is very crucial.
There are different methodologies and different stages at which testing is done. Below are some very basic and common testing practices.

Unit Testing:
This testing is the first stage where the developer who changed or configured the application test himself for correctness locally before it is available to the actual designated testing individual. For example a new View is to be created with certain applets associated to certain Business Components. So the developer finishes the job of creating a view and other required stuff and then compiles locally and checks if the view developed is actually the one desired. If the results are not what is expected, the developer makes again necessary changes, compiles and then test again. Only after this stage is complete we check in onto the server which is the next stage of development.
Testing on Dev Server:
After Unit Testing, all the changes are checked in onto the development server and the server is compiled. After compiling the server, we test the changes on the server through Thin Client. The results of this are compared to the requirements and are approved in development environment. If the results don’t match the requirement, the developer goes back again to the local environment and makes necessary changes and repeats the process of testing.
Testing on Staging Server:
Staging server is a temporary stage to test new or revised work before it is made live in production. This server is very similar to the production server. So any thing seen here will be reflected later onto production server later after approved over here. There are certain individuals assigned to do testing on this server. These individuals called as testers or QA personnel’s check closely any new or revised work and match up with the requirements. They also look for any conflicts or potential problems called defects. These defects are logged using soft wares like “Mercury Test Director” and are assigned to developers and will have test cases and description to replicate the defect. Then the developer makes again necessary changes and follows the whole process again. Once the changes or any other work is approved in staging server, this is moved onto the production server where the end users see it.
Testing on Production Server:
This server is where the actual end users connect to. This server will have all the production data. In spite of thorough testing on the staging server, it is quite possible that there could be some defects on the production server. The QA personnel do some final testing on the production server and if everything seems to look fine, then it is approved in production and will be called as successfully deployed.
Please note that the above description is only a basic level of testing just for our understanding, but most often testing process is very rigorous and complicated. This process differs from company to company.

Check In Process

After making changes, compiling and testing to make sure the changes meets the desired output, we would like to make the changes be available to all the other users as well. So the first step is to check-in your changes, which is explained here.
All the changes are in your local machine database and still not in the server. To have this available on the server database we check-in using Siebel Tools.

Follow these steps to check-in:
Launch Siebel Tools connecting it to the Local
go to Tools -> Check In
A check in box will appear as shown in the screenshot below.

This box will show all the projects that is been checked out or locked locally
You could either choose one, multiple or all projects to check-in
If you observe there are multiple button on the box that you could select.
It is highly recommended to select the project and click the Diff button. Under Diff it would list all the changes that you have made locally and not yet available on the server. This step is called Project Diff. This process could take a little while. If you notice in the screenshot below, the objects defined locally are compared with the server. In this Compare Object box, uncheck the Show All objects. This will show only the differences. If you observe in the screen shot, the difference is the value of Drill-Down object.


Once you confirm that the changes you have made is what you intended and have not done anything non-desired, you are ready to Check-In
So choose the projects to check-in and click on Check-In. After a little time changes would be updated onto the server and the lock will be removed from both the local machine and on the server.
Now that the changes are now available on the server, that project is now available for other developers to check-out and start making their changes or compile can compile the server.

Compiling Server
After checking-in all the changes on the server we have to compile the changes into the SRF. There are two places where we can do this. We could do this on the server itself or we could do it locally by connecting to the server. We will discuss here on how to compile in our local machine by connecting to the server.

Follow the step below for compiling:
Stop Siebel Services
Copy the srf file from the server on to the local machine
Login into Siebel tools by connecting to the Server as shown in the screen shot below.


The server connectivity information is stored in the config file. Check the config file if you have any problems connecting to the server.
After logging in, under menu choose Tools -> Compile. Choose the projects you would like to compile.
Under Siebel repository file, browse for the srf file you copied in the previous step and hit compile
Back up the srf file on the server (Just for possible rollback)
Replace the srf file on the server with the new srf file that was just compiled
Start Siebel services.
After the above steps all the changes should be now available on the server. Logon to the thin client and test.

Configuring a WebLogic Domain and Server

What this Setup is about
A domain is an interrelated set of WebLogic Server resources managed as a unit.  A domain includes one or more administration servers and managed servers.  Various clients use the administration server to configure the system.  The managed server is used to run actual applications.
We will use the Domain Configuration wizard to create a new domain called mydomain.
What You Should Be Able to Do
Following this setup, you should be able to configure a new domain using the Configuration Wizard.

Instructions

1.    Create a Domain
From the Start menu select Programs -> BEA WebLogic Platform 8.1  -> Configuration Wizard.   This will launch the tool.
From the first screen, select Create a new WebLogic configuration and then click Next.

 


From the list of Configuration Templates select Basic WebLogic Server Domain. 

Select Custom for Configuration type.  Click Next.

You will be prompted to enter a name for the new administration server.  Enter AdminServer and click Next.

The Configuration Wizard will then ask if you would like to have your WebLogic configuration distributed across managed servers, clusters and physical machines.  Click Yes and Next.

You will now specify the creation of a Managed Server. Click the Add button in the top right corner, and specify the name of the new server to be myserver.  Change the Listen Port to 7005 and then click Next.

We will not configure a Cluster at this time, so simply click Next on the Configure Clusters screen.

Machines will not be configured at this time, so click Next on the Configure Machines screen.

Similarly, Database Options will also be configured in a later lab, so for now simply select No and then click Next  on the Database (JDBC) Options screen.

On the Messaging (JMS) Options screen, select No and then click Next. Messaging and JMS will be configured in a future lab. 
You will then be asked to specify the administrative username and password for the new domain. Enter weblogic for both username and password.  Click Next.
You will now have the option to Configure Windows Options. Select Yes in the left pane (so we can have a start menu shortcut) and select No in the right pane so that WebLogic Server will not run as a service. Click Next.
The Configuration Wizard will ask you to Build Start Menu Entries. Accept the defaults by clicking Next.

You will then be asked to Configure Server Start Mode and Java SDK. Set the WebLogic Configuration Start Mode to be Development Mode by selecting it in the left pane, and select the Sun SDK 1.4.1_03-ea @ C:\bea\jdk141_03 in the right pane.  Click Next.
You will now be asked to Create  the WebLogic Configuration.  Here you will specify the new domain’s name and install path.  We will name the domain mydomain (by entering it in the Configuration Name field in the bottom right corner) and choose the default location (which should automatically be set to c:\bea\user_projects\domains\ mydomain).  Click Create when done.
Congratulations!  You have created a WebLogic Server 8.1 domain.  The domain has an administrative server called AdminServer and one managed server called myserver.  Click Done on the Creating Configuration screen to exit the Configuration Wizard.
2.    Verify domain creation.
Using the file explorer, verify that the domain directory C:\bea\user_projects\domains\mydomain was created.  Verify the existence of the config.xml file and the startWebLogic.cmd file.  The latter is used to launch the Admin Server.
Start the Admin Server by selecting Start -> Programs -> BEA WebLogic Platform 8.1 -> User Projects -> mydomain -> Start Server.  Wait until you see a Server started in RUNNING mode message.
Next, we will launch the admin console.  Using a Web browser, open the Administration Console with the URL:
http://localhost:7001/console
You  should be presented with a login page.  Specify username and password to be weblogic and then click on Sign In to login.  This will bring up the administration console or adminconsole.
 In the left pane of the administration console, click on Servers to view the status of the two servers we have created.  Note that the status of AdminServer is RUNNING while the status of myserver is UNKNOWN.   This is because myserver has not been started yet.
Next, launch the managed server myserver.  Open another DOS command window.  Change to c:/bea/user_projects/domains/mydomain.  Enter:
startManagedWebLogic myserver http://localhost:7001
Note the syntax of the command:
StartmanagedWebLogic  SERVER_NAME  ADMIN_SERVER_ADDRESS
MainServer server will begin to boot. Wait until you see the message “Server Started in RUNNING mode”.  In the admin console, click on Servers again to refresh the status.

Congratulations!  You have finished creating a domain complete with an administration server and a single managed server.  Now shutdown each server from the console and close the browser.

Perl interview question answers

Perl Interview Question.
1. How do you know the reference of a variable whether it is a reference,scaller, hash or
array?
Ans: there is a 'ref' function that lets you know
2. what is the difference between 'use' and 'require' function?
Ans:
Use: 1. the method is used only for modules (only to include .pm type file) 2. the included object are verified at the time of compilation. 3. No Need to give file extentsion.
Require: 1. The method is used for both libraries ( package ) and modules
2. The include objects are verified at the run time.
3. Need to give file Extension.
3. What is the use of 'chomp' ? what is the difference between 'chomp' and 'chop'?
Ans. 'chop' functiononly removes the last character completely 'from the scaler, where as 'chomp' function only removes the last character if it is a newline. by default, chomp only removes what is currently defined as the $INPUT_RECORD_SEPARATOR. Whenever you call 'chomp ', it checks the value of a special variable '$/'. whatever the value of '$/' is eliminated from the scaler. by default the value of '$/' is 'n'
 4. Print this array @arr in reversed case-insensitive order
Ans> @solution = sort {lc $a comp lc$b } @arr.
5. What is '->' in Perl?
Ans. it is a symbolic link to link one file name to a new name. so lets say we do it like
file1-> file2, if we read file1, we end up reading file2.
 6. how do you check the return code of system call?
Ans. System calls "traditionally" returns 9 when successful and 1 when it fails. System (cmd) or die "Error in command";
 7. #create directory if not there
if (! -s "$temp/engl_2/wf"){ System "mkdir -p $temp/engl_2/wf"; } if (! -s
"$temp/backup_basedir"){ system "mkdir -p $temp/backup_basedir"; } ${pack_2} = -M
Ads by Google
"${temp}/engl_2/wf/${wf_package_name}.data"; ${new_pack}= -M
"{pack}/package.data";
What is the use of -M and -s in the above script?
Ans. -s means is filename a non-empty file -M how long since filename modified?
8. How to substitute a particular string in a file containing million of record? Ans. perl -p -ibak -e 's/search_str/replace_str/g' filename –
9. I have a variable named $objref which is defined in main package. I want to make it as a Object of class XYZ. how could I do it?
Ans. use XYZ my $objref =XYZ -> new() OR, bless $objref, 'XYZ';
10. what is meant by a 'pack' in perl?
Ans. Pack Converts a list into a binary representation. Takes an array or list of values and packs it into a binary structure, returning the string containing the structure It takes a LIST of values and converts it into a string. The string contaings a con-catenation of the
converted values. Typically, each converted values looks like its machine-level
repesentation. for example, on 32-bit machines a converted integer may be representated
by a sequence of 4 bytes.
 11. how to implement stack in Perl?
Ans. through push() and shift() function. push adds the element at the last of array and
shift() removes from the beginning of an array.
 12. What is Grep used for in Perl?
Ans. Grep is used with regular expression to check if a parituclar value exist in an array.
it returns 0 it the value does not exists, 1 otherwise.
-- 13. How to code in Perl to implement the tail function in unix?
And. You have to maintain a structure to store the line number and the size of the file at
that time eg. 1-10bytes, 2-18bytes.. you have a counter to increase the number of lines to
find out the number of lines in the file. once you are through the file, you will know the
size of the file at any nth line, use 'sysseek' to move the file pointer back to that position
(last 10) and thens tart reading till the end.

14. Explain the difference between 'my' and 'local' variable scope declarations?
Ans. Both of them are used to declare local variables. The variables declared with 'my'
can live only within the block and cannot gets its visibility inherited fucntions called
within that block, but one defined as 'local' canlive within the block and have its visibility
in the functions called within that block.
- 15. How do you navigate thorugh an XML documents?
Ans. You can use the XML::DOM navigation methods to navigate thorugh an
XML::DOM node tree and use the getnodevalue to recover the data. DOM Parser is used
when it is neede to do node operation. Instead we may use SAX parser if you require
simple processing of the xml structure.
-- 16. How to delete an entire directory containing few files in the directory?
Ans. rmtree($dir); OR, you can use CPAN module File::Remove Though it sounds like
deleting file but it can be used also for deleting directories. &File::Removes::remove
(1,$feed-dir,$item_dir);
 17. What are the arguements we normally use for Perl Interpreter
Ans. -e for Execute, -c to compile, -d to call the debugger on the file specified, -T for
traint mode for security/input checking -W for show all warning mode (or -w to show
less warning)
 -18. what is it meants by '$_'? Ans. it is a default variable which holds automatically, a list of arguements passed to the subroutine within parentheses.  -- 19. How to connect to sql server through Perl?
Ans. We use the DBI(Database Independent Interface) module to connect to any
database.
use DBI;
$dh = DBI->connect("dbi:mysql:database=DBname","username","password");
$sth = $dh->prepare("select name, symbol from table"); $sth->execute(); while(@row = $sth->fetchrow_array())
{ print "name =$row[0].symbol= $row[1]; }
$dh->disconnect
$dh=DBI->connect("dbi:mysql")
 20. What is the purpose of -w,strict and -T?
Ans. -w option enables warning - strict pragma is used when you should declare variables
before their use -T is taint mode. TAint mode makes a program more secure by keeping
track of arguments which are passed from external source.
- 21. What is the difference between die and exit?
Ans. Die prints out stderr message in the terminal before exiting the program while exit
just terminate the program without giving any message. Die also can evaluate expressions
before exiting.--
22. where do you go for perl help?
Ans. perldoc command with -f option is the best. i also go to search.cpan.org for help. - 23.
what is the Tk module? Ans. it provides a GUI interface –
24. what is your favorite module in Perl?
Ans. CGI and DBI. CGI(Common Gateway Interface) because we do not need to worry
about the subtle features of form processing.
-- 25. What is hash in perl?
Ans. A hash is like an associative array, in that it is a collection of scalar data, with individual elements selected by some index value which essentially are scallars and called as keys. Each key corresponds to some value. Hashes are represented by %followed by some name.
- 26.what does 'qw()' mean? what's the use of it?
Ans. qw is a construct which quotes words delimited by spaces. use it when you have long list of words that are nto quoted or youjust do not want to type those quotes as
youtype out a list of space delimited words. like @a = qw(1234) which is like
@a=("1","2","3","4");

- 27. what is the difference between Perl and shell script?
Ans. whatever you can do in shell script can be done in Perl.
however 1. Perl gives you an extended advantages of having enormous library.
2. you do not need to write everything from scartch.-
28. what is stderr() in perl? Ans. special file handler to standard error in any package. –
29. what is a regular expression? Ans. it defines a pattern for a search to match.
-- 30. what is the difference between for and foreach? Ans. functionally, there is no difference between them.
 31, what is the difference between exec and system?
Ans. exec runs the given process, switches to its name and never returns while system forks off the given process, waits for its to complete and then return.
 32. What is CPAN?
Ans. CPAN is comprehensive Perl Archive Network. its a repository contains thousands of Perl Modules, source and documentation, and all under GNU/GPL or smilar licence. you can go to http://www.cpan.org/ for more details. Some linux distribution provide a till
names 'cpan; which you can install packages directly from cpan.
 33. what does this symbol mean '->'?
Ans. In Perl it is an infix dereference operator. for array subscript, or a hash key, or a subroutine, then the ihs must be a reference. can also be used as method invocation.
 34. what is a DataHash()
Ans. in Win32::ODBC, DataHash() function is used to get the data fetched thorugh the sql statement in a hash format.
- 35. what is the difference between C and Perl? Ans. make up
- 36. Perl regular exp are greedy. what is it mean by that?
 Ans. it tries to match the longest string possible.
- 37. what does the world '&my variable' mean? Ans. &myvariable is calling a sub-routine. & is used to indentify a subroutine.
- 38, what is it meant by @ISA, @EXPORT, @EXPORT_0?
Ans @ISA -> each package has its own @ISA array. this array keep track of classes it is inheriting. ex: package child; @ISA=( parentclass);
@EXPORT this array stores the subroutins to be exported from a module. @EXPORT_OK this array stores the subroutines to be exported only on request.
 39.what package you use to create a windows services?
ans. use Win32::OLE.
 40, How to start Perl in interactive mode? Ans. perl -e -d 1 PerlConsole.
- 41. How do I set environment variables in Perl programs?
Ans. you can just do something like this: $ENV{'PATH'} = '...'; As you may remember, "%ENV" is a special hash in Perl that contains the value of all your environment variables. Because %ENV is a hash, you can set environment variables just as you'd set the value of any Perl hash variable. Here's how you can set your PATH variable to make sure the following four directories are in your path:: $ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin:/home/yourname/bin';

 42. what is the difference between C++ and Perl?
Ans. Perl can have objects whose data cannot be accessed outside its class, but C++ cannot.
Perl can use closures with unreachable private data as objects, and C++ doesn't
support closures. Furthermore, C++ does support pointer arithmetic via `int *ip =
(int*)&object', allowing you do look all over the object. Perl doesn't have pointer
arithmetic. It also doesn't allow `#define private public' to change access rights to foreign
objects. On the other hand, once you start poking around in /dev/mem, no one is safe.
 - 43. How to open and read data files with Perl?
Ans. Data files are opened in Perl using the open() function. When you open a data file,
all you have to do is specify (a) a file handle and (b) the name of the file you want to read
from. As an example, suppose you need to read some data from a file named
"checkbook.txt". Here's a simple open statement that opens the checkbook file for read access:
open (CHECKBOOK, "checkbook.txt");
In this example, the name "CHECKBOOK" is the file handle that you'll use later when reading from the checkbook.txt data file. Any time you want to read data from the checkbook file, just use the file handle named "CHECKBOOK". Now that we've opened the checkbook file, we'd like to be able to read what's in it. Here's how to read one line of data from the checkbook file: $record = < CHECKBOOK > ; After this statement is executed, the variable $record
contains the contents of the first line of the checkbook file. The "<>" symbol is called the line reading operator. To print every record of information from the checkbook file
open (CHECKBOOK, "checkbook.txt") || die "couldn't open the file!";
 while ($record = < CHECKBOOK >)
 { print $record; }
 close(CHECKBOOK);
 - 44. How do i do fill_in_the_blank for each file in a directory?
Ans.
 #!/usr/bin/perl -w opendir(DIR, ".");
 @files = readdir(DIR);
  closedir(DIR);
 foreach
 $file (@files) { print "$file\n"; }
  45. how do i generate a list of all .html files in a directory
Ans. here is a snippet of code that just prints a listing of every file in teh current directory.
that ends with the entension
#!/usr/bin/perl -w opendir(DIR, ".");
@files = grep(/\.html$/,readdir(DIR));
closedir(DIR);
 foreach $file (@files) { print "$file\n"; }
--

46. what is Perl one-liner?
Ans. There are two ways a Perl script can be run: --from a command line, called one- liner,
that means you type and execute immediately on the command line. You'll need the
-e option to start like "C:\ %gt perl -e "print \"Hello\";". One-liner doesn't mean one Perl
statement. One-liner may contain many statements in one line. --from a script file, called
Perl program.
-- 47, Assume both a local($var) and a my($var) exist, what's the difference between ${var}
and ${"var"}?
Ans. ${var} is the lexical variable $var, and ${"var"} is the dynamic variable $var. Note
that because the second is a symbol table lookup, it is disallowed under `use strict "refs"'.
The words global, local, package, symbol table, and dynamic all refer to the kind of
variables that local() affects, whereas the other sort, those governed by my(), are
variously knows as private, lexical, or scoped variable.
-- 48. What happens when you return a reference to a private variable?
ans. Perl keeps track of your variables, whether dynamic or otherwise, and doesn't free
things before you're done using them
 49. What are scalar data and scalar variables?
Ans. Perl has a flexible concept of data types. Scalar means a single thing, like a number or string. So the Java concept of int, float, double and string equals to Perl\'s scalar in concept and the numbers and strings are xchangeable. Scalar variable is a Perl variable that is used to store scalar data. It uses a dollar sign $ and followed by one or more aphanumeric characters or underscores. It is case sensitive.
  50. Assuming $_ contains HTML, which of the following substitutions will remove all tags in it?
Ans. You can't do that. If it weren't for HTML comments, improperly formatted HTML, and tags with interesting data like < SCRIPT >, you could do this. Alas, you cannot. It takes a lot more smarts, and quite frankly, a real parser.
  51. I want users send data by formmail but when they send nothing or call it from web site they will see error. codes in PHP like this: if (isset($HTTP_POST_VARS)){.......... }
else{ echo ("error lalalalal") } How it will look in perl?
Ans. In perl if ($ENV{'REQUEST_METHOD'} eq 'POST'){..... }
 -52. What is the output of the following Perl program?
1 $p1 = "prog1.java";
2 $p1 =~ s/(.*)\.java/$1.cpp/;
3 print "$p1\n";
Ans. prog1.cpp  53.
Why aren't Perl's patterns regular expressions?
Ans. Because Perl patterns have backreferences. A regular expression by definition must
be able to determine the next state in the finite automaton without requiring any extra
memory to keep around previous state. A pattern /([ab]+)c\1/ requires the state machine to
remember old states, and thus disqualifies such patterns as being regular expressions in
the classic sense of the term.
 -54. What does Perl do if you try to exploit the execve(2) race involving setuid scripts? Ans. Sends mail to root and exits. It has been said that all programs advance to the point
of being able to automatically read mail. While not quite at that point (well, without
having a module loaded), Perl does at least automatically send it.
 -- 55. How do I do < fill-in-the-blank > for each element in a hash?
Ans. Here's a simple technique to process each element in a hash: #!/usr/bin/perl -w
%days = ( 'Sun' =>'Sunday', 'Mon' => 'Monday', 'Tue' => 'Tuesday', 'Wed' =>
'Wednesday', 'Thu' => 'Thursday', 'Fri' => 'Friday', 'Sat' => 'Saturday' ); foreach $key (sort keys %days)
{ print "The long name for $key is $days{$key}.\n"; }
-- 57. How do I sort a hash by the hash key?
Ans. Suppose we have a class of five students.Their names are kim, al, rocky, chrisy, and
jane. Here's a test program that prints the contents of the grades hash, sorted by student
name: #!/usr/bin/perl -w %grades = ( kim => 96, al => 63, rocky => 87, chrisy => 96,
jane => 79, ); print "\n\tGRADES SORTED BY STUDENT NAME:\n"; foreach $key
(sort (keys(%grades))) { print "\t\t$key \t\t$grades{$key}\n"; } The output of this
program looks like this: GRADES SORTED BY STUDENT NAME: al 63 chrisy 96 jane
79 kim 96 rocky 87 }
- 58. How do you print out the next line from a filehandle with all its bytes reversed?
Ans. print scalar reverse scalar Surprisingly enough, you have to put both the reverse and
the into scalar context separately for this to work.
 -- 59. How do I send e-mail from a Perl/CGI program on a Unix system?
Ans. Sending e-mail from a Perl/CGI program on a Unix computer system is usually
pretty simple. Most Perl programs directly invoke the Unix sendmail program. We'll go
through a quick example here.Assuming that you've already have e-mail information you
need, such as the send-to address and subject, you can use these next steps to generate
and send the e-mail message: # the rest of your program is up here ... open(MAIL, "|
/usr/lib/sendmail -t"); print MAIL "To: $sendToAddress\n"; print MAIL "From:
$myEmailAddress\n"; print MAIL "Subject: $subject\n"; print MAIL "This is the
message body.\n"; print MAIL "Put your message here in the body.\n"; close (MAIL);
  60. How to read from a pipeline with Perl?
Ans. To run the date command from a Perl program, and read the output of the command,
all you need are a few lines of code like this: open(DATE, "date|"); $theDate = ;
close(DATE); The open() function runs the external date command, then opens a file
handle DATE to the output of the date command. Next, the output of the date command is
read into the variable $theDate through the file handle DATE. Example 2: The following
code runs the "ps -f" command, and reads the output: open(PS_F, "ps -f|"); while ()
{ ($uid,$pid,$ppid,$restOfLine) = split; # do whatever I want with the variables here ... }
close(PS_F);
- 61. Why is it hard to call this function: sub y { "because" }
Ans. Because y is a kind of quoting operator. The y/// operator is the sed-savvy synonym
for tr///. That means y(3) would be like tr(), which would be looking for a second string,
as in tr/a-z/A-Z/, tr(a-z)(A-Z), or tr[a-z][A-Z].
- 62. What does `$result = f() .. g()' really return?
Ans. False so long as f() returns false, after which it returns true until g() returns true, and
then starts the cycle again. This is scalar not list context, so we have the bistable flip-flop
range operator famous in parsing of mail messages, as in `$in_body = /^$/ .. eof()'.
Except for the first time f() returns true, g() is entirely ignored, and f() will be ignored
while g() later when g() is evaluated. Double dot is the inclusive range operator, f() and
g() will both be evaluated on the same record. If you don't want that to happen, the
exclusive range operator, triple dots, can be used instead. For extra credit, describe this:
$bingo = ( a() .. b() ) ... ( c() .. d() );
 63. Why does Perl not have overloaded functions?
Ans. Because you can inspect the argument count, return context, and object types all by
yourself. In Perl, the number of arguments is trivially available to a function via the scalar
sense of @_, the return context via wantarray(), and the types of the arguments via ref() if
they're references and simple pattern matching like /^\d+$/ otherwise. In languages like
C++ where you can't do this, you simply must resort to overloading of functions.
- 64. What does read() return at end of file?
Ans. 0 A defined (but false) 0 value is the proper indication of the end of file for read()
and sysread().
-- 65. What does `new $cur->{LINK}' do? (Assume the current package has no new()
function of its own.)
Ans. $cur->new()->{LINK} The indirect object syntax only has a single token
lookahead. That means if new() is a method, it only grabs the very next token, not the
entire following expression. This is why `new $obj[23] arg' does't work, as well as why
`print $fh[23] "stuff\n"' does't work. Mixing notations between the OO and IO notations
is perilous. If you always use arrow syntax for method calls, and nothing else, you'll not
be surprised.
 66. How do I sort a hash by the hash value?
Ans. Here's a program that prints the contents of the grades hash, sorted numerically by
the hash value: #!/usr/bin/perl -w # Help sort a hash by the hash 'value', not the 'key'. to
highest). sub hashValueAscendingNum { $grades{$a} <=> $grades{$b}; } # Help sort a
hash by the hash 'value', not the 'key'. # Values are returned in descending numeric order
# (highest to lowest). sub hashValueDescendingNum { $grades{$b} <=> $grades{$a}; }
%grades = ( student1 => 90, student2 => 75, student3 => 96, student4 => 55, student5 =>
76, ); print "\n\tGRADES IN ASCENDING NUMERIC ORDER:\n"; foreach $key (sort
hashValueAscendingNum (keys(%grades))) { print "\t\t$grades{$key} \t\t $key\n"; }
print "\n\tGRADES IN DESCENDING NUMERIC ORDER:\n"; foreach $key (sort
hashValueDescendingNum (keys(%grades))) { print "\t\t$grades{$key} \t\t $key\n"; }
-
67. How to read file into hash array ?
Ans. open(IN, ") { chomp; $hash_table{$_} = 0; } close IN; print "$_ =
$hash_table{$_}\n" foreach keys %hash_table;
 68. how do find the length of an array? Ans. $@array  -69, What value is returned by a lone `return;' statement? Ans. The undefined value in scalar context, and the empty list value () in list context.
This way functions that wish to return failure can just use a simple return without
worrying about the context in which they were called.
 -70. What's the difference between /^Foo/s and /^Foo/? Ans. The second would match Foo other than at the start of the record if $* were set. The deprecated $* flag does double duty, filling the roles of both /s and /m. By using /s, you suppress any settings of that spooky variable, and force your carets and dollars to match only at the ends of the string and not at ends of line as well -- just as they would if $* weren't set at all.
  71. Does Perl have reference type?
Ans. Yes. Perl can make a scalar or hash type reference by using backslash operator. For
example $str = "here we go"; # a scalar variable $strref = \$str; # a reference to a scalar
@array = (1..10); # an array $arrayref = \@array; # a reference to an array Note that the
reference itself is a scalar.
 72. How to dereference a reference?
Ans. There are a number of ways to dereference a reference. Using two dollar signs to
dereference a scalar. $original = $$strref; Using @ sign to dereference an array. @list =
@$arrayref; Similar for hashes.
-
73. What does length(%HASH) produce if you have thirty-seven random keys in a newly
created hash?
Ans.5 length() is a built-in prototyped as sub length($), and a scalar prototype silently
changes aggregates into radically different forms. The scalar sense of a hash is false (0) if
it's empty, otherwise it's a string representing the fullness of the buckets, like "18/32" or
"39/64". The length of that string is likely to be 5. Likewise, `length(@a)' would be 2 if
there were 37 elements in @a.
 74. If EXPR is an arbitrary expression, what is the difference between $Foo::{EXPR}
and *{"Foo::".EXPR}?
Ans. The second is disallowed under `use strict "refs"'. Dereferencing a string with
*{"STR"} is disallowed under the refs stricture, although *{STR} would not be. This is
similar in spirit to the way ${"STR"} is always the symbol table variable, while ${STR}
may be the lexical variable. If it's not a bareword, you're playing with the symbol table in
a particular dynamic fashion.
- 75. How do I do < fill-in-the-blank > for each element in an array?
Ans. #!/usr/bin/perl -w @homeRunHitters = ('McGwire', 'Sosa', 'Maris', 'Ruth'); foreach
(@homeRunHitters) { print "$_ hit a lot of home runs in one year\n"; }
-- 76. How do I replace every character in a file with a comma? Ans. perl -pi.bak -e 's/\t/,/g' myfile.txt  77. What is the easiest way to download the contents of a URL with Perl?
Ans. Once you have the libwww-perl library, LWP.pm installed, the code is this:
#!/usr/bin/perl use LWP::Simple; $url = get 'http://www.websitename.com/';
- 78. how to concatinate strings in Perl? Ans. through . operator.
79. How do I read command-line arguments with Perl?
Ans. With Perl, command-line arguments are stored in the array named @ARGV.
$ARGV[0] contains the first argument, $ARGV[1] contains the second argument, etc.
$#ARGV is the subscript of the last element of the @ARGV array, so the number of
arguments on the command line is $#ARGV + 1. Here's a simple program: #!/usr/bin/perl
$numArgs = $#ARGV + 1; print "thanks, you gave me $numArgs command-line
arguments.\n"; foreach $argnum (0 .. $#ARGV) { print "$ARGV[$argnum]\n"; }
  80. When would `local $_' in a function ruin your day?
Ans. When your caller was in the middle for a while(m//g) loop The /g state on a global
variable is not protected by running local on it. That'll teach you to stop using locals. Too
bad $_ can't be the target of a my() -- yet.
  81. What happens to objects lost in "unreachable" memory..... ?
Ans. What happens to objects lost in "unreachable" memory, such as the object returned
by Ob->new() in `{ my $ap; $ap = [ Ob->new(), \$ap ]; }' ? Their destructors are called
when that interpreter thread shuts down. When the interpreter exits, it first does an
exhaustive search looking for anything that it allocated. This allows Perl to be used in
embedded and multithreaded applications safely, and furthermore guarantees correctness
of object code.
 -- 82. Assume that $ref refers to a scalar, an array, a hash or to some nested data structure.
Explain the following statements:
Ans. $$ref; # returns a scalar $$ref[0]; # returns the first element of that array $ref- > [0];
# returns the first element of that array @$ref; # returns the contents of that array, or
number of elements, in scalar context $&$ref; # returns the last index in that array $ref- >
[0][5]; # returns the sixth element in the first row @{$ref- > {key}} # returns the
contents of the array that is the value of the key "key"
- 83. How do you match one letter in the current locale?
Ans. /[^\W_\d]/ We don't have full POSIX regexps, so you can't get at the isalpha() macro
save indirectly. You ask for one byte which is neither a non-alphanumunder, nor an under,
nor a numeric. That leaves just the alphas, which is what you want.
 -- 84. How do I print the entire contents of an array with Perl?
 Ans. To answer this question, we first need a sample array. Let's assume that you have an
array that contains the name of baseball teams, like this: @teams = ('cubs', 'reds',
'yankees', 'dodgers'); If you just want to print the array with the array members separated
by blank spaces, you can just print the array like this: @teams = ('cubs', 'reds', 'yankees',
'dodgers'); print "@teams\n"; But that's not usually the case. More often, you want each
element printed on a separate line. To achieve this, you can use this code: @teams =
('cubs', 'reds', 'yankees', 'dodgers'); foreach (@teams) { print "$_\n"; }
 - 84. Perl uses single or double quotes to surround a zero or more characters. Are the
single(' ') or double quotes (" ") identical?
Ans. They are not identical. There are several differences between using single quotes
and double quotes for strings. 1. The double-quoted string will perform variable
interpolation on its contents. That is, any variable references inside the quotes will be
replaced by the actual values. 2. The single-quoted string will print just like it is. It
doesn't care the dollar signs. 3. The double-quoted string can contain the escape
characters like newline, tab, carraige return, etc. 4. The single-quoted string can contain
the escape sequences, like single quote, backward slash, etc.
 -- 85. How many ways can we express string in Perl?
Ans. Many. For example 'this is a string' can be expressed in: "this is a string" qq/this is a
string like double-quoted string/ qq^this is a string like double-quoted string^ q/this is a
string/ q&this is a string& q(this is a string)
 -86. How do you give functions private variables that retain their values between calls?
 Ans. Create a scope surrounding that sub that contains lexicals. Only lexical variables are
truly private, and they will persist even when their block exits if something still cares
about them. Thus: { my $i = 0; sub next_i { $i++ } sub last_i { --$i } } creates two
functions that share a private variable. The $i variable will not be deallocated when its
block goes away because next_i and last_i need to be able to access it.
  87. Explain the difference between the following in Perl: $array[3] vs. $array->[3]
Ans. because Perl's basic data structure is all flat, references are the only way to build
complex structures, which means references can be used in very tricky ways. This
question is easy, though. In $array[3], "array" is the (symbolic) name of an array
(@array) and $array[3] refers to the 4th element of this named array. In $array->[3],
"array" is a hard reference to a (possibly anonymous) array, i.e., $array is the reference to
this array, so $array->[3] is the 4th element of this array being referenced.
- 88, how to remove duplicates from an array?
Ans. There is one simple and elegant solution for removing duplicates from a list in
PERL @array = (2,4,3,3,4,6,2); my %seen = (); my @unique = grep { ! $seen{ $_ }++ }
@array; print "@unique";