Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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

by hippo (Bishop)
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?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2022-06-24 22:40 GMT
Find Nodes?
    Voting Booth?
    My most frequent journeys are powered by:

    Results (80 votes). Check out past polls.