Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^4: Help please, or Urgent help needed!

by anakin30 (Acolyte)
on Mar 28, 2012 at 02:51 UTC ( #962056=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Help please, or Urgent help needed!
in thread Help please, or Urgent help needed!

I wish to print output as below, can you please explain more detail how i can get this output?" meanwhile i appreciate if you could tell me what do you mean by print "as you like"?

I'm still beginner in perl scripting, couldn't get it. I'm sorry. Please explain further.

dn: uid=testing,ou=comp,o=test.com mail: example@great.com dn: uid=testing1,ou=comp,o=test.com mail: example1@great.com dn: uid=testing2,ou=comp,o=test.com mail: example2@great.com


Comment on Re^4: Help please, or Urgent help needed!
Download Code
Re^5: Help please, or Urgent help needed!
by remiah (Hermit) on Mar 28, 2012 at 03:10 UTC

    Once you get "block" successfully, you can pick your needed item with regex or split.

    You can split with newline character, /\n/. http://perldoc.perl.org/functions/split.html

    perlretut is very important regex introduction for me. I would like you also read it.

    And you will be recommended to search cpan with keyword like LDIF. good luck.

      thank you so much for sharing the info, but i'm kind a urgent to get my desired output, and i dont have time at the moment to study and try the regex myself. I'm sure you can do it in a glimpse since you already knew about it. I appreciate you can help me in here to give me the source code to achieve the desired output. Please remiah....

        You have been given all of the tools to accomplish the task. split, $/, m. What you do with that information is entirely up to you.

        Imagine if I were to go into the local hardware store with pieces from my sink that I have tried to 'fix'. The employee there gives me instruction on what to use to remedy my fixes, points me to the various parts and tools I would need, and perhaps even points out a book that explains the process I need to complete my project. Is it proper that I should expect that employee to come to my house and fix it for me? Now imagine if I was being paid to do this by someone else, and I claim that I fixed it myself. Is that not similar to your situation?

        You can take the advice, learn how to do it, and implement it yourself (and take away a better set of personal skills), or pay someone else to do it. That is assuming, of course, that somebody does not "come to your place of business and fix your sink for free".

        --MidLifeXis

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2014-12-21 00:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (100 votes), past polls