Re: How can I get the date of today in perl
|-+---> | | [EMAIL PROTECTED] | | | Sent by:| | | [EMAIL PROTECTED]| | | veState.com | | | | | | | | | 11/11/02 22:51 | | | | |-+---> >| | | |To: [EMAIL PROTECTED], [EMAIL PROTECTED], | |[EMAIL PROTECTED], [EMAIL PROTECTED]| |cc: | |Subject: How can I get the date of today in perl | >| >It looks like localtime() function returns both Date and time, I only want >to get date. How can I do that in perl? >Thanks >Lixin Please don't cross-post. localtime returns a nine-element list which is typically used as follows: my ($Sec,$Min,$Hour,$Mday,$Mon,$Year,$Wday,$Yday,$Isdst) = localtime(time); $Mon has a range 0..11, and $Year has 1900 subtracted from it. So to do anything meaningful with the date parts: $Mon++; $Year+=1900; ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: How can I get the date of today in perl
[EMAIL PROTECTED] wrote: It looks like localtime() function returns both Date and time, I only want to get date. How can I do that in perl? use strict; use POSIX; my $date = strftime "%Y-%m-%d", localtime; print $date, "\n"; # or non-POSIX solution my @t = localtime; $date = sprintf "%02u-%02u-%02u", $t[5]+1900, $t[4]+1, $t[3]; print $date, "\n"; __END__ Don't cross-post to admin. -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / )// // DBE Collectibles Mailto:dbe@;todbe.com / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /___/_<_http://www.todbe.com/ ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
How can I get the date of today in perl
It looks like localtime() function returns both Date and time, I only want to get date. How can I do that in perl? Thanks Lixin ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: web form editor
> Im much interested in this topic but all i got with this code > was a "missing object" image in IE. I tried to download a > bunch of files like Richtx32.ocx and msxml3.cab that i found > on my way to making it work but nothing seemed to make the difference. > > Can anyone please explain this code further, installation > instructions, or direct me to some page covering this topic > (i've tried ASPN, MSDN, Google with no luck!). Don't bother with ActiveX controls and other nonsense if you're using IE5 or higher. This capability is built into IE5+. This web site explains it adequately: http://www.devarticles.com/art/1/90 I've seen a few "editor" javascript files you can download off the net for free that enable this functionality, but it will pay dividends to learn how it works for yourself. jpt ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Comparisons was [4]: Release of ActivePerl 5.8.0 - released today
- Original Message - From: "Jan Dubois" <[EMAIL PROTECTED]> > > That's why I asked you if the -O option worked. I think the standard > editions of Microsoft compilers don't include the optimizer. Seems to be > true for VC++ 6 too: > > http://msdn.microsoft.com/visualc/productinfo/previous/vc6/datasheet/feature .asp > > Maybe VC++ 6 Standard Edition supports the -O switch, but still doesn't > optimize. With the VC++ 7 compiler from the .NET Framework SDK you get a > warning that optimization is disabled when you try to use -O anyways. But > then, the SDK is free, so you cannot really complain. > > Cheers, > -Jan > Yes - it looks as though the -O options are silently ignored. I looked at 'nmake /?' and 'cl -help' and couldn't find any of the options appearing in 'perl -V' except for '-nologo' (in both cl and nmake) and '-MD' (in cl). They are actually quoted as '/nologo' and '/MD' which I guess is the same thing ?? cl help did list the following compiler optimisation flags: /G3 optimize for 80386 /G4 optimize for 80486 /G5 optimize for Pentium /G6 optimize for Pentium Pro /GB optimize for blended model (default) /GA optimize for Windows Application /GD optimize for Windows DLL Is it likely that any of them would be useful ? >From what I can gather, the next step up from msvc 6.0 standard edition (which does support -O optimisations) costs around $US1000. That be right ? I can't find any mention of the -O optimisations with 'gcc -help' either, though it *is* documented. It's all rather confusing. Cheers, Rob ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: web form editor
Hi! Im much interested in this topic but all i got with this code was a "missing object" image in IE. I tried to download a bunch of files like Richtx32.ocx and msxml3.cab that i found on my way to making it work but nothing seemed to make the difference. Can anyone please explain this code further, installation instructions, or direct me to some page covering this topic (i've tried ASPN, MSDN, Google with no luck!). Thanks / Magnus -- Original Message -- From: "Joseph Youngquist" <[EMAIL PROTECTED]> Date: Mon, 11 Nov 2002 14:17:51 -0500 >Found what I was talking about. > >height=240> > > >placing that in an html file will add a richedit control 6.0 to the page. > >Burak Gürsoy's e-mail is what your looking for though. > >JY ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
ActivePerl 5.8.0 & mod_perl 2
Hi, Does anyone successfully compile mod_perl 2 under ActivePerl 5.8.0? Under ActivePerl 5.8.0 build 802 Beta+mod_perl-1.99_07+Apache 2.0.43+VC++7.0,I meet the error as follows: cl -ID:/tmp/mod_perl-1.99_07/src/modules/perl -ID:/tmp/mod_perl-1.99_07/xs -Ic:\apache/include -nologo -Gf -W3 - MD -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERL IO -DPERL_MSVCRT_READFIX -I"D:\Perl\lib\CORE" -DMOD_PERL -MD -DNDEBUG -O1 -c modperl_interp.c && D:\Perl\bin\perl.exe -MExtUtils::Command -e mv modperl_interp.obj modperl_interp.lo modperl_interp.c D:\Perl\lib\CORE\XSUB.h(399) : warning C4005: ¡°exit¡± : ºêÖض¨Òå c:\apache\include\os.h(98) : ²Î¼û¡°exit¡±µÄÇ°Ò»¸ö¶¨Òå modperl_interp.c(41) : error C2065: ¡°my_perl¡± : δÉùÃ÷µÄ±êʶ·û modperl_interp.c(41) : warning C4047: ¡°º¯Êý¡± : ¡°PerlInterpreter *¡±Óë¡°int¡±µÄ¼ä½Ó ¼¶±ð²»Í¬ modperl_interp.c(41) : warning C4047: ¡°º¯Êý¡± : ¡°PerlInterpreter *¡±Óë¡°int¡±µÄ¼ä½Ó ¼¶±ð²»Í¬ NMAKE : fatal error U1077: ¡°cl¡± : ·µ»Ø´úÂë¡°0x2¡± Stop. NMAKE : fatal error U1077: ¡°cd¡± : ·µ»Ø´úÂë¡°0x2¡± Stop. But using perl5.8 from CPAN,it works! Thanks&Regards Xyzw ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Give me a (line)break!
Excellent, thanks Bill. Phil. |-+---> | | "$Bill Luebkert" <[EMAIL PROTECTED]> | | | Sent by:| | | [EMAIL PROTECTED]| | | veState.com | | | | | | | | | 12/11/02 08:21 | | | | |-+---> >--| | | | To: Phil Ritchie <[EMAIL PROTECTED]> | | cc: [EMAIL PROTECTED] | | Subject: Re: Give me a (line)break! | >--| Phil Ritchie wrote: > A poor pun I admit. ;-{ > > I'm using the command line below against a file that contains only two > characters. I want to insert only a linebreak (0x0a) between the two > characters. My output file contains both a carrage-return and linefeed > (0x0d, 0x0a) pair and I'm not sure why. I don't want the 0x0d character. > > Perl -pe "s/(\w)(\w)/$1\x0a$2/;" test.txt > test1.txt > > test.txt contains only the two byte sequence "0x61,0x62" - i.e. "ab" > > test1.txt contains the byte sequence "0x61,0x0d,0x0a,0x62". > > Is this because the file's being read in line mode? Can I change this and > still maintain the convenience of the one-liner? BEGIN { binmode STDOUT; } -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / )// // DBE Collectibles Mailto:dbe@;todbe.com / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /___/_<_http://www.todbe.com/ ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. www.vistatec.ie ** ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Give me a (line)break!
Phil Ritchie wrote: A poor pun I admit. ;-{ I'm using the command line below against a file that contains only two characters. I want to insert only a linebreak (0x0a) between the two characters. My output file contains both a carrage-return and linefeed (0x0d, 0x0a) pair and I'm not sure why. I don't want the 0x0d character. Perl -pe "s/(\w)(\w)/$1\x0a$2/;" test.txt > test1.txt test.txt contains only the two byte sequence "0x61,0x62" - i.e. "ab" test1.txt contains the byte sequence "0x61,0x0d,0x0a,0x62". Is this because the file's being read in line mode? Can I change this and still maintain the convenience of the one-liner? BEGIN { binmode STDOUT; } -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / )// // DBE Collectibles Mailto:dbe@;todbe.com / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /___/_<_http://www.todbe.com/ ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Give me a (line)break!
A poor pun I admit. ;-{ I'm using the command line below against a file that contains only two characters. I want to insert only a linebreak (0x0a) between the two characters. My output file contains both a carrage-return and linefeed (0x0d, 0x0a) pair and I'm not sure why. I don't want the 0x0d character. Perl -pe "s/(\w)(\w)/$1\x0a$2/;" test.txt > test1.txt test.txt contains only the two byte sequence "0x61,0x62" - i.e. "ab" test1.txt contains the byte sequence "0x61,0x0d,0x0a,0x62". Is this because the file's being read in line mode? Can I change this and still maintain the convenience of the one-liner? Phil. ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. www.vistatec.ie ** ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs