Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Five Ways to Reverse a String of Words (C#, Perl 5, Perl6, Ruby, Haskell)

by shmem (Chancellor)
on Dec 13, 2006 at 11:37 UTC ( [id://589557]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Five Ways to Reverse a String of Words (C#, Perl 5, Perl6, Ruby, Haskell)
in thread Five Ways to Reverse a String of Words (C#, Perl 5, Perl 6, Ruby, Haskell)

...yeah, and if I get paranoid I also check whether the stringify and/or (de)ref operators are overloaded, and maybe somebody changed shift and reverse via e.g. schwern's Function::Override... ;-)

I guess that if somebody changes $" globally, they have a reason, now don't they?

--shmem

update: inserted globally

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
  • Comment on Re^3: Five Ways to Reverse a String of Words (C#, Perl 5, Perl6, Ruby, Haskell)

Replies are listed 'Best First'.
Re^4: Five Ways to Reverse a String of Words (C#, Perl 5, Perl6, Ruby, Haskell)
by bart (Canon) on Dec 13, 2006 at 11:48 UTC
    Humbug. If your function API isn't explicitely saying it's using the current value of $", then it shouldn't use its current value.

    Do not assume people haven't touched it. They have every right to, without having to appologize for it, to you.

      Keep cool. I didn't publish any function API, but I might do so.

      Anyways, you're right in "counting on the default value", and in production use $" should be localized. I just didn't find it being necessary in the context of this thread.

      --shmem

      _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                    /\_¯/(q    /
      ----------------------------  \__(m.====·.(_("always off the crowd"))."·
      ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
Re^4: Five Ways to Reverse a String of Words (C#, Perl 5, Perl6, Ruby, Haskell)
by Anonymous Monk on Dec 13, 2006 at 16:01 UTC
    Don't forget code filters, too! :-) Just because it says "sub" doesn't mean it actually *means* sub! ;-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-19 16:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found