We don't bite newbies here... much | |
PerlMonks |
Re: looking for feedback on my first scriptby shmem (Chancellor) |
on Jan 08, 2021 at 16:19 UTC ( [id://11126614]=note: print w/replies, xml ) | Need Help?? |
Looks good. If only my first script was so orderly... Some things I'd do different:
That's a matter of style (and lazyness :-) I'd use sprintf which obsoletes the pad() subroutine. Expressing the if/else/elsif as a construct of ternaries (COND ? IF_TRUE : IF_FALSE) is, again, a matter of style. The sprintf being the last expression eliminates the need for an explicit return. edit: Since the documentation is contained in the script, and it states
you could stick the following directive into it up front
which can be overridden redirecting /dev/null into it as STDIN.
perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
In Section
Seekers of Perl Wisdom
|
|