1
@browser = ("NS", "IE", "Opera");
@browser =join("Browser:", @browser); 

I was loooking

Browser:NS Browser:IE Browser:Opera

but shows only end of last 2 string . how to reslove this issue .

5 Answers 5

6

You really want a map here:

@browser = map { "Browser:$_" } @browser;
Sign up to request clarification or add additional context in comments.

Comments

6

Use map instead to perform an operation on each element in the array.

print join(' ', map("Browser:$_", @browser));

Comments

4

map is what you want here:

@browser = map { "Browser:$_" } @browser

Comments

4
@browser = map "Browser:$_", @browser;

Or

$_ = "Browser:$_" for @browser;

Comments

3
$browser = join("Browser:", "", @browser);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.