Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

array lines offset 1

Status
Not open for further replies.

newtarge

ISP
Oct 27, 2003
21
0
0
US
I can't remeber why this happens or how to fix it. but when I have info in and array and parse it with a foreach loop them push the line into an new array then print it does it do some thing like this

info
info2
info3
info4
info5

1st is flush and the all the rest of the lines are 1 space at the beggining. I did chop the array before parsing.
 
hi newtarge

chop removes the last character of the line - not the first

try this:-

$text = " info2";
$text =~ s/^\s+//;
print $text


Kind Regards
Duncan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top