in reply to Scoping Variables
I'm going to make some assumptions from things I've read in Programming perl, and in the monastary Please correct me if I'm wrong:sub meat_and_potatoes_of_program { while (<my_file>){ /(\w{3}\s+\w{3}\s+\d{1,2}/;
You're not memorizing anything here, because you haven't closed the parentheses. You must actually test code before you post it (unless you're merlyn or tilly or one of the several other clueful hackers among the Monks).
Okay...and that print statement served what purpose in illustrating your problem?my $date = $1; print "date \n <br>";
I have also tried:Which -- again -- serves what purpose?sub the_meat_and_potatoes_of_program{ my $pass_down_date = 1
Please be more careful the next time you post a question here. Ensure that your code is exactly the same as that which you claim "doesn't work" (ie. you've tested it and are able to show precisely what the problem is via the errors perl gives you, or the output you're getting and how it differs from what you're expecting), and ideally that your spelling is correct, and that the layout of your post doesn't assault one's visual cortex (thanks to The Damian for that one, and for Text::Autoformat :).
My intention isn't to flame, but rather to provide advice that will help you get the most helpful and accurate replies, and keep the content of The Monastery high.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Scoping Variables
by Clachair (Acolyte) on May 18, 2001 at 07:28 UTC | |
by Anonymous Monk on May 18, 2001 at 18:13 UTC | |
by Anonymous Monk on May 18, 2001 at 18:14 UTC | |
by Clachair (Acolyte) on May 19, 2001 at 03:37 UTC |