Continuation of questions (PS - answer here)

I have a previously asked question on the last comment at

http://www.experts-exchange.com/Programming/Programming_Languages/Perl/Q_20553048.html

It is about how to make open file to be global
WesleyWeeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

wilcoxonCommented:
I'm not quite sure what you mean by "it is about how to make open file global".  However, I do see some problems with your code from the last comment of the previous thread.

for( @files ) {
if($line = /^.+L1\.UMC$/){$L1_FILE=$_;}
open (FILE, "$L1_FILE") or die $!;
while (<FILE>)

First, I'm not sure what you're trying to do with the "if($line..." statement - it looks fishy to me.  If you're trying to see if $line matches the regex, then it needs to be "if($line =~ ...".  If you're trying something else, please let me know what you're trying to do.  Depending on what you're trying to do, I also don't see anywhere that $line is set (or used) in your code.

Second, $L1_FILE is only being set if the if is true.  You probably don't want to open the file unless the file to be opened changed (or do you want to open the previous $L1_FILE if the "if" fails?).

Generally, I would strongly encourage you to "use strict", "use warnings" (or -w), and (while debugging) "use verbose".
0
WesleyWeeAuthor Commented:
I have included what i need to say in the *pl code in the *zip file attached.

http://www.geocities.com/wwyz83/Perl.zip

Inside the running working code is Gtest.pl
while the one i am testing to change is in Ztest.pl

0
WesleyWeeAuthor Commented:
oh yes there are problems in my code, i believe i copied the wrong code out. but i have attached the new code in the *zip above.

the "if($line..." statement i'm trying to set it to true; searching for the *.L1.UMC file. In the folder that is for checking there will always only be one of such a file. Therefore i require the code to automactically open the the *L1.UMC file.

why is it *L1.UMC?
It is that it's fixed that the characters before L1 is always changing. only fixed is the L1.UMC therefore i want the code jus to open any file that has the name L1.UMC at the back of the filename.

I don't wish to put "ue warnings" or "use strict".
As i am jus a beginner to using Perl and i am having a deadline. i found it hard to run if i keep getting warnings and to keep up with syntx.

I kinda really need to finish my code asap but i can't seem to totally understand everything to create word for word. I'm kinda begging already, i'm sorry. I'm desperate.
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

moduloCommented:
Dear expert(s),

A request has been made to close this Q in CS:
http://www.experts-exchange.com/Community_Support/CleanUp/Q_20560470.html

Without a response in 72 hrs, a moderator will finalize this question by:

 - Saving this Q as a PAQ and refunding the points to the questionner

When you agree or disagree, please add a comment here.

Thank you.

modulo

Community Support Moderator
Experts Exchange
0
WesleyWeeAuthor Commented:
I agree in closing this Question
0
moduloCommented:
Saving this Q as a PAQ and refunding the points to the questionner

modulo

Community Support Moderator
Experts Exchange
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.