Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: print array

by ww (Bishop)
on Aug 22, 2012 at 19:02 UTC ( #989120=note: print w/ replies, xml ) Need Help??


in reply to print array

... and, unless you want to print the list of months on a single line, without spaces, you may want to print (or, with a recent Perl, say) thru a for/foreach loop:

...(your lines 1 - 4)... for my $month(@month) { say $month; }


Comment on Re: print array
Select or Download Code
Replies are listed 'Best First'.
Re^2: print array
by BillKSmith (Deacon) on Aug 22, 2012 at 19:50 UTC

    Or on a single line with spaces.

    print "@month\n";

    (The default value for $OUTPUT_FIELD_SEPARATOR is space.)

    Bill
Re^2: print array
by influx (Beadle) on Aug 22, 2012 at 20:58 UTC
    If say isn't available you can use 5.010 or just use feature 'say';

    If you just want a quick peek into an array, Data::Dumper is good for that or just print "$_\n" for @month

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://989120]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (15)
As of 2015-07-28 20:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (258 votes), past polls