Write a script to reverse a string without using perl's built in functions?



Write a script to reverse a string without using perl's built in functions?..

Answer / Shailendra Kumar Dwivedi

"my $str = "Hello"; my @reversed; while(length($str) > 0){ push @reversed, substr($str, -1); $str = substr($str, 0, length($str)-1); } print join(",",@reversed).""

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More CGI Perl Interview Questions

Explain splicing of arrays?

1 Answers  


Can inheritance be used in perl? Explain with the help of an example.

1 Answers  


What is perl scripting?

1 Answers  


What is chomp() operator/function?

1 Answers  


Explain subroutine?

1 Answers  


Explain the default scope of variables in perl?

1 Answers  


How do you debug a Perl scripting ( at the compile time error or run time error) in Unix environment ?

4 Answers  


what r the future opportunities in PERL/LINUX after 3 years ??

3 Answers  


Explain the various characteristics of perl.

1 Answers  


What does `new $cur->{LINK}' do? (Assume the current package has no new() function of its own.)

1 Answers  


How will you open a file in read-only mode in perl?

1 Answers  


Explain lexical variables.

1 Answers  


Categories