Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^5: Why should I use perl 5.10?

by BrowserUk (Patriarch)
on Dec 02, 2007 at 00:49 UTC ( [id://654369]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Why should I use perl 5.10?
in thread Why should I use perl 5.10?

And module authors probably should not be concerned with setting local $\ accordingly.

They are exactly the people who should be concerned with it. They are making assumptions about the environment in which they will run, which is not theirs to dictate.

But overall, I welcome say.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^6: Why should I use perl 5.10?
by blazar (Canon) on Dec 02, 2007 at 12:41 UTC
    They are exactly the people who should be concerned with it. They are making assumptions about the environment in which they will run, which is not theirs to dictate.

    I personally believe that you're perfectly right. What I meant is that it is annoying, though, to have to do so. Specifically, to print is also much like speaking, and it is strange that the environment influences how do I speak: generally it is to be expected that people will understand differently and I may consciously adapt the way I speak, but not directly because of the environment - except when it is helium filled, perhaps.

      it is strange that the environment influences how do I speak:

      I guess it's analogous to to getting an echo when conversing in a canyon :)

      Alternatively, you could make the case that a module doesn't speak for it's author, but rather acts on behalf of the application author that uses it.

      But, I do get what you mean. In the docs for 5.10 I just read about the new lexical $_ that locally overrides the global of the same name. It struck me that it would be nice if a similar arrangement was possible for many/most of the special globals, but on a package by package basis.

      Eg. If I declare and set a $/ at the top level of my package, then whenever the global of that name would be used, the local package instance (if it exists) would be used in preference to the global.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        But, I do get what you mean. In the docs for 5.10 I just read about the new lexical $_ that locally overrides the global of the same name.

        I personally believe that I can now say() it: I've been waiting for this for quite a lot of time:

        C:\temp>cat 510.pl #!/usr/bin/perl use 5.010; use strict; use warnings; my @x=1..3; say for map { sub {$_} } @x; say for map { my $n=$_; sub {$n} } @x; { my $_; say for map { sub {$_} } @x; } __END__ C:\temp>\programmi\perl510\bin\perl 510.pl CODE(0x184fcbc) CODE(0x184fcbc) CODE(0x184fcbc) CODE(0x229dbc) CODE(0x229e6c) CODE(0x182a2fc) CODE(0x229dbc) CODE(0x182a0cc) CODE(0x182a14c)

        Update: I also notice in the delta manpage the remark that "substr() lvalues are no longer fixed-length." I believe it was you who talked (to me) about substr() lvalues in the first place, and about the fixed length limitation.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-25 20:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found