in reply to Re^11: localizing lexical without messing with tie ?
in thread localizing lexical without messing with tie ?
tst(-named=> parameter)
I'm experimenting with functional programming and manipulating closures.
(Update: But if you call $a and $b in sort {} "named parameters", then yes.)
> Could I buy a verb please?
I'm reluctant to deepen this discussion, many people here have a more emotional attitude about the "right way to do it".
(this results normally in useless flames where I won't/can't compete)
> (using a bad syntax)
sic!
> You're looking for any magic that has a side-effect that isn't undone by the end of the following:
my $saved = $magical; ... $magical = ...; ... $magical = $saved
Yes I'm trying to prevent possible conflicts and having a more fault-tolerant design,thats why I'm forbidding tied vars.
UPDATE: BTW pos can be handled!
sub dont_mess_pos { my $vr=\$_[0]; my $pos=pos($$vr); my $s=$$vr; $_[0]=42; $$vr=$s; pos($$vr)=$pos }
DB<80> my $a="xxx";scalar ($a=~/x/g);print pos($a); tst $a; print $a +,pos($a) 1xxx1
Cheers Rolf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^13: localizing lexical without messing with tie ?
by ikegami (Patriarch) on Sep 11, 2010 at 14:40 UTC | |
by LanX (Saint) on Sep 12, 2010 at 13:04 UTC | |
by ikegami (Patriarch) on Sep 12, 2010 at 15:40 UTC | |
by LanX (Saint) on Sep 14, 2010 at 12:37 UTC | |
by ikegami (Patriarch) on Sep 14, 2010 at 14:33 UTC | |
|