Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Passing results of a substitution to a function

by BrowserUk (Patriarch)
on Jan 20, 2003 at 23:37 UTC ( [id://228525]=note: print w/replies, xml ) Need Help??


in reply to Passing results of a substitution to a function

You could do this ... whether you should is for your own concience:)

sub blah{print +shift;} my $word = 'BLAHBLAH'; blah( do{ (local $_= $word) =~ s/BLAH/COW/g; $_} ); # prints COWCOW print $word; # prints BLAHBLAH

Examine what is said, not who speaks.

The 7th Rule of perl club is -- pearl clubs are easily damaged. Use a diamond club instead.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-25 21:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found