Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^4: chr() function

by dsheroh (Prior)
on Nov 15, 2018 at 08:31 UTC ( #1225845=note: print w/replies, xml ) Need Help??


in reply to Re^3: chr() function
in thread chr() function

The reason why I told him to use variable $a is because his entire program is only 4 lines long.
And tiny programs like that, or shell one-liners, are among the very few cases where not using strict is a sane course of action.
You know, you might as well store it in $a. This was by no means a suggestion that it is a good practice or that we should all do this.
Then why didn't you give any warnings or other indications (aside from an emoticon, which is hardly a specific message) to indicate to the OP, who clearly appears to be relatively new to Perl (since they're not familiar with strict or the requirements it places on your code), that it's not a good practice or that they shouldn't do it all the time? Not even a simple "you shouldn't generally do this, but, in this case, because it's so simple, you can get away with it". Just "use $a instead of $alpha" with no warnings at all that it might be inappropriate or dangerous in other contexts.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2020-05-26 17:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (150 votes). Check out past polls.

    Notices?