CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
I am loosing value of my argument

 

First page Previous page 1 2 3 Next page Last page  View All


digioleg54
User

Jul 21, 2016, 10:49 AM

Post #26 of 65 (9438 views)
Re: [FishMonger] I am loosing value of my argument [In reply to] Can't Post

how can I do that?


digioleg54
User

Jul 21, 2016, 10:53 AM

Post #27 of 65 (9437 views)
Re: [FishMonger] I am loosing value of my argument [In reply to] Can't Post

anyway, I cannot do it. We have special team. And if I say now that GetOptions doesn't work, I don't think they will be happy


FishMonger
Veteran / Moderator

Jul 21, 2016, 11:58 AM

Post #28 of 65 (9428 views)
Re: [digioleg54] I am loosing value of my argument [In reply to] Can't Post

Please post a short but complete test script that demonstrates the problem so that I can try and duplicate this issue.


FishMonger
Veteran / Moderator

Jul 21, 2016, 12:06 PM

Post #29 of 65 (9425 views)
Re: [digioleg54] I am loosing value of my argument [In reply to] Can't Post

Execute the test script that I posted earlier. If that has the same problem you're seeing in your script, then that would indicate that there is a bug in that older module and should be upgraded.


digioleg54
User

Jul 21, 2016, 12:13 PM

Post #30 of 65 (9423 views)
Re: [FishMonger] I am loosing value of my argument [In reply to] Can't Post

No, the result is OK. I will try to make short copy of the script and send you. But you have to make if as menu


digioleg54
User

Jul 21, 2016, 12:30 PM

Post #31 of 65 (9421 views)
Re: [FishMonger] I am loosing value of my argument [In reply to] Can't Post

I'll do it small parts


digioleg54
User

Jul 21, 2016, 12:37 PM

Post #32 of 65 (9419 views)
Re: [FishMonger] I am loosing value of my argument [In reply to] Can't Post

I send you two attachment. Let me know if you need something else
Attachments: generalledge.pl (1.73 KB)
  menu.pl (4.85 KB)


FishMonger
Veteran / Moderator

Jul 21, 2016, 1:19 PM

Post #33 of 65 (9414 views)
Re: [digioleg54] I am loosing value of my argument [In reply to] Can't Post

I'm real busy at work right now so I won't be able to look at your code until I get home.


digioleg54
User

Jul 21, 2016, 1:22 PM

Post #34 of 65 (9412 views)
Re: [FishMonger] I am loosing value of my argument [In reply to] Can't Post

Sure, I understand.

Thanks a lot


digioleg54
User

Jul 21, 2016, 2:45 PM

Post #35 of 65 (9408 views)
Re: [FishMonger] I am loosing value of my argument [In reply to] Can't Post

I tried to do it like you suggest, but it is not working anyway. It may be Perl issue, old version. But the new version nobody will load in the company now


FishMonger
Veteran / Moderator

Jul 21, 2016, 4:46 PM

Post #36 of 65 (9406 views)
Re: [digioleg54] I am loosing value of my argument [In reply to] Can't Post

I've looked over your tests scripts and it's clear that you don't understand the concept of a self contained test script that others can run. They both are using multiple custom modules which no-one else has access to so they can't test the scripts. They are also filled with unnecessary code, questionable to very poor code formatting and overall is poorly designed.

Regarding the value of the "queue", you didn't apply the correction that I told you it needed and that is why you still have the problem with that hash value.

Saying "it is not working anyway" is a very poor problem description and doesn't give any info on how it's failing. The code corrections I made in the test scripts I posted work correctly. I have no idea what changes you made to your code so I can't say why your code doesn't work.


digioleg54
User

Jul 21, 2016, 4:55 PM

Post #37 of 65 (9403 views)
Re: [FishMonger] I am loosing value of my argument [In reply to] Can't Post

I copied and paste your code


FishMonger
Veteran / Moderator

Jul 21, 2016, 5:08 PM

Post #38 of 65 (9400 views)
Re: [digioleg54] I am loosing value of my argument [In reply to] Can't Post


In Reply To
I copied and paste your code


Which version, the one in post #11 or post #18?

The code in post 18 is what you should test. If that fails, then the root problem is a bug in the old module and if that's the case, it should be upgraded.


FishMonger
Veteran / Moderator

Jul 21, 2016, 5:18 PM

