Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Very simple calendar

by theguvnor (Chaplain)
on Dec 21, 2003 at 21:07 UTC ( [id://316243]=note: print w/replies, xml ) Need Help??


in reply to Very simple calendar

Cool - I've wanted a cal tool on Windows... Anyone know where can I find out how to "fix" the escape sequences you put in there, to work with Win9x? Looked through the perldoc documentation but couldn't find anything.

Update: ++Juerd for pointing me to the ansi.sys driver.

[Jon]

Replies are listed 'Best First'.
Re: Re: Very simple calendar
by The Mad Hatter (Priest) on Dec 21, 2003 at 21:32 UTC
    Just stripped out the escape sequences...
    #!/usr/bin/perl -w use strict; use Calendar::Simple qw(calendar); use POSIX qw(strftime); my $today = strftime '%Y-%m-%d', localtime; my ($year, $month) = split /-/, shift || $today; printf "\n%04d-%02d\n\n", $year, $month; print "Mon Tue Wed Thu Fri Sat Sun\n"; for (calendar $month, $year, 1) { for (@$_) { no warnings; $_ = sprintf '%3s', $_ || ''; } print "@$_\n"; } print "\n";
    diff -u ...

      no warnings;

      Not needed anymore. It was there because I was too lazy to deal with the $_ not being numeric when it's empty, in the sprintf line.

      Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

Re: Re: Very simple calendar
by Juerd (Abbot) on Dec 21, 2003 at 23:11 UTC

    Anyone know where can I find out how to "fix" the escape sequences you put in there, to work with Win9x?

    IIRC, there's a little device driver called ANSI.SYS that you can load from CONFIG.SYS. I think it was something like

    DEVICE=X:\PATH\TO\ANSI.SYS
    But it's been a few years since I last used Windows for more than fixing other people's computers.

    Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

      Thanks... it works perfectly.

      [Jon]

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (7)
As of 2024-03-28 18:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found