Perl Programming Question:
Download Job Interview Questions and Answers PDF
What is the output of the following Perl program?
1 $p1 = "prog1.java";
2 $p1 =~ s/(.*)\.java/$1.cpp/;
3 print "$p1\n";
Answers:
Answer #1What is the output of the following Perl program?
1 $p1 = "prog1.java";
2 $p1 =~ s/(.*).java/$1.cpp/;
3 print "$p1n";
prog1.cpp
1 $p1 = "prog1.java";
2 $p1 =~ s/(.*).java/$1.cpp/;
3 print "$p1n";
prog1.cpp
Answer #2prog1.java
Download Perl Programming Interview Questions And Answers
PDF