Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: How can i debug compound map/grep statements just using print?

by karlgoethebier (Parson)
on Dec 01, 2012 at 19:29 UTC ( #1006630=note: print w/replies, xml ) Need Help??


in reply to Re: How can i debug compound map/grep statements just using print?
in thread How can i debug compound map/grep statements just using print?

You answered: "please, next time post clear questions with isolated code examples.

My question was: "How can i debug compound map/grep statements just using print?"...and in my code you can read this:

map { ( $_->stat )[9] } # e.g i'm interested in this... grep { $_->name =~ /.+\.$suffix$/ } # ...and this

How clear can we get ;-)

You answered: "you can use print anywhere within these blocks as long as it doesn't change the returned value."

This is what i was searching for! Honestly said: i didn't know this. And perhaps i've got yet another mental block. Thank you very much for this advice.

Best regards, Karl

«The Crux of the Biscuit is the Apostrophe»

  • Comment on Re^2: How can i debug compound map/grep statements just using print?
  • Download Code

Replies are listed 'Best First'.
Re^3: How can i debug compound map/grep statements just using print?
by LanX (Chancellor) on Dec 01, 2012 at 19:36 UTC
    Well you posted more than 10 times more code than necessary.

    I said "with isolated code examples." =)

    Take your new terse explanation as a standard for your coming posts. ;)

    Cheers Rolf

      Well, but i have been advised to provide complete "solutions". So please don't be so apodictic.

      «The Crux of the Biscuit is the Apostrophe»

Re^3: How can i debug compound map/grep statements just using print?
by space_monk (Chaplain) on Dec 02, 2012 at 09:02 UTC

    Your response did get a smile out of me, but the only part of the code that was necessary to show your problem is the find subroutine. All the POD and getoptions code you added are no doubt necessary for a complete program, but not to show the problem you are having

    A Monk aims to give answers to those who have none, and to learn from those who know more.

      Yes, thats right. Sorry. Regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1006630]
help
Chatterbox?
[Corion]: ambrus: Yeah - we're in that situation too, except that there is no time to do the reorganizing :-/
[LanX]: ... so my boss started a project with the newest sun servers and invited the traders to come on weekend to test it... and they were so pleased, that they forced him to keep it in production...
[ambrus]: Corion: sure, this is the long-term plan. The short term is that I have to run this ungodly mess to get results from the new input data today.
[Corion]: ambrus: Most of our "automation" is tied to process exit codes and a shell pipeline :-\
[LanX]: ... a week later they realized that one of the databases - which recorded how much the other banks due to this bank - was not correctly plugged
[ambrus]: Corion: I have no problem with exit codes and shell pipeline. My problem is that the current process requires a lot of manual intervention from me, including editing the source codes.
[ambrus]: (Also a lot of manual intervention by two or three other co-workers, who do other parts of the process.)
[ambrus]: Some of the manual part is unavoidable, but not all.
[choroba]: LanX was there a way to recover the numbers from the remaining information?
[Corion]: LanX: Ow ;)

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (11)
As of 2017-03-29 11:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (350 votes). Check out past polls.