in reply to Re^2: Help with split() function
in thread Help with split() function
You have several problems here. The main one is that you decided to use split for no obvious reason. Yes it can be done that way, but why would you want to?
The simplest would be just to use a regular expression to find a 'p' in the line, all you need is: print if /p/i; No split is required.
Where split could be used is split '' which breaks up each character into a seperate list element. You could then test each one in a loop. This method is occasionally useful, but only for specialised character-by-character operations, not for a simple task like this. You also seem unclear as to what accessing an array is doing. I suggest you read the section on arrays before you try to use them.
Keep plugging with the book, and keep writing Perl.