Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re^4: I know what I mean. Why don't you?

by Aristotle (Chancellor)
on Nov 24, 2005 at 01:04 UTC ( #511296=note: print w/replies, xml ) Need Help??

in reply to Re^3: I know what I mean. Why don't you?
in thread I know what I mean. Why don't you?

Judging the use of strict and warnings by the presence of the pragmata alone is stupid. No my in sight in a longer snippet that uses multiple variables is a much better indicator. Global filehandles and two-argument open are additional red flags. Basically, Iíve seen enough bad Perl code that I can tell it by the ďsmellĒ Iím not even sure all of the hints I pick up on are conscious.

Though in general, unless the problem is obviously caused by a lack of strictures or would clearly have been pointed out by a warning, I only suggest that the poster may make his life easier by using them. And Iíve downvoted a fair number of nodes where someone just hawks about strictures and warnings when they obviously havenít even taken the time to read the posterís problem description and code. (I remember there was a thread recently where half a dozen people worthlessly posted about strict and warnings when the problem had absolutely nothing to do with that. Way to pollute the forum.)

Makeshifts last the longest.

  • Comment on Re^4: I know what I mean. Why don't you?

Replies are listed 'Best First'.
Re^5: I know what I mean. Why don't you?
by bigmacbear (Monk) on May 20, 2006 at 00:31 UTC

    Global filehandles and two-argument open are additional red flags.

    True, unless one is writing scripts that must run on older systems which came with perl 5.005_03 and can't be upgraded in a timely manner. There's still a lot of Solaris 8 out in the wild to which this applies.

      You can use Symbol::gensym on such old perls to get lexical filehandles (more awkward, but gets you the same benefits), and you could write a conditionally installed wrapper to emulate three-arg open (only awkward once, but only worthwhile when you can foresee value in making the code easily forward-upgradable). Whether the effort is justified will depend on your particular circumstances, of course (but see also my signature).

      Makeshifts last the longest.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://511296]
[james28909]: yep, i am scraping a websites date/time stamp from an article. none of that is relevant though because the strings i get are as expected. the returned data from the website is the list of @weekdays
[james28909]: i need to convert those @weekdays to an numerical date based off of scalar localtime
[james28909]: i have thught about this and though about it lol
[james28909]: also remember, that if 'Today' is may 1, then Yesterday is not may 31 lol
[james28909]: theoretically speaking ofcourse

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2017-04-29 03:50 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (531 votes). Check out past polls.