There's more than one way to do things | |
PerlMonks |
Substituting method from objectby Angel (Friar) |
on Dec 03, 2002 at 01:08 UTC ( [id://217097]=perlquestion: print w/replies, xml ) | Need Help?? |
Angel has asked for the wisdom of the Perl Monks concerning the following question:
I have an object. It does validation and data storage acting as a wrapper with a database. When you try to do an update if it is good it returns 1 and when it fails it returns undef. Thus the program calling it can check to see if it worked or not.
I was told here previously to keep my HTML and my modules as seperate as possible. So when an error occurs two object vars are set and hold the type of error and the string the user should see and gived details on the error. Like input too long, needs to be unique, not an e-mail address using Email::Valid, ect. So I made a program that calls the object and gets the errors when they occur. So far so good and all works fine ( after much tuning ) but then I try to do a simple substitution into an HTML string that looks like this: so I tried this: And I get this: User=HASH(0x91e14)->get_error_string I tried quotes I have no clue how to get the string out short of pushing it to another var and then doing the substitution. Is there a way to do this without using another var?
Back to
Seekers of Perl Wisdom
|
|