Tuesday, May 10, 2011

Special character $" in perl

Consider following array varaible :-

@foo = ("one", "two", "three");

When we say :-

print @foo;

We get following output

one two three

i.e. :- All values sperated by a space.

Now we will assign :-

$" = " ++++ ";
print foo;

Now the output will be :

one ++++ two ++++ three

Which means $" acts as a delimiter for array.

NOTE :-
Same behavior is seen when :-

$bar = "@foo"

No comments:

Post a Comment