Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Weird array printing/passing to subroutine problem

by jjhorner (Hermit)
on Jul 10, 2000 at 16:45 UTC ( [id://21782]=note: print w/replies, xml ) Need Help??


in reply to Weird array printing/passing to subroutine problem

You are not using the 'strict' pragma. You therefore receive -- from me. This may just be a short snippet of code, but new people look at this and try to copy it. Don't shoot them in the foot.

Most people complain about not knowing why someone votes down their posts. I'm explaining why.

Moral: USE STRICT and USE WARNINGS!

Update:

kudra, again, points out something to which I'm oblivious. I do not mean to sound so brutal. I'm just trying to help you improve your perl code. Using 'strict' and 'warnings' will save you debugging hours and money, if you do this for a living.

Take what I say in the spirit with which I say it: as a gentle rebuke to not-so-cool coding. I'm not personally attacking you. After all, you are a perl coder, that makes you better than the rest of the world. :)

Special thanks to kudra. Between her and my new wife, I will be ready for public consumption in no time!

Update #2:

Once again, kudra proves to be wise beyond her years. here is a link to the post that started this trend.

J. J. Horner
Linux, Perl, Apache, Stronghold, Unix
jhorner@knoxlug.org http://www.knoxlug.org/
  • Comment on Re: Weird array printing/passing to subroutine problem

Replies are listed 'Best First'.
RE: Re: Weird array printing/passing to subroutine problem
by Buckaroo Buddha (Scribe) on Jul 10, 2000 at 19:15 UTC
    eduardo's thread explorations of consciousness and symbolic references...
    might give you new insight into the 'strict' controversy

    personally, i'd love to use strict but there are things
    that i can't do with it on (i've tried)

    i always try to use it for the first few lines of a
    proggie but wind up turning it off to get the job done

    i'd love to send my code to a perl clinic, so i could learn
    how to do those things (and i try that here from time to time ;)
    but i worry about treadding to close to the line on my NDA

    Update:

    after an email discussion with dave (i tried to include jjhorner but to no avail), i've
    got to admit that i was wrong. my being limited to non-strict code was a limitation of my
    own in how to use global variables

    eduardo's node did however make me feel better about not knowing how to do it tho' ;)

    thanks to dave fo going through a mighty heafty chunk of code, his responses are about
    to spawn another thread

      I'd love to see a few examples of code that refuses to be 'strict' compatible.

      Thanks.

      J. J. Horner
      Linux, Perl, Apache, Stronghold, Unix
      jhorner@knoxlug.org http://www.knoxlug.org/
      

      I'd also like to see examples of things that you can't do with use strict switched on. The only thing I can think of is symbolic references and there are better ways to do most of the things that they are used for.

      Even if you must do things that break use strict what's to stop you making most of the code strict-clean and putting no strict around the problem areas - together with a comment explaining what is going on.

      --
      <http://www.dave.org.uk>

      European Perl Conference - Sept 22/24 2000, ICA, London
      <http://www.yapc.org/Europe/>
RE: Re: Weird array printing/passing to subroutine problem
by Adam (Vicar) on Jul 10, 2000 at 20:52 UTC
    While I agree that your code should be able to pass both strict and warnings, I don't think that is always deserving of a -- vote. If the question being asked is directly caused by their failure to use these tools, and they are a professed newbie, then they need to be shown the light, not the door. On the other hand, if they are posting code in the snipits section, and it can't pass "-wc -Mstrict", then vote --. There is no reason to be unilateral about voting around here. If there was, then voting would be pointless.

    -Adam

    BTW, I trust that you only mean that the code should be able to compile with the "use strict;" pragma, not that the poster need include that line in their post, (unless it is a complete script).

Log In?
Username:
Password:

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

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

    No recent polls found