I had a bit of trouble going through the perldocs when I started on perl as it is all rather confusing at that stage. But it is definetly worth it. I was avoiding going back again and then noticed some links to the perltut posted by a distinguished monk, so I revisited them.

Having been writing some initiate level subroutines I was amazed at some of the basic syntax and structure practices I was failing to include in my code. The shear feeling of elation I have from just reading a few nicely laid out tutorials is beyond description. Send $40 dollars now and you may have the opportunity to become the next beautified initiate at perlmonks.org ... (joking)

Here's a small before and after - the differences are subtle but extremely satisfying.

before:
sub adedtear{ open(my $prfore, "<", "../editsite2/preview.html") or die "couldn't o +pen preview for read in sub adedtear: $!\n"; while(my $line=<$prfore>){ if($line =~ m/<\!--texts001-->/){ $flag=1; } if($flag == 1){ if($line =~ m/<\!--text[s|e]/){ $line=$line; } else{ $line =~ s/<br\/>//; $linevalis .= $line; $line = ""; } } if($line =~ m/<\!--texte/){ $flag=2; } } close $prfore or die "couldn't close prfore: $!\n"; print $bar $foo->textarea({-id=>'t001', -name=>'none', -value=>"$linev +alis"}) or die "cant print linevalis into textarea cgi: $!\n";&n; }
after:
sub adedtear{ open(my$prfore, "<", "../editsite2/preview.html") or die "couldn't op +en preview for read in sub adedtear: $!\n"; LINE: while(<$prfore>){ if(/<\!--text[se]\d{3}-->/){ $flag=1; next LINE; } if($flag){ unless(/<\!--texte/){ s/\D{5}\s+$/\n/; $linevalis .= $_; } else{$flag=0;} } } close $prfore or die "couldn't close prfore: $!\n"; print $bar $foo->textarea({-id=>'t001', -name=>'none', -value=>"\n$lin +evalis"}) or die "cant print linevalis into textarea cgi: $!\n";&n; }

In reply to Another reason for perl beginners to read perldocs by Don Coyote

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.