in reply to Re^2: How do I pretend a reference isn't a reference
in thread How do I pretend a reference isn't a reference
That said, as far as I can see, tie works only on named variables:
So in the process of solving one issue, I could be introducing many more.
Um. The problem is that your map is returning the return value from tie, instead of the tied variable.
If you change the map so:
my @months = map{tie my $var, i18n::String2, $_; $var } qw(January +February);
That problem goes away also. (I made a similar error myself earlier:)
Provided that your _(...) sub does the right thing, your users need never be aware that they are dealing with anything other than simple scalars.
So, trade your (one-time, up-front) care (and a little getting up to speed with the ins and outs of tie), as you develop your solution, for ongoing and continuous care by all your programmers?
Your choice, but I know which way I would go :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How do I pretend a reference isn't a reference
by clinton (Priest) on Nov 06, 2008 at 11:32 UTC | |
by BrowserUk (Patriarch) on Nov 06, 2008 at 11:42 UTC | |
by clinton (Priest) on Nov 06, 2008 at 11:52 UTC |