|
|
|
Your skill will accomplish what the force of many cannot |
|
| PerlMonks |
(bwana147) Using printfby bwana147 (Pilgrim) |
| on Jul 02, 2001 at 14:32 UTC ( [id://93184]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
Other mighty monks have already said all that there is to say. I'll just add some comments about legibility and nice formatting. The printf function takes a format as first argument, and then a list of values. The first argument being special, I'm fond of using the => operator to let it stand out from the rest: printf "%18s %18s %18s\n" => $ip_date_time[$i]{ip}, $ip_date_time[$i]{date}, $ip_date_time[$i]{time};Now, we use three times the $ip_data_time[$i]: if you translate that into English, it reads: "print out the ip of the ith element of $ip_date_time, the date of the ith element of $ip_date_time and the time of the ith element of $ip_date_time". I guess it would sound more natural to say "print out the ip, date and time of the ith element of $ip_date_time". Several ways to say that in perl:
Voilà, that was just my €0.02. --bwana147
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||