0

Can anybody please help me in understanding if we can crate perl object or class instances without using a constructor ? Is it possible to achieve such scenario.

Appreciate your comments!!

1
  • 1
    Perl doesn't have any concept of object constructors. Commented Dec 4, 2014 at 14:42

1 Answer 1

5

The main question is why would you like to do such thing?

It is possible but it doesn't make sense as object stays uninitialized,

use CGI;
my $cgi = bless {}, "CGI";

print ref($cgi);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.