in reply to Can you help me with these one-liners?

.. maybe I can write them more "sophisticated"..

If you use a 'code' more than a couple of times, why keep it as a one liner? Why not 'pump' it up into a 'fully fledged' scripts, maybe even useful to some other persons around you? Just thinking aloud.

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me
  • Comment on Re: Can you help me with these one-liners?

Replies are listed 'Best First'.
Re^2: Can you help me with these one-liners?
by Anonymous Monk on Apr 22, 2014 at 14:52 UTC
    No no, sorry maybe I should have said it before... These are supposed to be my answers to small snippets of code that we must write for a course. And the teacher asked us to write them in Perl oneliners (this is the topic for the current lesson). I was just reading up the -n and -p functions, but in my little experience with Perl oneliners, I don't really understand how I could modify these lines and use the -n and -p (or if I SHOULD actually modify them or just let them as they are, since they work in my tasks).