0

How to initialize an array of String using Perl qw()

Posted by Joys of Programming on November 23, 2009 in Perl

The perl function qw() is the simplest way by which strings can be initialized. my @day1 = (‘Sunday’, ‘Monday’, ‘Tuesday’, ‘Wednesday’, ‘Thursday’, ‘Friday’, ‘Saturday’); my @day2 = qw (Sunday Monday Tuesday Wednesday Thursday Friday Saturday); print $day1[6]; See how day1 and day2 are initialized. qw does not require each string to be declared in quotes [...]

Tags: , , ,

 
0

How to initialize an array of Strings in Perl?

Posted by Joys of Programming on November 23, 2009 in Perl

The simplest method to initialize a string in Perl

Tags: ,

 
0

How to calculate the year of day in Perl

Posted by Joys of Programming on November 23, 2009 in Perl

Day of the year is the number of days passed since January 1st of this year. localtime gives a lot of information like hours, minutes, seconds, month, day and year. It also returns day of the year

Tags: , , ,

 
0

Unix time to Human Readable time using Perl localtime

Posted by Joys of Programming on November 23, 2009 in Perl

Perl has a function time to get the current time. But the function returns the Epoch time, which is number of seconds that have passed since January 1 1970. Using function localtime, the unix time can be converted to human readable time

Tags: ,

Copyright © 2009-2010 Joys of Programming All rights reserved.
Desk Mess Mirrored v1.7.2 theme from BuyNowShop.com.