in reply to Re^2: Begginer's question: If loops one after the other. Is that code correct? (updated)
in thread Begginer's question: If loops one after the other. Is that code correct?

Hi predrag, can we use your first paragraph above in our advertising?

Seriously, Perl is great, isn't it!

You may have had a difficult time experimenting with Parser modules, but it's definitely the right approach. You may be surprised at how simple the code can be. Someone here has probably got experience and good advice for you.

Do not worry about long code example, just use the <readmore></readmore> tags so you don't show it all. See Writeup Formatting Tips.

Also make sure to post some sample input to your program and the output you desire for that input.

edit: added link


The way forward always starts with a minimal test.
  • Comment on Re^3: Begginer's question: If loops one after the other. Is that code correct? (updated)
  • Download Code

Replies are listed 'Best First'.
Re^4: Begginer's question: If loops one after the other. Is that code correct? (updated)
by predrag (Scribe) on Jan 10, 2017 at 17:08 UTC

    Thank you 1nickt. Of course, you can use that paragraph for Perl advertising and everything else from my posts.

    It was my real experience and I should add more: I am 57 years old now, I do have education in electronics, but it was long ago and I never worked in that field professionally. Maybe helped because I had a good approach to learn and practice Perl, through examples and many different tasks I've set to myself. When I have to realize my ideas I always divide task into many small parts, check everything, put counters in loops, print counters etc.

    Last winter, after finishing two Linux trainings I've asked my Linux teacher about a problem I could not resolve through bash scripting. He mentioned perl, pyhton, and ruby, but he wasn't so found of Perl. Somehow, I choose perl, although, I must admit, I didn't find many recommendations on the web. But as a very beginner I eventually wrote scripts for LZW encoding and decoding in Perl, not using modules. Of course, I've used some elements of the code from the web and did maybe a hundred different small examples and tests, but at the end I was successful. In that time, modules were too complicated to me, so I decided to go by my own foot. What was also surprising to me that I've understood with Perl I can do many things for myself that I never expected before I would even try.

    Regarding that my script for converting, I will send it in my next post. Should that be in a new node?

    p.s. to check are Cyrilic letters visible, just few љ, ц,п,ж,Ђ

    In the text are visibe but in code not, should show: $lj = "љ";

    use utf8; binmode(STDOUT, ":utf8"); use open ':encoding(utf8)'; # input/output default encoding will be # UTF-8 elsif (($str_char eq "l") && ($next eq "j")){ $lj = "&#1113;";