Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^4: Unable to use if condition inside foreach loop using perl?

by finddata (Sexton)
on Mar 23, 2017 at 10:15 UTC ( #1185593=note: print w/replies, xml ) Need Help??


in reply to Re^3: Unable to use if condition inside foreach loop using perl?
in thread Unable to use if condition inside foreach loop using perl?

1.I am opening the files from the the $input_dir 2.Storing it in an array. 3.Closing the file. 4.$temp_line local variable which stores the array contents(i.e store_ +files). 5.Matching the the line which starts with REVISION_LOCATION from the t +he imput_dir 6.Spliting the contents by using colon and storing it in an array. 7.Taking the word by index and storing it in $new_path . 8.Trying to check the output by print statment. 9.Then last the loop by using last.

Replies are listed 'Best First'.
Re^5: Unable to use if condition inside foreach loop using perl?
by Corion (Pope) on Mar 23, 2017 at 10:17 UTC

    You gave some vague description of what you think the overall program does, but you did not describe the line I quoted. Let me quote it again:

    if(my $pattern =~ /^REVISION_LOCATION:/){ #1 #2 #3 #4 #5#6

    Please describe all the points in the line together with their number.

    Please describe what the my keyword does and why you used it in the place you did.

    Please also describe what you think the value of $pattern will be in this line, and why.

      It's no use, Corion. He doesn't understand you. No amount of sarcasm is going to make him comprehend English.

        It's no use, Corion. He doesn't understand you. No amount of sarcasm is going to make him comprehend English.

        Its not sarcasm, its basic communications , basic troubleshooting, you can't help or solve a problem, until you establish common ground, so you can understand which assumptions/conditions are false

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2019-12-06 02:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (154 votes). Check out past polls.

    Notices?