CoolInterview.com - World's Largest Collection of Interview Questions
Start Your Own website Now
Sponsored Links

Interview Questions
Our Services

Get 9,000 Interview Questions & Answers in an eBook.


  • 9500+ Pages
  • 9000 Question & Answers
  • All Tech. Categories
  • 14 MB Content

    Get it now !!



    Send your Resume to 6000 Companies


  • INTERVIEW QUESTIONS LANGUAGES PERL DETAILS
    Question :
    Write a script to display mirror image of a entered value and also check whether Palindrome?
    Category Perl Interview Questions
    Rating (0.2) By 17 users
    Added on 8/7/2012
    Views 154
    Rate it!
    Answers:

    print("Enter the no. to check for Palindrome : ");
    $no = <STDIN>;
    chop($no);

    $i = 0;

    # Store into a array
    while($no != 0)
    {
    @array[$i] = $no % 10;
    $no = int($no / 10);
    $i++;
    }

    $i--;
    $j=0;
    $flag = "true";

    # Check for Palindrome
    while( ($flag eq "true" )&& ( $j < @array/2) ){
    if (@array[$j] != @array[$i])
    {
    $flag = "false"
    }
    $i--;
    $j++;
    }

    # Print the result
    if( $flag eq "true")
    {
    print("It is a Palindrome ");
    }
    else
    {
    print("It is NOT a Palindrome ");
    }



    If you have the better answer, then send it to us. We will display your answer after the approval.
    Rules to Post Answers in CoolInterview.com:-

  • There should not be any Spelling Mistakes.
  • There should not be any Gramatical Errors.
  • Answers must not contain any bad words.
  • Answers should not be the repeat of same answer, already approved.
  • Answer should be complete in itself.
  • Name :*
    Email Id :*
    Answer :*
    Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
    Process Verification  Enter the above shown code:*
    Inform me about updated answers to this question

       
    Related Questions
    View Answer
    Write a script to generate n prime no.s?
    View Answer
    Why we use "use lib $path"?
    View Answer
    Difference between Perl and Mod_perl?
    View Answer
    How to make the following assignment, as arrayreference assignment?

    my $arr_ref=[1,2,3,4,4,elem];
    View Answer
    What is caller function in perl?
    View Answer
    Write a perl script to find whether a given line of text is starting and ending with same word or not?
    View Answer
    Write a Perl script to find a particular word in a paragraph?
    View Answer
    What is the difference between having a parenthesis after module name and without parenthsis after module name?
    i.e Package::Module();
    and Package::Module;
    View Answer
    What is the meaning of rigging?
    View Answer
    Why do you use only Perl when there a lot of more languages available in market like C, Java?
    View Answer
    Try pattern matching for the following:
    1) 10.111.23.11
    2) /root/abc/cde/fgg/ac.xml --> Get file name without extention.
    3) /root/abc/ac.xml/fgg/ac.xml --> Get file name without extention.
    4) What does "DIE" meant in PERL?
    5) chomp
    6) "This is saturday" --> Print the weekday number.
    7) 11-2-2009 --> Print the name of the month.
    8) Reverse the string without using func in C.?
    View Answer
    Write a script to reverse a string without using Perls built in function?
    View Answer
    How to find a substring in a string without using substr built in functions, and print the substring found?
    View Answer
    Sort a word "system" in perl/shell without using built in functions output should be emssty?
    View Answer
    How to sort dates in Perl?
    View Answer
    Packing and Unpacking.

    Hi, I want to get output as 0x23400000345....
    in the below example How to get?
    i tried out, but unable to get the answer

    $r=0x234;
    $t=0x345;
    $y=pack(L L,$t,$r);
    $x1=unpack(L!,pack(P,$y));
    printf(" The value is $x1");

    I didnt get constant output?
    View Answer
    Write an expression or Perl script to identify the entered IP address is valid or not?
    View Answer
    Write a script to reverse a string without using Perl's built in functions?
    View Answer
    What is the easiest way to download the contents of a URL with Perl?
    View Answer
    How to concatenate strings with Perl?
    View Answer


    Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.

    View ALL Perl Interview Questions

    User Options
    Sponsored Links


    Copyright ©2003-2014 CoolInterview.com, All Rights Reserved.
    Privacy Policy | Terms and Conditions

    Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Dedicated Servers | C Interview Questions & Answers

    Testing Articles | Testing Books | Testing Certifications | Testing FAQs | Testing Downloads | Testing Interview Questions | Testing Jobs | Testing Training Institutes


    Cache = 0 Seconds