Ruby - Introduction p method

Introduction

p is an alternative to using inspect.

Demo

p "this is a test".split(/\s+/)

Result

p is useful alternative to using puts when playing with expressions.

It shows you the structure of the object(s) returned by the expression following it.