Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>

WEEK'S BEST

  • BackTrack 5 R1
  • Wine 1.2.3 / 1.4 RC3
  • Mozilla Firefox 10...
  • Ubuntu 11.04
  • Angry Birds 1.1.2.1
  • Ubuntu 10.04.3 LTS
  • Linux Kernel 3.2.6
  • Ubuntu Manual 10.10
  • Adobe Flash Player...
  • Pidgin 2.10.1
  • Home > Linux > Programming > Perl Modules

    UNIX::Cal 0.01

    Download button

    No screenshots available
    Downloads: 258  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Piers Harding | More programs
    Perl Artistic License / FREE
    March 7th, 2009, 19:18 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    UNIX::Cal description

    Perl wrapper for the original cal UNIX command line tool

    UNIX::Cal is a Perl wrapper for the original cal UNIX command line tool.

    SYNOPSIS

     use Data::Dumper;
     use UNIX::Cal;
     use UNIX::Cal qw(monday julian year);
     
     print Dumper(cal());


    UNIX::Cal is an implementation of good ol' UNIX command line cal.

    It is really paying homage to the original code from The Regents of the University of California and Berkeley by Kim Letkeman.

    As with UNIX cal, you can specify the switches to change the behaviour

    use UNIX::Cal qw(monday); give the -m switch effect.

     -m = monday - set monday as the first day of the week
     -j = julian - generate the days in julian format
     -y = year - automatically create a years calendar


    There is only one method - cal(). This method is pushed into the calling packages namespace, so it doesn't need to be fully qualified. cal() is called in three forms:

     cal(); - no arguments gives the current month unless -y was specified.
     cal(5, 2002); - returns the calendar for May, 2002.
     cal(2002); - returns the calendar ( each month ) for 2002.


    The result of the cal() method is an array ref.

    For a single months results: $VAR1 = [ [ 'May', 2002 ], [ 'Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa' ], [ '', '', '', 1, 2, 3, 4 ], [ 5, 6, 7, 8, 9, 10, 11 ], [ 12, 13, 14, 15, 16, 17, 18 ], [ 19, 20, 21, 22, 23, 24, 25 ], [ 26, 27, 28, 29, 30, 31, '' ] ];

    The results for a year are like so: $VAR1 = [ [ 2002 ], [ [ 'January', 2002 ], [ 'Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa' ], [ '', '', 1, 2, 3, 4, 5 ], [ 6, 7, 8, 9, 10, 11, 12 ], [ 13, 14, 15, 16, 17, 18, 19 ], [ 20, 21, 22, 23, 24, 25, 26 ], [ 27, 28, 29, 30, 31, '', '' ] ], [ [ 'February', 2002 ], [ 'Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa' ], [ '', '', '', '', '', 1, 2 ], [ 3, 4, 5, 6, 7, 8, 9 ], [ 10, 11, 12, 13, 14, 15, 16 ], [ 17, 18, 19, 20, 21, 22, 23 ], [ 24, 25, 26, 27, 28, '', '' ] ], ...................


    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    cal wrapper | Perl module | Perl wrapper | Perl | cal | wrapper



    HTML code for linking to this page:


    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM