How to use a here-document to assign an array

Perl Add comments

To use a here-document to assign an array, one line per element, you might use an approach like this:

@sauces = <<End_lines =~ m/(\S.*\S)/g;
	normal tomato
	spicy tomato
	green chile
	pesto
	white wine
End_Lines

Leave a Reply

You must be logged in to post a comment.

WebSite Powered by webHauser
Entries RSS Comments RSS Login