Post #39 of 65 (9397 views)
Re: [digioleg54] I am loosing value of my argument [In reply to] Can't Post

Did you write this app or was it written by someone else and you've been contracted to update it?


digioleg54
User

Jul 22, 2016, 3:29 AM

Post #40 of 65 (9387 views)
Re: [FishMonger] I am loosing value of my argument [In reply to] Can't Post

#18. I contracted just troubleshooting it. Somebody else did it.


digioleg54
User

Jul 22, 2016, 6:00 AM

Post #41 of 65 (9377 views)
Re: [FishMonger] I am loosing value of my argument [In reply to] Can't Post

I did it one time today. Got a message:

Option queue requires an argument
Error in processing args


FishMonger
Veteran / Moderator

Jul 22, 2016, 6:24 AM

Post #42 of 65 (9374 views)
Re: [digioleg54] I am loosing value of my argument [In reply to] Can't Post

Did you supply the number arg to queue?

Did you pop @ARGV prior to executing the GetOptions() statement?

If you add an additional option after the queue, is that option and its value in the hash or is it missing?


digioleg54
User

Jul 22, 2016, 6:31 AM

Post #43 of 65 (9372 views)
Re: [FishMonger] I am loosing value of my argument [In reply to] Can't Post

I see the problem, but I can't work on it now. At 10 Am boss will come to test the program. I will explain him and if he let me change, I will. Otherwise , sorry. I am just consulting.
The problem is that in menu program owner commented two elements, but in GetOptions - not, and queue getting to different place.
If the boss want to spend more money, I can change it. Otherwise today is my last day.

I let you know the result


FishMonger
Veteran / Moderator

Jul 22, 2016, 6:41 AM

Post #44 of 65 (9369 views)
Re: [digioleg54] I am loosing value of my argument [In reply to] Can't Post


Quote
The problem is that in menu program owner commented two elements, but in GetOptions - not, and queue getting to different place


If the Getoptions() function is being used to parse the args, the ordering of the options won't matter but if shift/pop is being used to manually parse the args, then the order will make a big difference and is one of the reasons I said that using that approach is a bad idea.


digioleg54
User

Jul 22, 2016, 6:48 AM

Post #45 of 65 (9366 views)
Re: [FishMonger] I am loosing value of my argument [In reply to] Can't Post

But somehow it cannot find the queue and ask for number


FishMonger
Veteran / Moderator

Jul 22, 2016, 6:55 AM

Post #46 of 65 (9364 views)
Re: [digioleg54] I am loosing value of my argument [In reply to] Can't Post

Are you referring to the menu prompt for the user to supply the value for that option?


(This post was edited by FishMonger on Jul 22, 2016, 6:55 AM)


digioleg54
User

Jul 22, 2016, 7:11 AM

Post #47 of 65 (9357 views)
Re: [FishMonger] I am loosing value of my argument [In reply to] Can't Post

After I supply values, it goes to program and didn't print queue number even I make pop for it, then go to GetOptions and show the error, which I mention


FishMonger
Veteran / Moderator

Jul 22, 2016, 7:17 AM

Post #48 of 65 (9354 views)
Re: [digioleg54] I am loosing value of my argument [In reply to] Can't Post


In Reply To
After I supply values, it goes to program and didn't print queue number even I make pop for it, then go to GetOptions and show the error, which I mention


Your wording in that sentence is a little confusing, but if you use pop before calling GetOptions(), then obviously the value for the last option (presumably the queue option) would be stripped out of the @ARGV array and cause the error message to be generated.


(This post was edited by FishMonger on Jul 22, 2016, 7:18 AM)


digioleg54
User

Jul 22, 2016, 7:42 AM

Post #49 of 65 (9351 views)
Re: [FishMonger] I am loosing value of my argument [In reply to] Can't Post

I don't use pop in GetOptions. I receive the message, that I copied from your #18. Pop I use in another place and it also doesn't find queue value.


FishMonger
Veteran / Moderator

Jul 22, 2016, 7:55 AM

Post #50 of 65 (9349 views)
Re: [digioleg54] I am loosing value of my argument [In reply to] Can't Post

What about the question I asked earlier:

If you add an additional option after the queue, is that option and its value in the hash or is it missing?

First page Previous page 1 2 3 Next page Last page  View All
 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives