Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Bless and Do

by NetWallah (Abbot)
on Jun 17, 2014 at 17:03 UTC ( #1090174=note: print w/ replies, xml ) Need Help??


in reply to Bless and Do

If you are not using $_ in the local block, this should meet the need to avoid temporary variables, while maintaining readability, and avoiding "do":

my $variable=bless \(local $_=49) ,'Rates::Notification';
As mentioned before, the assignment is necessary to avoid "Modification of a read-only value attempted at ..".

If you are using $_, then the previous recommendations apply, in order to reduce the scope of the local assignment.

        What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?
              -Larry Wall, 1992


Comment on Re: Bless and Do
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1090174]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2015-08-04 05:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (59 votes), past polls