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

Re: Adding Default Values [for BEGINNERS]

by brusimm (Pilgrim)
on Dec 21, 2006 at 23:27 UTC ( [id://591228]=note: print w/replies, xml ) Need Help??


in reply to Adding Default Values [for BEGINNERS]

Thanks. Those ideas seem to work, and the funny thing is, i do know about chomping and forgot to do it. I use -w when calling the scripts.

One pickle.. I am using winXp, and ActivePerl and when i add USE STRICT, my script blows up on me with GLOBAL SYMBOL error statements. It pretty much complains about everything from line 22 and down, "requiring explicit package name..." for the different variables the script encounters.

Also, after adding the chomp, and pulling out the \n print, I have to hit return twice, but it does use the provided default. Any thoughts?

Again, thank you everyone.

  • Comment on Re: Adding Default Values [for BEGINNERS]

Replies are listed 'Best First'.
Re^2: Adding Default Values [for BEGINNERS]
by GrandFather (Saint) on Dec 21, 2006 at 23:40 UTC

    Adding use strict; requires that you declare variables using my. For example in:

    my ($Drivers, $Points_Rank, $TotalPts, $Behind, $Starts, $Poles, $Wi +ns, $Top5, $Top10, $DNF, $Winnings) = split /\,/, $line;

    the my is required.


    DWIM is Perl's answer to Gödel
Re^2: Adding Default Values [for BEGINNERS]
by syphilis (Archbishop) on Dec 22, 2006 at 00:33 UTC
    I have to hit return twice

    For each and every occurrence of <STDIN> you should have to hit return once (and once only).
    In making your changes have you inadvertently introduced another <STDIN> ?

    Cheers,
    Rob
      Thanks to everyone for your patience and insight. As always, it's been an excellent learning experience.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2024-04-20 05:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found