Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^5: remove first and last character of string (updated)

by hippo (Chancellor)
on Oct 15, 2020 at 08:35 UTC ( #11122856=note: print w/replies, xml ) Need Help??


in reply to Re^4: remove first and last character of string (updated)
in thread remove first and last character of string

Let us assume you were confused because you weren't expecting tests.

A piece of code which accepts input and produces output is useful to the end user, but slightly less so to the developer trying to determine if a particular requirement of the code is met or not. Since your initial description of the problem is (and continues to be) very vague it is just about impossible for us or anyone else to produce a solution which matches precisely the unknown spec.

In such situations therefore, we produce instead a test. The test shows what output we expect for a given input, analyses the result of the code we use to try to satisfy the test and outputs the result of that test (using TAP - which is the output you have quoted here).

Here are some pages for you to read to undestand all this:

It may seem daunting and/or unnecessary now but it will help you a great deal in the long run.


🦛

  • Comment on Re^5: remove first and last character of string (updated)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2021-01-18 01:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?