kevind0718 has asked for the wisdom of the Perl Monks concerning the following question:
Hello Wise Monks:
I have a very simple print question: The following code does what I need:produces the following, which is what I expected:@array = 5..9; print " @array \n"; push @array, 10; print "@array \n" ; push @array, qw( fred barney wilma) ; print "@array \n" ;
My question is: what is going on in this code?C:\dev\learningPerl>perl ex3a.pl 5 6 7 8 9 5 6 7 8 9 10 5 6 7 8 9 10 fred barney wilma C:\dev\learningPerl>
produces the following, which seems strange to me. Certainly not what I expected.@array = 5..9; print @array . "\n"; push @array, 10; print @array . "\n" ; push @array, qw( fred barney wilma) ; print @array . "\n" ;
C:\dev\learningPerl>perl ex3a.pl 5 6 9 C:\dev\learningPerl>
Just try to learn Perl and the above seeems strange to me.
Many Thanks for your kind assistance.
Best KD
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: simple printing question
by jwkrahn (Abbot) on Jan 31, 2012 at 23:33 UTC | |
by kevind0718 (Scribe) on Feb 01, 2012 at 02:47 UTC | |
|
Re: simple printing question
by InfiniteSilence (Curate) on Jan 31, 2012 at 23:32 UTC |