<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1104661244505416045</id><updated>2011-11-27T16:33:27.508-08:00</updated><category term='How to code in Perl to implement the tail function in unix'/><category term='What is the difference between C++ and Perl'/><category term='How to connect to SQL server through Perl'/><category term='TK module'/><category term='chomp'/><category term='delete directory in perl'/><category term='ref'/><category term='Perl'/><category term='What is CPAN'/><category term='chop'/><category term='perl interview questions'/><category term='directory of html files'/><category term='array'/><category term='scaler'/><title type='text'>Perl Interview Questions and Answers- An interviewhelper.org blog</title><subtitle type='html'>This blog contains common Perl interview questions asked by different organizations.&lt;br&gt;&lt;br&gt;
For more such interview questions, please visit our website &lt;a href="http://interviewhelper.org"&gt;Interview Helper&lt;/a&gt;........&lt;a href="http://interviewhelper.org"&gt;&lt;img src="http://interviewhelper.org/images/interviewhelper.jpg" width="200" height="73" border="0"&gt;&lt;/a&gt;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>70</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-1282607503642516944</id><published>2010-03-16T14:26:00.000-07:00</published><updated>2010-03-16T14:27:21.413-07:00</updated><title type='text'>How do I do &lt; fill-in-the-blank &gt; for each element in an array?</title><content type='html'>Question: How do I do &lt; fill-in-the-blank &gt; for each element in an array?&lt;br /&gt;&lt;br /&gt;Answer: #!/usr/bin/perl -w @homeRunHitters = ('McGwire', 'Sosa', 'Maris', 'Ruth'); foreach (@homeRunHitters) { print "$_ hit a lot of home runs in one year\n"; }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-1282607503642516944?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/1282607503642516944/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-do-i-do-for-each-element-in-array.html#comment-form' title='34 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/1282607503642516944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/1282607503642516944'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-do-i-do-for-each-element-in-array.html' title='How do I do &lt; fill-in-the-blank &gt; for each element in an array?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>34</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-5733673514176495032</id><published>2010-03-16T14:05:00.000-07:00</published><updated>2010-03-16T14:26:23.430-07:00</updated><title type='text'>What is the easiest way to download the contents of a URL with Perl?</title><content type='html'>Question: What is the easiest way to download the contents of a URL with Perl?&lt;br /&gt;&lt;br /&gt;Answer: Once you have the libwww-perl library, LWP.pm installed, the code is this: #!/usr/bin/perl use LWP::Simple; $url = get 'http://www.interviewhelper.org/';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-5733673514176495032?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/5733673514176495032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/what-is-easiest-way-to-download.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5733673514176495032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5733673514176495032'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/what-is-easiest-way-to-download.html' title='What is the easiest way to download the contents of a URL with Perl?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-8907779360014546143</id><published>2010-03-16T14:04:00.000-07:00</published><updated>2010-03-16T14:05:45.255-07:00</updated><title type='text'>What does length(%HASH) produce if you have thirty-seven random keys in a newly created hash?</title><content type='html'>Question: What does length(%HASH) produce if you have thirty-seven random keys in a newly created hash?&lt;br /&gt;&lt;br /&gt;Answer: 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.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-8907779360014546143?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/8907779360014546143/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/what-does-lengthhash-produce-if-you.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/8907779360014546143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/8907779360014546143'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/what-does-lengthhash-produce-if-you.html' title='What does length(%HASH) produce if you have thirty-seven random keys in a newly created hash?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-2572313063389289646</id><published>2010-03-16T14:03:00.000-07:00</published><updated>2010-03-16T14:04:53.535-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='directory of html files'/><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><title type='text'>How can we generate a list of all .html files in a directory</title><content type='html'>Question: How can we generate a list of all .html files in a directory?&lt;br /&gt;&lt;br /&gt;Answer: 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"; }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-2572313063389289646?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/2572313063389289646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-can-we-generate-list-of-all-html.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/2572313063389289646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/2572313063389289646'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-can-we-generate-list-of-all-html.html' title='How can we generate a list of all .html files in a directory'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-7726440982545963453</id><published>2010-03-16T14:02:00.000-07:00</published><updated>2010-03-16T14:03:25.885-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is the difference between C++ and Perl'/><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><title type='text'>What is the difference between C++ and Perl?</title><content type='html'>Question: What is the difference between C++ and Perl?&lt;br /&gt;&lt;br /&gt;Answer: 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*)&amp;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.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-7726440982545963453?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/7726440982545963453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/what-is-difference-between-c-and-perl.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/7726440982545963453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/7726440982545963453'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/what-is-difference-between-c-and-perl.html' title='What is the difference between C++ and Perl?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-1073533826377572458</id><published>2010-03-16T14:01:00.000-07:00</published><updated>2010-03-16T14:02:30.081-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TK module'/><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><title type='text'>What is the TK module?</title><content type='html'>Question: What is the TK module?&lt;br /&gt;&lt;br /&gt;Answer: it provides a GUI interface&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-1073533826377572458?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/1073533826377572458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/what-is-tk-module.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/1073533826377572458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/1073533826377572458'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/what-is-tk-module.html' title='What is the TK module?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-3856348068072505057</id><published>2010-03-16T14:00:00.000-07:00</published><updated>2010-03-16T14:01:20.209-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How to connect to SQL server through Perl'/><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><title type='text'>How to connect to SQL server through Perl?</title><content type='html'>Question: How to connect to SQL server through Perl?&lt;br /&gt;&lt;br /&gt;Answer: We use the DBI(Database Independent Interface) module to connect to any database. use DBI; $dh = DBI-&gt;connect("dbi:mysql:database=DBname","username","password"); $sth = $dh-&gt; prepare("select name, symbol from table"); $sth-&gt;execute(); while(@row = $sth-&gt;fetchrow_array()){ print "name =$row[0].symbol= $row[1]; } $dh-&gt;disconnect $dh=DBI-&gt;connect("dbi:mysql")&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-3856348068072505057?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/3856348068072505057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-to-connect-to-sql-server-through.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/3856348068072505057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/3856348068072505057'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-to-connect-to-sql-server-through.html' title='How to connect to SQL server through Perl?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-4513299955290359591</id><published>2010-03-16T13:59:00.000-07:00</published><updated>2010-03-16T14:00:27.012-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><category scheme='http://www.blogger.com/atom/ns#' term='delete directory in perl'/><title type='text'>How to delete an entire directory containing few files in the directory?</title><content type='html'>Question: How to delete an entire directory containing few files in the directory?&lt;br /&gt;&lt;br /&gt;Answer: 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. &amp;File::Removes::remove (1,$feed-dir,$item_dir);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-4513299955290359591?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/4513299955290359591/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-to-delete-entire-directory.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/4513299955290359591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/4513299955290359591'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-to-delete-entire-directory.html' title='How to delete an entire directory containing few files in the directory?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-8008231161805421796</id><published>2010-03-16T13:58:00.001-07:00</published><updated>2010-03-16T13:58:55.986-07:00</updated><title type='text'>What is the use of -M and -s in the above script?</title><content type='html'>Question: &lt;br /&gt;#create directory if not there&lt;br /&gt;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 "${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?&lt;br /&gt;&lt;br /&gt;Answer: -s means is filename a non-empty file -M how long since filename modified?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-8008231161805421796?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/8008231161805421796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/what-is-use-of-m-and-s-in-above-script.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/8008231161805421796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/8008231161805421796'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/what-is-use-of-m-and-s-in-above-script.html' title='What is the use of -M and -s in the above script?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-8336448558102694000</id><published>2010-03-16T13:56:00.000-07:00</published><updated>2010-03-16T13:57:38.443-07:00</updated><title type='text'>Print this array @arr in reversed case-insensitive order?</title><content type='html'>Question: Print this array @arr in reversed case-insensitive order?&lt;br /&gt;&lt;br /&gt;Answer: @solution = sort {lc $a comp lc$b } @arr.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-8336448558102694000?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/8336448558102694000/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/print-this-array-arr-in-reversed-case.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/8336448558102694000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/8336448558102694000'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/print-this-array-arr-in-reversed-case.html' title='Print this array @arr in reversed case-insensitive order?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-8517422130032393421</id><published>2010-03-16T13:55:00.000-07:00</published><updated>2010-03-16T13:56:27.277-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='array'/><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><category scheme='http://www.blogger.com/atom/ns#' term='scaler'/><category scheme='http://www.blogger.com/atom/ns#' term='ref'/><title type='text'>How do you know the reference of a variable whether it is a reference, scaler, hash or array?</title><content type='html'>Question: How do you know the reference of a variable whether it is a reference, scaler, hash or array?&lt;br /&gt;&lt;br /&gt;Ans: There is a 'ref' function that lets you know&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-8517422130032393421?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/8517422130032393421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-do-you-know-reference-of-variable.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/8517422130032393421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/8517422130032393421'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-do-you-know-reference-of-variable.html' title='How do you know the reference of a variable whether it is a reference, scaler, hash or array?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-6750087079274620034</id><published>2010-03-16T13:53:00.000-07:00</published><updated>2010-03-16T13:55:13.893-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='chop'/><category scheme='http://www.blogger.com/atom/ns#' term='chomp'/><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><title type='text'>What is the use of 'chomp' ? what is the difference between 'chomp' and 'chop'?</title><content type='html'>Question: What is the use of 'chomp' ? what is the difference between 'chomp' and 'chop'?&lt;br /&gt;&lt;br /&gt;Answer: 'chop' functionally 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. &lt;br /&gt;By default the value of '$/' is 'n'&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-6750087079274620034?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/6750087079274620034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/what-is-use-of-chomp-what-is-difference.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/6750087079274620034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/6750087079274620034'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/what-is-use-of-chomp-what-is-difference.html' title='What is the use of &apos;chomp&apos; ? what is the difference between &apos;chomp&apos; and &apos;chop&apos;?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-6946082422444557737</id><published>2010-03-16T13:52:00.000-07:00</published><updated>2010-03-16T13:53:30.328-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><category scheme='http://www.blogger.com/atom/ns#' term='How to code in Perl to implement the tail function in unix'/><title type='text'>How to code in Perl to implement the tail function in unix?</title><content type='html'>Question: How to code in Perl to implement the tail function in unix?&lt;br /&gt;&lt;br /&gt;And. You have to maintain a structure to store the line number and the size of the file at that time e.g. 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 then tart reading till the end.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-6946082422444557737?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/6946082422444557737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-to-code-in-perl-to-implement-tail.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/6946082422444557737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/6946082422444557737'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-to-code-in-perl-to-implement-tail.html' title='How to code in Perl to implement the tail function in unix?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-598220569380329420</id><published>2010-03-16T13:51:00.000-07:00</published><updated>2010-03-16T13:52:25.475-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><category scheme='http://www.blogger.com/atom/ns#' term='What is CPAN'/><title type='text'>What is CPAN?</title><content type='html'>Question: What is CPAN?&lt;br /&gt;&lt;br /&gt;Answer: 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 www.cpan.org for more details. Some linux distribution provide a till names 'cpan; which you can install packages directly from cpan.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-598220569380329420?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/598220569380329420/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/what-is-cpan.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/598220569380329420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/598220569380329420'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/what-is-cpan.html' title='What is CPAN?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-3885088442355097933</id><published>2010-03-16T13:50:00.000-07:00</published><updated>2010-03-16T13:51:27.026-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><title type='text'>How to open and read data files with Perl?</title><content type='html'>Question: How to open and read data files with Perl?&lt;br /&gt;&lt;br /&gt;Answer: 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 = &lt; CHECKBOOK &gt; ; After this statement is executed, the variable $record contains the contents of the first line of the checkbook file. The "&lt;&gt;" 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 = &lt; CHECKBOOK &gt;) { print $record; } close(CHECKBOOK);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-3885088442355097933?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/3885088442355097933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-to-open-and-read-data-files-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/3885088442355097933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/3885088442355097933'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-to-open-and-read-data-files-with.html' title='How to open and read data files with Perl?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-5471496508194861445</id><published>2010-03-16T13:49:00.000-07:00</published><updated>2010-03-16T13:50:34.386-07:00</updated><title type='text'>If EXPR is an arbitrary expression, what is the difference between $Foo::{EXPR} and *{"Foo::".EXPR}?</title><content type='html'>Question: If EXPR is an arbitrary expression, what is the difference between $Foo::{EXPR} and *{"Foo::".EXPR}?&lt;br /&gt;&lt;br /&gt;Answer: The second is disallowed under `use strict "refs"'. De referencing 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 bare word, you're playing with the symbol table in a particular dynamic fashion.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-5471496508194861445?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/5471496508194861445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/if-expr-is-arbitrary-expression-what-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5471496508194861445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5471496508194861445'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/if-expr-is-arbitrary-expression-what-is.html' title='If EXPR is an arbitrary expression, what is the difference between $Foo::{EXPR} and *{&quot;Foo::&quot;.EXPR}?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-7121247009044271356</id><published>2010-03-16T13:47:00.000-07:00</published><updated>2010-03-16T13:49:24.298-07:00</updated><title type='text'>When would `local $_' in a function ruin your day?</title><content type='html'>Question: When would `local $_' in a function ruin your day?&lt;br /&gt;&lt;br /&gt;Answer: 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 will teach you to stop using locals.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-7121247009044271356?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/7121247009044271356/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/when-would-local-in-function-ruin-your.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/7121247009044271356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/7121247009044271356'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/when-would-local-in-function-ruin-your.html' title='When would `local $_&apos; in a function ruin your day?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-6563754596489066993</id><published>2010-03-16T13:46:00.000-07:00</published><updated>2010-03-16T13:47:28.762-07:00</updated><title type='text'>How do I sort a hash by the hash value?</title><content type='html'>Question: How do I sort a hash by the hash value?&lt;br /&gt;&lt;br /&gt;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} &lt;=&gt; $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} &lt;=&gt; $grades{$a}; } %grades = ( student1 =&gt; 90, student2 =&gt; 75, student3 =&gt; 96, student4 =&gt; 55, student5 =&gt; 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"; }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-6563754596489066993?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/6563754596489066993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-do-i-sort-hash-by-hash-value.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/6563754596489066993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/6563754596489066993'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-do-i-sort-hash-by-hash-value.html' title='How do I sort a hash by the hash value?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-1592861496310029715</id><published>2010-03-16T13:41:00.000-07:00</published><updated>2010-03-16T13:46:11.041-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><title type='text'>What does `new $cur-&gt;{LINK}' do?</title><content type='html'>Question: What does `new $cur-&gt;{LINK}' do? &lt;br /&gt;&lt;br /&gt;Answer: $cur-&gt;new()-&gt;{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.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-1592861496310029715?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/1592861496310029715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/what-does-new-cur-link-do.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/1592861496310029715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/1592861496310029715'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/what-does-new-cur-link-do.html' title='What does `new $cur-&gt;{LINK}&apos; do?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-3721346078713722572</id><published>2010-03-16T13:40:00.000-07:00</published><updated>2010-03-16T13:41:54.222-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><title type='text'>What is meant by a pack in perl?</title><content type='html'>Question: What is meant by a 'pack' in Perl?&lt;br /&gt;&lt;br /&gt;Answer: 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 contains a concatenation of the converted values. Typically, each converted values looks like its machine-level representation. for example, on 32-bit machines a converted integer may be representable by a sequence of 4 bytes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-3721346078713722572?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/3721346078713722572/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/what-is-meant-by-pack-in-perl.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/3721346078713722572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/3721346078713722572'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/what-is-meant-by-pack-in-perl.html' title='What is meant by a pack in perl?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-3404213414686254739</id><published>2010-03-16T13:38:00.001-07:00</published><updated>2010-03-16T13:39:41.804-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><title type='text'>How do I read command-line arguments with Perl?</title><content type='html'>Question: How do I read command-line arguments with Perl?&lt;br /&gt;&lt;br /&gt;Answer: 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"; }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-3404213414686254739?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/3404213414686254739/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-do-i-read-command-line-arguments_16.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/3404213414686254739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/3404213414686254739'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-do-i-read-command-line-arguments_16.html' title='How do I read command-line arguments with Perl?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-2960890696643128516</id><published>2010-03-16T13:38:00.000-07:00</published><updated>2010-03-16T13:39:41.191-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><title type='text'>How do I read command-line arguments with Perl?</title><content type='html'>Question: How do I read command-line arguments with Perl?&lt;br /&gt;&lt;br /&gt;Answer: 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"; }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-2960890696643128516?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/2960890696643128516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-do-i-read-command-line-arguments.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/2960890696643128516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/2960890696643128516'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-do-i-read-command-line-arguments.html' title='How do I read command-line arguments with Perl?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-3965721535915704392</id><published>2010-03-14T03:29:00.000-07:00</published><updated>2010-03-14T03:30:19.066-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>How do you navigate through an XML documents?</title><content type='html'>Question: How do you navigate through an XML documents?&lt;br /&gt;&lt;br /&gt;Answer: 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&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-3965721535915704392?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/3965721535915704392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-do-you-navigate-through-xml.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/3965721535915704392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/3965721535915704392'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-do-you-navigate-through-xml.html' title='How do you navigate through an XML documents?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-3395122897941249136</id><published>2010-03-14T03:28:00.000-07:00</published><updated>2010-03-14T03:29:23.807-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><title type='text'>What happens to objects lost in "unreachable" memory</title><content type='html'>Question: What happens to objects lost in "unreachable" memory..... ?&lt;br /&gt;&lt;br /&gt;Answer: What happens to objects lost in "unreachable" memory, such as the object returned by Ob-&gt;new() in `{ my $ap; $ap = [ Ob-&gt;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.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-3395122897941249136?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/3395122897941249136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/what-happens-to-objects-lost-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/3395122897941249136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/3395122897941249136'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/what-happens-to-objects-lost-in.html' title='What happens to objects lost in &quot;unreachable&quot; memory'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-6912562315801060225</id><published>2010-03-14T03:27:00.000-07:00</published><updated>2010-03-14T03:28:10.434-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><title type='text'>Assume that $ref refers to a scalar, an array, a hash or to some nested data structure. Explain the following statements?</title><content type='html'>Question: Assume that $ref refers to a scalar, an array, a hash or to some nested data structure. Explain the following statements:&lt;br /&gt;&lt;br /&gt;Answer: $$ref; # returns a scalar $$ref[0]; # returns the first element of that array $ref- &gt; [0]; # returns the first element of that array @$ref; # returns the contents of that array, or number of elements, in scalar context $&amp;$ref; # returns the last index in that array $ref- &gt; [0][5]; # returns the sixth element in the first row @{$ref- &gt; {key}} # returns the contents of the array that is the value of the key "key"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-6912562315801060225?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/6912562315801060225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/assume-that-ref-refers-to-scalar-array.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/6912562315801060225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/6912562315801060225'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/assume-that-ref-refers-to-scalar-array.html' title='Assume that $ref refers to a scalar, an array, a hash or to some nested data structure. Explain the following statements?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-4803358565513415430</id><published>2010-03-14T03:26:00.000-07:00</published><updated>2010-03-14T03:27:14.521-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><title type='text'>How do you match one letter in the current locale?</title><content type='html'>Question: How do you match one letter in the current locale?&lt;br /&gt;&lt;br /&gt;Answer: /[^\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.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-4803358565513415430?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/4803358565513415430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-do-you-match-one-letter-in-current.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/4803358565513415430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/4803358565513415430'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-do-you-match-one-letter-in-current.html' title='How do you match one letter in the current locale?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-5608998074589255109</id><published>2010-03-14T03:25:00.000-07:00</published><updated>2010-03-14T03:26:20.630-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><title type='text'>How do I print the entire contents of an array with Perl?</title><content type='html'>Question: How do I print the entire contents of an array with Perl?&lt;br /&gt;&lt;br /&gt;Answer: 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"; }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-5608998074589255109?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/5608998074589255109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-do-i-print-entire-contents-of-array.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5608998074589255109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5608998074589255109'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-do-i-print-entire-contents-of-array.html' title='How do I print the entire contents of an array with Perl?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-4453762642718399281</id><published>2010-03-14T03:24:00.000-07:00</published><updated>2010-03-14T03:25:27.662-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><title type='text'>Perl uses single or double quotes to surround a zero or more characters. Are the single(' ') or double quotes (" ") identical?</title><content type='html'>Question: Perl uses single or double quotes to surround a zero or more characters. Are the single(' ') or double quotes (" ") identical?&lt;br /&gt;&lt;br /&gt;Answer. 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.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-4453762642718399281?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/4453762642718399281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/perl-uses-single-or-double-quotes-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/4453762642718399281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/4453762642718399281'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/perl-uses-single-or-double-quotes-to.html' title='Perl uses single or double quotes to surround a zero or more characters. Are the single(&apos; &apos;) or double quotes (&quot; &quot;) identical?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-3341720983274410695</id><published>2010-03-14T03:23:00.000-07:00</published><updated>2010-03-14T03:24:34.740-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><title type='text'>How many ways can we express string in Perl?</title><content type='html'>Question: How many ways can we express string in Perl?&lt;br /&gt;Answer. 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&amp;this is a string&amp; q(this is a string)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-3341720983274410695?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/3341720983274410695/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-many-ways-can-we-express-string-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/3341720983274410695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/3341720983274410695'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-many-ways-can-we-express-string-in.html' title='How many ways can we express string in Perl?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-8669420375028726205</id><published>2010-03-14T03:22:00.000-07:00</published><updated>2010-03-14T03:23:19.924-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><title type='text'>How do you give functions private variables that retain their values between calls?</title><content type='html'>Question: How do you give functions private variables that retain their values between calls?&lt;br /&gt;Answer: 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.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-8669420375028726205?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/8669420375028726205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-do-you-give-functions-private.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/8669420375028726205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/8669420375028726205'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-do-you-give-functions-private.html' title='How do you give functions private variables that retain their values between calls?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-470749544861173345</id><published>2010-03-14T03:21:00.000-07:00</published><updated>2010-03-14T03:22:21.396-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><title type='text'>Explain the difference between the following in Perl: $array[3] vs. $array-&gt;[3]</title><content type='html'>Question: Explain the difference between the following in Perl: $array[3] vs. $array-&gt;[3]&lt;br /&gt;Answer: 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-&gt;[3], "array" is a hard reference to a (possibly anonymous) array, i.e., $array is the reference to this array, so $array-&gt;[3] is the 4th element of this array being referenced.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-470749544861173345?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/470749544861173345/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/explain-difference-between-following-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/470749544861173345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/470749544861173345'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/explain-difference-between-following-in.html' title='Explain the difference between the following in Perl: $array[3] vs. $array-&gt;[3]'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-3836628226035138734</id><published>2010-03-14T03:20:00.000-07:00</published><updated>2010-03-14T03:21:22.937-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl interview questions'/><title type='text'>How to remove duplicates from an array?</title><content type='html'>Question: How to remove duplicates from an array?&lt;br /&gt;Answer: 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";&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-3836628226035138734?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/3836628226035138734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-to-remove-duplicates-from-array.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/3836628226035138734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/3836628226035138734'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/how-to-remove-duplicates-from-array.html' title='How to remove duplicates from an array?'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-8825387136186218112</id><published>2010-03-14T03:18:00.000-07:00</published><updated>2010-03-14T03:20:18.965-07:00</updated><title type='text'>What is the difference between 'use' and 'require' function</title><content type='html'>Question: What is the difference between 'use' and 'require' function?&lt;br /&gt;Answer: &lt;br /&gt;Use: &lt;br /&gt;1. The method is used only for modules (only to include .pm type file) &lt;br /&gt;2. the included object are verified at the time of compilation. &lt;br /&gt;3. No Need to give file extension. &lt;br /&gt;Require: &lt;br /&gt;1. The method is used for both libraries ( package ) and modules &lt;br /&gt;2. The include objects are verified at the run time. &lt;br /&gt;3. Need to give file Extension.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-8825387136186218112?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/8825387136186218112/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/what-is-difference-between-use-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/8825387136186218112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/8825387136186218112'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2010/03/what-is-difference-between-use-and.html' title='What is the difference between &apos;use&apos; and &apos;require&apos; function'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-8462886342832366011</id><published>2009-02-26T00:10:00.000-08:00</published><updated>2009-02-26T00:11:43.479-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>What are scalar data and scalar variables</title><content type='html'>&lt;strong&gt;Question :What are scalar data and scalar variables?&lt;/strong&gt;&lt;br /&gt;Answer :Perl has a flexible concept of &lt;a href="http://interviewhelper.org/Art/628/73/Perl-Interview-Questions.html" target="undefined"&gt;data types&lt;/a&gt;. Scalar means a single thing, like a number or string. So the &lt;a href="http://interviewhelper.org/Art/628/73/Perl-Interview-Questions.html" target="undefined"&gt;Java&lt;/a&gt; concept of int, float, double and string equals to Perl's scalar in concept and the numbers and strings are exchangeable. Scalar variable is a Perl variable that is used to store scalar data. It uses a dollar sign $ and followed by one or more alphanumeric characters or underscores. It is case sensitive.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-8462886342832366011?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/8462886342832366011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-are-scalar-data-and-scalar.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/8462886342832366011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/8462886342832366011'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-are-scalar-data-and-scalar.html' title='What are scalar data and scalar variables'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-2071348376293869876</id><published>2009-02-26T00:09:00.000-08:00</published><updated>2009-02-26T00:10:33.539-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>How to turn on Perl warnings  Why is that important</title><content type='html'>&lt;strong&gt;Question :How to turn on Perl warnings? Why is that important?&lt;/strong&gt;&lt;br /&gt;Answer :Perl is very forgiving of strange and sometimes wrong code, which can mean hours spent searching for bugs and weird results. Turning on warnings helps uncover common mistakes and strange places and save a lot of debugging time in the long run. There are various ways of turning on Perl warnings: For Perl one-liner, use -w option on the command line. On &lt;a href="http://interviewhelper.org/Art/628/73/Perl-Interview-Questions.html" target="undefined"&gt;Unix&lt;/a&gt; or Windows, use the -w option in the shebang line (The first # line in the script). Note: Windows Perl interpreter may not require it. For other &lt;a href="http://interviewhelper.org/Art/628/73/Perl-Interview-Questions.html" target="undefined"&gt;systems&lt;/a&gt;, choose &lt;a href="http://interviewhelper.org/Art/796/73/Perl-Interview-Questions-3.html" target="_top"&gt;compiler&lt;/a&gt; warnings, or check compiler documentation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-2071348376293869876?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/2071348376293869876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/how-to-turn-on-perl-warnings-why-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/2071348376293869876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/2071348376293869876'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/how-to-turn-on-perl-warnings-why-is.html' title='How to turn on Perl warnings  Why is that important'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-2310279425269880655</id><published>2009-02-26T00:08:00.000-08:00</published><updated>2009-02-26T00:09:28.201-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>What happens when you return a reference to a private variable</title><content type='html'>&lt;strong&gt;Question :What happens when you return a reference to a private variable?&lt;/strong&gt;&lt;br /&gt;Answer :Perl keeps track of your variables, whether dynamic or otherwise, and doesn't free things before you're done using them.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-2310279425269880655?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/2310279425269880655/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-happens-when-you-return-reference.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/2310279425269880655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/2310279425269880655'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-happens-when-you-return-reference.html' title='What happens when you return a reference to a private variable'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-1606351633671524519</id><published>2009-02-26T00:06:00.000-08:00</published><updated>2009-02-26T00:08:03.538-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>How to dereference a reference</title><content type='html'>&lt;strong&gt;Question :How to dereference a reference?&lt;/strong&gt;&lt;br /&gt;Answer :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.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-1606351633671524519?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/1606351633671524519/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/how-to-dereference-reference.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/1606351633671524519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/1606351633671524519'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/how-to-dereference-reference.html' title='How to dereference a reference'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-968037547468534625</id><published>2009-02-26T00:05:00.000-08:00</published><updated>2009-02-26T00:06:50.932-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>Does Perl have reference type</title><content type='html'>&lt;strong&gt;Question :Does Perl have reference type?&lt;/strong&gt;&lt;br /&gt;Answer :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.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-968037547468534625?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/968037547468534625/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/does-perl-have-reference-type.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/968037547468534625'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/968037547468534625'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/does-perl-have-reference-type.html' title='Does Perl have reference type'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-1807702446320710532</id><published>2009-02-26T00:04:00.000-08:00</published><updated>2009-02-26T00:05:39.839-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>Explain about lists</title><content type='html'>&lt;strong&gt;Question :Explain about lists?&lt;/strong&gt;&lt;br /&gt;Answer :A list is a construct that associates data elements together and you can specify a list by enclosing those elements in parenthesis and separating them with commas. They could themselves be arrays, hashes or even other lists. Lists do not have a specific list data type.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-1807702446320710532?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/1807702446320710532/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/explain-about-lists.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/1807702446320710532'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/1807702446320710532'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/explain-about-lists.html' title='Explain about lists'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-2272385330430409396</id><published>2009-02-26T00:03:00.000-08:00</published><updated>2009-02-26T00:04:37.045-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>Explain about Typeglobs</title><content type='html'>&lt;strong&gt;Question :Explain about Typeglobs?&lt;/strong&gt;&lt;br /&gt;Answer :Type globs are another integral type in perl. A typeglob`s prefix derefrencer is *, which is also the wild card character because you can use typeglobs to create an alias for all types associated with a particular name. All kinds of manipulations are possible with typeglobs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-2272385330430409396?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/2272385330430409396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/explain-about-typeglobs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/2272385330430409396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/2272385330430409396'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/explain-about-typeglobs.html' title='Explain about Typeglobs'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-424417937704472823</id><published>2009-02-26T00:02:00.000-08:00</published><updated>2009-02-26T00:03:32.370-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>How does a “grep” function perform</title><content type='html'>&lt;strong&gt;Question :How does a “grep” function perform?&lt;/strong&gt;&lt;br /&gt;Answer :Grep returns the number of lines the expression is true. Grep returns a sublist of a list for which a specific criterion is true. This function often involves pattern matching. It modifies the elements in the original list.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-424417937704472823?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/424417937704472823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/how-does-grep-function-perform.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/424417937704472823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/424417937704472823'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/how-does-grep-function-perform.html' title='How does a “grep” function perform'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-8237066248437041577</id><published>2009-02-26T00:00:00.000-08:00</published><updated>2009-02-26T00:01:13.411-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>How do I generate a list of all .html files in a directory</title><content type='html'>&lt;strong&gt;Question :How do I generate a list of all .html files in a directory?&lt;/strong&gt;&lt;br /&gt;Answer :Here's a snippet of code that just prints a listing of every file in the current directory that ends with the extension .html: #!/usr/bin/perl -w opendir(DIR, "."); @files = grep(/.html$/,readdir(DIR)); closedir(DIR); foreach $file (@files) { print "$filen"; }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-8237066248437041577?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/8237066248437041577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/how-do-i-generate-list-of-all-html.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/8237066248437041577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/8237066248437041577'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/how-do-i-generate-list-of-all-html.html' title='How do I generate a list of all .html files in a directory'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-6399698008232357913</id><published>2009-02-25T23:56:00.000-08:00</published><updated>2009-02-25T23:59:56.402-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>How do you print out the next line from a filehandle with all its bytes reversed</title><content type='html'>&lt;strong&gt;Question :How do you print out the next line from a filehandle with all its bytes reversed?&lt;/strong&gt;&lt;br /&gt;Answer :print scalar reverse scalar Surprisingly enough, you have to put both the reverse and the into scalar context separately for this to work.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-6399698008232357913?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/6399698008232357913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/how-do-you-print-out-next-line-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/6399698008232357913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/6399698008232357913'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/how-do-you-print-out-next-line-from.html' title='How do you print out the next line from a filehandle with all its bytes reversed'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-5691747367589651778</id><published>2009-02-25T23:54:00.000-08:00</published><updated>2009-02-25T23:56:29.674-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>How do I do fill_in_the_blank for each file in a directory</title><content type='html'>&lt;strong&gt;Question :How do I do fill_in_the_blank for each file in a directory?&lt;/strong&gt;&lt;br /&gt;Answer :Here's code that just prints a listing of every file in the current directory: #!/usr/bin/perl -w opendir(DIR, "."); @files = readdir(DIR); closedir(DIR); foreach $file (@files) { print "$filen"; }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-5691747367589651778?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/5691747367589651778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/how-do-i-do-fillintheblank-for-each.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5691747367589651778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5691747367589651778'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/how-do-i-do-fillintheblank-for-each.html' title='How do I do fill_in_the_blank for each file in a directory'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-5581599374513750229</id><published>2009-02-25T23:53:00.000-08:00</published><updated>2009-02-25T23:54:27.172-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>What does Perl do if you try to exploit the execve(2) race involving setuid scripts</title><content type='html'>&lt;strong&gt;Question :What does Perl do if you try to exploit the execve(2) race involving setuid scripts?&lt;/strong&gt;&lt;br /&gt;Answer :&lt;a href="http://interviewhelper.org/Art/628/73/Perl-Interview-Questions.html" target="undefined"&gt;Sends mail&lt;/a&gt; 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.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-5581599374513750229?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/5581599374513750229/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-does-perl-do-if-you-try-to-exploit.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5581599374513750229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5581599374513750229'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-does-perl-do-if-you-try-to-exploit.html' title='What does Perl do if you try to exploit the execve(2) race involving setuid scripts'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-6990460155968011138</id><published>2009-02-25T23:52:00.000-08:00</published><updated>2009-02-25T23:53:13.282-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>How many ways can we express string in Perl</title><content type='html'>&lt;strong&gt;Question :How many ways can we express string in Perl?&lt;/strong&gt;&lt;br /&gt;Answer :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&amp;amp;this is a string&amp;amp; q(this is a string)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-6990460155968011138?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/6990460155968011138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/how-many-ways-can-we-express-string-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/6990460155968011138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/6990460155968011138'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/how-many-ways-can-we-express-string-in.html' title='How many ways can we express string in Perl'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-7496721756973001711</id><published>2009-02-25T23:50:00.000-08:00</published><updated>2009-02-25T23:52:16.425-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>How to open and read data files with Perl</title><content type='html'>&lt;strong&gt;Question :How to open and read data files with Perl ?&lt;/strong&gt;&lt;br /&gt;Answer :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 = &lt;&gt; ; After this statement is executed, the variable $record contains the contents of the first line of the checkbook file. The "&lt;&gt;" 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 = &lt;&gt;) { print $record; } close(CHECKBOOK);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-7496721756973001711?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/7496721756973001711/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/how-to-open-and-read-data-files-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/7496721756973001711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/7496721756973001711'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/how-to-open-and-read-data-files-with.html' title='How to open and read data files with Perl'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-1872626549278952446</id><published>2009-02-25T23:49:00.000-08:00</published><updated>2009-02-25T23:50:16.149-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>What are scalar variables</title><content type='html'>&lt;strong&gt;Question :What are scalar variables?&lt;/strong&gt;&lt;br /&gt;Answer :Scalar variables are what many &lt;a href="http://interviewhelper.org/Art/795/73/Perl-Interview-Questions-2.html" target="_top"&gt;programming languages&lt;/a&gt; refer to as simple variables. They hold a single data item, a number, a string, or a perl reference. Scalars are called scalars to differentiate them from constructs that can hold more than one item, like arrays.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-1872626549278952446?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/1872626549278952446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-are-scalar-variables.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/1872626549278952446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/1872626549278952446'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-are-scalar-variables.html' title='What are scalar variables'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-5906898275434289849</id><published>2009-02-25T23:48:00.000-08:00</published><updated>2009-02-25T23:49:04.435-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>What are the two different types of data Perl handles</title><content type='html'>&lt;strong&gt;Question :What are the two different types of data Perl handles?&lt;/strong&gt;&lt;br /&gt;Answer :Perl handles two types of data they are(i) Scalar Variables and(ii) ListsScalar variables hold a single data item whereas lists hold multiple data items.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-5906898275434289849?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/5906898275434289849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-are-two-different-types-of-data.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5906898275434289849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5906898275434289849'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-are-two-different-types-of-data.html' title='What are the two different types of data Perl handles'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-5832648620052742339</id><published>2009-02-25T23:40:00.000-08:00</published><updated>2009-02-25T23:42:22.646-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>Which of these is a difference between C++ and Perl</title><content type='html'>&lt;strong&gt;Question :Which of these is a difference between C++ and Perl?&lt;/strong&gt;&lt;br /&gt;Answer :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*)&amp;amp;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. &lt;!--[if !supportLineBreakNewLine]--&gt;&lt;!--[endif]--&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-5832648620052742339?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/5832648620052742339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/which-of-these-is-difference-between-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5832648620052742339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5832648620052742339'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/which-of-these-is-difference-between-c.html' title='Which of these is a difference between C++ and Perl'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-5185317904623180499</id><published>2009-02-25T23:32:00.000-08:00</published><updated>2009-02-25T23:33:32.775-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>How do I set environment variables in Perl programs</title><content type='html'>&lt;strong&gt;Question :How do I set environment variables in Perl programs?&lt;/strong&gt;&lt;br /&gt;Answer :you can just do something like this: $path = $ENV{'PATH'}; As you may remember, "%ENV" is a special hash in &lt;a href="http://interviewhelper.org/Art/628/73/Perl-Interview-Questions.html" target="undefined"&gt;Perl&lt;/a&gt; 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';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-5185317904623180499?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/5185317904623180499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/how-do-i-set-environment-variables-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5185317904623180499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5185317904623180499'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/how-do-i-set-environment-variables-in.html' title='How do I set environment variables in Perl programs'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-4620456623264602909</id><published>2009-02-25T23:31:00.000-08:00</published><updated>2009-02-25T23:32:20.220-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>Explain about returning values from subroutines (functions)</title><content type='html'>&lt;strong&gt;Question :Explain about returning values from subroutines (functions)?&lt;/strong&gt;&lt;br /&gt;Answer :The return value of the subroutine is the value of the last expression evaluated or you can explicitly use a return statement to exit the subroutine specifying the return value. That return value is evaluated in the appropriate content depending on the content of the subroutine call.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-4620456623264602909?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/4620456623264602909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/explain-about-returning-values-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/4620456623264602909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/4620456623264602909'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/explain-about-returning-values-from.html' title='Explain about returning values from subroutines (functions)'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-6327070708431453691</id><published>2009-02-25T23:29:00.000-08:00</published><updated>2009-02-25T23:31:35.303-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>Determine the difference between my and local</title><content type='html'>&lt;strong&gt;Question :Determine the difference between my and local?&lt;/strong&gt;&lt;br /&gt;Answer :The fundamental difference between my and local is that my creates a new variable, whereas local saves a copy of an existing variable.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-6327070708431453691?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/6327070708431453691/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/determine-difference-between-my-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/6327070708431453691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/6327070708431453691'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/determine-difference-between-my-and.html' title='Determine the difference between my and local'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-5031028542690809990</id><published>2009-02-25T23:28:00.000-08:00</published><updated>2009-02-25T23:29:09.464-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>What are the different types of eval statements</title><content type='html'>&lt;strong&gt;Question :What are the different types of eval statements?&lt;/strong&gt;&lt;br /&gt;Answer :There are two different types of eval statements they are eval EXPR and eval BLOCK. Eval EXPR executes an expression and eval BLOCK executes BLOCK. Eval Block executes an entire block, BLOCK. First one is used when you want your code passed in the expression and the second one is used to parse the code in the block.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-5031028542690809990?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/5031028542690809990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-are-different-types-of-eval.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5031028542690809990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5031028542690809990'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-are-different-types-of-eval.html' title='What are the different types of eval statements'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-3509269822412573738</id><published>2009-02-25T23:25:00.000-08:00</published><updated>2009-02-25T23:26:51.621-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>How to use the command shift</title><content type='html'>&lt;strong&gt;Question :How to use the command shift?&lt;/strong&gt;&lt;br /&gt;Answer :Shift array function shifts off the first value of the array and returns it, thereby shortening the array by one element and moving everything from one place to the left. If you don’t specify an array to shift, shift uses @ ARGV, the array of command line arguments passed to the script or the array named @-.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-3509269822412573738?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/3509269822412573738/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/how-to-use-command-shift.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/3509269822412573738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/3509269822412573738'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/how-to-use-command-shift.html' title='How to use the command shift'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-6665270972816629822</id><published>2009-02-25T23:24:00.000-08:00</published><updated>2009-02-25T23:25:47.843-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>Is there any way to add two arrays together</title><content type='html'>&lt;strong&gt;Question :Is there any way to add two arrays together?&lt;/strong&gt;&lt;br /&gt;Answer :Of course you can add two arrays together by using push function. The push function adds a value or values to the end of an array. The push function pushes the values of list onto the end of the array. Length of an array can be increased by the length of list.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-6665270972816629822?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/6665270972816629822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/is-there-any-way-to-add-two-arrays.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/6665270972816629822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/6665270972816629822'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/is-there-any-way-to-add-two-arrays.html' title='Is there any way to add two arrays together'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-5918666328251241235</id><published>2009-02-25T23:22:00.000-08:00</published><updated>2009-02-25T23:24:53.243-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>What are the different forms of goto in perl  Explain</title><content type='html'>&lt;strong&gt;Question :What are the different forms of goto in perl? Explain?&lt;/strong&gt;&lt;br /&gt;Answer :The three forms of goto are as follows. They are(i) Goto label(ii) Goto name(iii) Goto exprThe first form, goto LABEL, transfers execution to the statement labeled LABEL. The second form, goto EXPR, expects EXPR to evaluate to a label. The last form goto &amp;amp;name is used with subroutines. This goto statement is used only when there is a necessity as it can create havoc in a program.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-5918666328251241235?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/5918666328251241235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-are-different-forms-of-goto-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5918666328251241235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5918666328251241235'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-are-different-forms-of-goto-in.html' title='What are the different forms of goto in perl  Explain'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-9131641025925614553</id><published>2009-02-25T23:21:00.000-08:00</published><updated>2009-02-25T23:22:35.270-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>What is a short circuit operator</title><content type='html'>&lt;strong&gt;Question :What is a short circuit operator?&lt;/strong&gt;&lt;br /&gt;Answer :The C-Style operator, ll, performs a logical (or) operation and you can use it to tie logical clauses together, returning an overall value of true if either clause is true. This operator is called a short-circuit operator because if the left operand is true the right operand is not checked or evaluated.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-9131641025925614553?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/9131641025925614553/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-is-short-circuit-operator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/9131641025925614553'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/9131641025925614553'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-is-short-circuit-operator.html' title='What is a short circuit operator'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-7180701004929447691</id><published>2009-02-25T22:34:00.000-08:00</published><updated>2009-02-25T22:36:56.275-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>Which has the highest precedence, List or Terms? Explain</title><content type='html'>&lt;strong&gt;Question :Which has the highest precedence, List or Terms? Explain?&lt;/strong&gt;&lt;br /&gt;Answer :Terms have the highest precedence in perl. Terms include variables, quotes, expressions in parenthesis etc. List operators have the same level of precedence as terms. Specifically, these operators have very strong left word precedence.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-7180701004929447691?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/7180701004929447691/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/which-has-highest-precedence-list-or.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/7180701004929447691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/7180701004929447691'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/which-has-highest-precedence-list-or.html' title='Which has the highest precedence, List or Terms? Explain'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-6057590969097150588</id><published>2009-02-25T22:33:00.000-08:00</published><updated>2009-02-25T22:34:03.290-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>What are the different types of perl operators</title><content type='html'>&lt;strong&gt;Question :What are the different types of perl operators?&lt;br /&gt;&lt;/strong&gt;Answer :There are four different types of perl operators they are(i) Unary operator like the not operator(ii) Binary operator like the addition operator(iii) Tertiary operator like the conditional operator(iv) List operator like the print operator&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-6057590969097150588?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/6057590969097150588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-are-different-types-of-perl.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/6057590969097150588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/6057590969097150588'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-are-different-types-of-perl.html' title='What are the different types of perl operators'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-4943084396530215834</id><published>2009-02-25T22:32:00.000-08:00</published><updated>2009-02-25T22:33:19.720-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>What is meant by splicing arrays explain in context of list and scalar</title><content type='html'>&lt;strong&gt;Question :What is meant by splicing arrays explain in context of list and scalar?&lt;/strong&gt;&lt;br /&gt;Answer :Splicing an array means adding elements from a list to that array, possibly replacing elements now in the array. In list context, the splice function returns the elements removed from the array. In scalar context, the splice function returns the last element removed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-4943084396530215834?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/4943084396530215834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-is-meant-by-splicing-arrays_25.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/4943084396530215834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/4943084396530215834'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-is-meant-by-splicing-arrays_25.html' title='What is meant by splicing arrays explain in context of list and scalar'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-124403077156958412</id><published>2009-02-25T22:30:00.004-08:00</published><updated>2009-02-25T22:31:39.714-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>How do you work with array slices</title><content type='html'>&lt;strong&gt;Question :How do you work with array slices?&lt;/strong&gt;&lt;br /&gt;Answer :An array slice is a section of an array that acts like a list, and you indicate what elements to put into the slice by using multiple array indexes in square brackets. By specifying the range operator you can also specify a slice.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-124403077156958412?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/124403077156958412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/how-do-you-work-with-array-slices.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/124403077156958412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/124403077156958412'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/how-do-you-work-with-array-slices.html' title='How do you work with array slices'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-6068627621739094846</id><published>2009-02-25T22:30:00.003-08:00</published><updated>2009-02-25T22:30:51.835-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>What are the three ways to empty an array</title><content type='html'>&lt;strong&gt;Question :What are the three ways to empty an array?&lt;/strong&gt;&lt;br /&gt;Answer :The three different ways to empty an array are as follows1) You can empty an array by setting its length to a negative number.2) Another way of empting an array is to assign the null list ().3) Try to clear an array by setting it to undef, but be aware when you set to undef.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-6068627621739094846?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/6068627621739094846/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-are-three-ways-to-empty-array_25.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/6068627621739094846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/6068627621739094846'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-are-three-ways-to-empty-array_25.html' title='What are the three ways to empty an array'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-7270457634958574565</id><published>2009-02-25T22:30:00.001-08:00</published><updated>2009-02-25T22:30:51.484-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>What are the three ways to empty an array</title><content type='html'>&lt;strong&gt;Question :What are the three ways to empty an array?&lt;/strong&gt;&lt;br /&gt;Answer :The three different ways to empty an array are as follows1) You can empty an array by setting its length to a negative number.2) Another way of empting an array is to assign the null list ().3) Try to clear an array by setting it to undef, but be aware when you set to undef.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-7270457634958574565?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/7270457634958574565/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-are-three-ways-to-empty-array.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/7270457634958574565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/7270457634958574565'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-are-three-ways-to-empty-array.html' title='What are the three ways to empty an array'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-4951307102981646318</id><published>2009-02-25T22:29:00.000-08:00</published><updated>2009-02-25T22:30:12.574-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>What exactly is grooving and shortening of the array</title><content type='html'>&lt;strong&gt;Question :What exactly is grooving and shortening of the array?&lt;/strong&gt;&lt;br /&gt;Answer :You can change the number of elements in an array simply by changing the value of the last index of/in the array $#array. In fact, if you simply refer to a non existent element in an array perl extends the array as needed, creating new elements. It also includes new elements in its array.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-4951307102981646318?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/4951307102981646318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-exactly-is-grooving-and-shortening.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/4951307102981646318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/4951307102981646318'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-exactly-is-grooving-and-shortening.html' title='What exactly is grooving and shortening of the array'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-2671871780550021478</id><published>2009-02-25T22:28:00.000-08:00</published><updated>2009-02-25T22:29:30.124-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>Explain about an ivalue</title><content type='html'>&lt;strong&gt;Question :Explain about an ivalue?&lt;/strong&gt;&lt;br /&gt;Answer :An ivalue is an item that can serve as the target of an assignment. The term I value originally meant a “left value”, which is to say a value that appears on the left. An ivalue usually represents a data space in memory and you can store data using the ivalues name. Any variable can serve as an ivalue.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-2671871780550021478?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/2671871780550021478/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/explain-about-ivalue.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/2671871780550021478'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/2671871780550021478'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/explain-about-ivalue.html' title='Explain about an ivalue'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-5106250341041633080</id><published>2009-02-25T22:27:00.000-08:00</published><updated>2009-02-25T22:28:45.270-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>Name all the prefix dereferencer in perl</title><content type='html'>&lt;strong&gt;Question :Name all the prefix dereferencer in perl?&lt;/strong&gt;&lt;br /&gt;Answer :The symbol that starts all scalar variables is called a prefix dereferencer. The different types of dereferencer are.(i) $-Scalar variables(ii) %-Hash variables(iii) @-arrays(iv) &amp;amp;-subroutines(v) Type globs-*myvar stands for @myvar, %myvar.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-5106250341041633080?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/5106250341041633080/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/name-all-prefix-dereferencer-in-perl.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5106250341041633080'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5106250341041633080'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/name-all-prefix-dereferencer-in-perl.html' title='Name all the prefix dereferencer in perl'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-5256188299468279948</id><published>2009-02-25T22:26:00.001-08:00</published><updated>2009-02-25T22:27:27.056-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}</title><content type='html'>&lt;strong&gt;Question :Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?&lt;/strong&gt;&lt;br /&gt;Answer :${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.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-5256188299468279948?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/5256188299468279948/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/assuming-both-localvar-and-myvar-exist_25.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5256188299468279948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/5256188299468279948'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/assuming-both-localvar-and-myvar-exist_25.html' title='Assuming both a local($var) and a my($var) exist, what&apos;s the difference between ${var} and ${&quot;var&quot;}'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-7365953908395711658</id><published>2009-02-25T22:26:00.000-08:00</published><updated>2009-02-25T22:27:17.478-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}</title><content type='html'>&lt;strong&gt;Question :Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?&lt;/strong&gt;&lt;br /&gt;Answer :${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.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-7365953908395711658?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/7365953908395711658/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/assuming-both-localvar-and-myvar-exist.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/7365953908395711658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/7365953908395711658'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/assuming-both-localvar-and-myvar-exist.html' title='Assuming both a local($var) and a my($var) exist, what&apos;s the difference between ${var} and ${&quot;var&quot;}'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1104661244505416045.post-7562430465856389963</id><published>2009-02-25T22:15:00.000-08:00</published><updated>2009-02-25T22:26:06.332-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>What is Perl one-liner</title><content type='html'>&lt;strong&gt;Question :What is Perl one-liner?&lt;/strong&gt;&lt;br /&gt;Answer :There are two ways a Perl script can be run: a)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 &lt;a href="http://interviewhelper.org/Art/628/73/Perl-Interview-Questions.html" target="_top"&gt;perl&lt;/a&gt; -e "print "Hello";". One-liner doesn't mean one Perl statement. One-liner may contain many statements in one line.b)from a script file, called Perl program.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1104661244505416045-7562430465856389963?l=perl-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://perl-interview-questions-answers.blogspot.com/feeds/7562430465856389963/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-is-perl-one-liner.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/7562430465856389963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1104661244505416045/posts/default/7562430465856389963'/><link rel='alternate' type='text/html' href='http://perl-interview-questions-answers.blogspot.com/2009/02/what-is-perl-one-liner.html' title='What is Perl one-liner'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry></feed>
