Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: What am I not understanding about $,

by Ovid (Cardinal)
on May 04, 2016 at 08:48 UTC ( #1162165=note: print w/replies, xml ) Need Help??


in reply to Re^2: What am I not understanding about $,
in thread What am I not understanding about $,

The issue I have isn't so much with the core Perl behavior, so much as the plethora of built-in global variables in Perl, and the general abuse of globals. For example, in one of my @INC directories I ran ack '^\s*\$\w+::.*=' and read plenty of CPAN modules who set global variables for other packages and don't localize those changes. I've had my code break as a result of other people doing that and it's very hard to track down these bugs.

When you combine the potential for mysterious action at a distance along with the relatively inscrutable punctuation variables, it's a double-whammy in my book. Thus, I used to use local $" = ...;, but I've stopped doing that and recommend join (yes, even with array slices) because it's clear and there's less risk of mysterious side effects.

  • Comment on Re^3: What am I not understanding about $,

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1162165]
help
Chatterbox?
[hippo]: Environments differ.
[vedagiri89]: so, how to fix that differ
[choroba]: option one is install everything from the vendor
[choroba]: option two is install everything by hand
[choroba]: option three is mixed the two, but know well what you're doing
[vedagiri89]: right..let me check

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2018-06-19 11:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (113 votes). Check out past polls.

    Notices?