Named parameters in perl lingo are something like

 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


In reply to Re^12: localizing lexical without messing with tie ? by LanX
in thread localizing lexical without messing with tie ? by LanX

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.