in reply to Re: Way to do a "scalar ref"?
in thread Way to do a "scalar ref"?
..so basically I wanna be able to pass along $article_contents to different functions, but not actually have it take up more memory (or require a "return", to assign it to a new variable).sub process_article { my $article = get_article_from_db($article_id); my $contents = process_article($article->{contents}); # now I need to access $article->{contents}, but the modified vers +ion from process_article } sub process_article { my $article_contents = $_[0]; # do some stuff to $article_contents here return $article_contents; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Way to do a "scalar ref"?
by moritz (Cardinal) on Sep 26, 2011 at 09:02 UTC | |
|
Re^3: Way to do a "scalar ref"?
by johngg (Canon) on Sep 26, 2011 at 09:13 UTC | |
|
Re^3: Way to do a "scalar ref"?
by AnomalousMonk (Archbishop) on Sep 26, 2011 at 18:45 UTC |