[9225] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2820 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 9 10:07:14 1998

Date: Tue, 9 Jun 98 07:01:09 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 9 Jun 1998     Volume: 8 Number: 2820

Today's topics:
    Re: 'fork' on x86 port of Perl <dformosa@st.nepean.uws.edu.au>
        [Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
        Animated gifs question ... <joe@halbrook.com>
        ANNOUNCE: Date::Calc 4.1 <sb@sdm.de>
        C++ parser (Ben Jones)
    Re: Capitalizing acronyms (Re: Is PERL case sensitive?) (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)
    Re: Date Manipulation (Mike Stok)
    Re: Day of Week Display for User-defined date (Mike Whitaker)
        Help! zucker@my-dejanews.com
    Re: How do you check an input buffer for data? <tchrist@mox.perl.com>
        how to execute UNIX history <eraflll@ki.ericsson.se>
    Re: lambda fun in Perl (Greg Bacon)
        locking DBM files... <james@cydaps.co.uk.NOSPAM>
        Package Question -- How can I circularly include? <npk@bnl.gov>
    Re: pass the gravy and the hashref, please <jdporter@min.net>
        password-window ? <stark@wuelfrath.de>
    Re: password-window ? (Juergen Heinzl)
    Re: perl-frage (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)
    Re: Preventing file conflicts (Michael J Gebis)
        Prob in FAQ: Week of the year <antti.boman***SP@MPROTECTION***mindcom.fi>
    Re: Prob in FAQ: Week of the year <quentin@shaddam.amd.com>
    Re: Reading a file from the bottom up (Tim Cooper)
    Re: rexx to perl conversion (Ian Collier)
        Script for webmail skyboy@my-dejanews.com
        sybperl-1.011 backtick problem (Thong Ly)
    Re: Test running PERL script in Windows 95 <quednauf@nortel.co.uk>
    Re: test.. <dorr@cetrel.lu>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 9 Jun 1998 08:14:53 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: 'fork' on x86 port of Perl
Message-Id: <897380093.532985@cabal>

In <357CDCB3.EA325C3@rogers.wave.ca> Shaun Jackman <sjackman@rogers.wave.ca> writes:

>The fork function crashes with
>"The Unsupported function fork function is unimplemented"
>upon use.

>Is there an implementation of fork avaiable for the x86?

Its not the fact its an x86 but because its running over Windows(NT/95)
this is due to limmitations within the OS.  I would recomen if you need
fork installing Linux/FreeBSD.

--
I'm a perl programer; if you need perl programing, hire me. 
Please excuse my spelling as I suffer from agraphia; see the url. Support NoCeM
http://www.cit.nepean.uws.edu.au/~dformosa/Spelling.html  http://www.cm.org/ 
I'm sorry but I just don't consider 'because its yucky' a convincing argument


------------------------------

Date: Tue, 09 Jun 1998 10:24:01 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage897387841.10458@news.teleport.com>

Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 18 May 1998

[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last major update of the Perl FAQ was in Spring of
1997; of course, ongoing updates are made as needed. ]

For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).

    http://cpan.perl.org/doc/FAQs/

Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.

    perldoc perlfaq
    man perlfaq

If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.

If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
403_662_481 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.

    http://cpan.perl.org/
    http://www.perl.com/CPAN/
    http://cpan.perl.org/doc/FAQs/FAQ/html/perlfaq.html
    http://www.perl.com/CPAN/doc/FAQs/FAQ/html/perlfaq.html

You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)

    California     ftp://ftp.cdrom.com/pub/perl/CPAN/
    Texas          ftp://ftp.metronet.com/pub/perl/
    South Africa   ftp://ftp.is.co.za/programming/perl/CPAN/
    Japan          ftp://ftp.dti.ad.jp/pub/lang/CPAN/
    Australia      ftp://cpan.topend.com.au/pub/CPAN/
    Netherlands    ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
    Switzerland    ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
    Chile          ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/

If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
Another possibility is to use one of the FTP-via-email services; for
more information on doing that, send mail to <mail-server@rtfm.mit.edu>
(not to me!) with these lines in the body of the message, flush left:

    setdir usenet-by-group/news.announce.newusers
    send Anonymous_FTP:_Frequently_Asked_Questions_(FAQ)_List

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.

Have fun with Perl!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/


------------------------------

Date: Tue, 09 Jun 1998 08:49:05 -0500
From: Joe Halbrook <joe@halbrook.com>
Subject: Animated gifs question ...
Message-Id: <357D3D51.45D6@halbrook.com>

I've come across a strange occurrence:

I load a rotating image via a Perl script:

<IMG SRC="http://www.my.server.com/cgi-bin/image.pl?A4993948585" ...>

When the image is not animated, all is fine.  But, when the image is an
animated gif, it only runs thru the first iteration of the animation,
then stops.  Why doesn't it loop continuously, like it does when I
replace the above line with:

<IMG SRC="http://www.my.server.com/image.gif ...>

Any help is appreciated.

-Joe Halbrook


------------------------------

Date: 9 Jun 1998 11:28:18 GMT
From: Steffen Beyer <sb@sdm.de>
Subject: ANNOUNCE: Date::Calc 4.1
Message-Id: <6lj68i$gs3$3@bsdti6.sdm.de>

I am pleased to announce version 4.1 of the "Date::Calc" module:


The package is available for download either from my web site at

                  http://www.engelschall.com/u/sb/download/

or from any CPAN (= "Comprehensive Perl Archive Network") mirror server:
(allow a few days for propagation if necessary)

                  http://www.perl.com/CPAN/authors/id/STBEY/


The package consists of a C library (useful for C developers) which is the
core of a Perl (wrapper) module (for easy access to the library from Perl).

The C library is specifically designed so that it can be used stand-alone,
without Perl.


What does it do:
----------------

This package consists of a C library and a Perl module (which uses
the C library, internally) for all kinds of date calculations based
on the Gregorian calendar (the one used in all western countries today),
thereby complying with all relevant norms and standards: ISO/R 2015-1971,
DIN 1355 and, to some extent, ISO 8601 (where applicable).

(See also http://www.engelschall.com/u/sb/download/Date-Calc/DIN1355/
for a scan of part of the "DIN 1355" document (in German)).

The module of course handles year numbers of 2000 and above correctly
("Year 2000" or "Y2K" compliance) -- actually all year numbers from 1
to the largest positive integer representable on your system (which
is at least 32767) can be dealt with.

Note that this package EXTRAPOLATES the Gregorian calendar BACK
until the year 1 A.D. -- even though the Gregorian calendar was only
adopted in 1582 by most (not all) European countries, in obedience to
the corresponding decree of catholic pope Gregor I in that year.

Some (mainly protestant) countries continued to use the Julian calendar
(used until then) until as late as the beginning of the 20th century.

Finally, note that this package is not intended to do everything you could
ever imagine automagically for you; it is rather intended to serve as a
toolbox (in the best of UNIX spirit and traditions) which should, however,
always get you where you want to go.

If nevertheless you can't figure out how to solve a particular problem,
please let me know! (See e-mail address at the bottom of this document.)


Changes in version 4.1:
-----------------------

Fixed the bug in "Add_Delta_YMD()" involving month offsets with days at
the end of the month, which caused this function to return invalid dates.


Legal issues:
-------------

Copyright (c) 1995, 1996, 1997, 1998 by Steffen Beyer.
All rights reserved.

This package is free software; you can redistribute it and/or
modify it under the same terms as Perl itself, i.e., under the
terms of the "Artistic License" or the "GNU General Public License".

The C library at the core of this Perl module can additionally
be redistributed and/or modified under the terms of the
"GNU Library General Public License".


Prerequisites:
--------------

Perl version 5.000 or higher, and an ANSI C compiler (!)
                                     ^^^^^^


Author's note:
--------------

If you have any questions, suggestions or need any assistance, please
let me know!

I would in fact be glad to receive any kind of feedback from you!

I hope you will find this module beneficial.

Yours,
--
  Steffen Beyer <sb@engelschall.com> http://www.engelschall.com/u/sb/
       "There is enough for the need of everyone in this world,
         but not for the greed of everyone." - Mahatma Gandhi


------------------------------

Date: Tue, 09 Jun 1998 11:44:12 GMT
From: ben_jones@usa.net (Ben Jones)
Subject: C++ parser
Message-Id: <35842002.12910253@news.demon.co.uk>
Keywords: *

Hi,

Does anyone know of a perl script which will parse C++ source files,
and extract class/function names etc.

Thanks,

ben_jones@usa.net


------------------------------

Date: Tue, 09 Jun 1998 13:37:33 +0100
From: lassehp@imv.aau.dk (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)
Subject: Re: Capitalizing acronyms (Re: Is PERL case sensitive?)
Message-Id: <lassehp-0906981337340001@mimer.imv.aau.dk>

In article <6lhkfm$lob$1@marina.cinenet.net>, cberry@cinenet.net (Craig
Berry) wrote:

>At this point, shouldn't that be 'faq'? :)

No. As capitals are used on Usenet for shouting, and as 'faq' should
always be SHOUTED (or at least spoken with a loud and clear voice), I
think 'FAQ' is right. Same with RTFM! ;-)

-Lasse


------------------------------

Date: 9 Jun 1998 13:56:54 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Date Manipulation
Message-Id: <6ljev6$mq2@news-central.tiac.net>

In article <357E024B.BD377B5B@perlsearch.hypermart.net>,
Matt McKenzie  <webmaster@perlsearch.hypermart.net> wrote:
>I'm having trouble converting a string into a nicely formatted
>date.
>I've tried HTTP::Date, but it will not accept the format.
>
>I'm trying for example to convert:
>
>980517    to    17 May 1998   or   17/May/1998
>
>I know its not very Y2K compliant, but obviously simtel has
>not cottoned on to converting their CSV file listings.

One way to do it is to use some of the modules which come with a standard
perl distribution e.g. (in the debugger)

  DB<1> use Time::Local

  DB<2> use POSIX 'strftime'

  DB<3> $date = '980517'

  DB<4> ($yy, $mm, $dd) = $date =~ /(\d\d)(\d\d)(\d\d)/;

  DB<5> print strftime '%d %B %Y', localtime timelocal 0, 0, 0, $dd, $mm-1, $yy
17 May 1998

or you might look on CPAN (check out the CPAN link on http://www.perl.com
) for modules which are specifically tailored to date & time parsing &
formatting and install one of them.

As you seem aware of the issues to do with the turn of the century they
don't need pointing out :-)  Time::Local and POSIX are documented in the
perl distribution.

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


------------------------------

Date: 9 Jun 1998 09:08:32 GMT
From: mrw@malay.entropic.co.uk (Mike Whitaker)
Subject: Re: Day of Week Display for User-defined date
Message-Id: <slrn6npume.g3f.mrw@malay.entropic.co.uk>

>In the time it takes you to scold me you could have pointed me to an
>answer.

And you'd be none the wiser next time.

This is an example of the old adage about giving a man a fish versus
teaching him to fish. Most of the 'experts' on this group prefer the 
latter approach.
-- 
Mike Whitaker: Sysadmin, Entropic Cambridge Research Labs


------------------------------

Date: Tue, 09 Jun 1998 09:18:09 GMT
From: zucker@my-dejanews.com
Subject: Help!
Message-Id: <6liukh$vid$1@nnrp1.dejanews.com>

* Please excuse the posting, I've had no luck in
comp.infosystems.www.authoring.cgi

Hello,

I can expire 1 cookie at a time with the statements:

    $expires = "Mon, 03-Jun-96 00:00:00 GMT";

    print "Set-Cookie: myCookie=null; expires=$expires\n\n";

but when I want to expire multiple cookies with the statements:

    @cookies = split (/;/,$ENV{'HTTP_COOKIE'});

    foreach $cookie_element (@cookies)
    {
        @temp = split (/\|/,$cookie_element); #cookie values are delimited by
pipes
        $temp[0] =~ s/\s+|=//g; #strip leading spaces and the '=' character
        print "Set-Cookie: $temp[0]=null; expires=$expires\n\n";
    }

it seems to only expire the last cookie, not all of the cookies.

I also do a:

print qq!<META HTTP-EQUIV="REFRESH" CONTENT="0;URL=$url">!;

at the end so that the cookie changes take effect.

Any Help would be appreciated.

Thanks in Advance.

Rob.



-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


------------------------------

Date: 9 Jun 1998 10:36:57 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How do you check an input buffer for data?
Message-Id: <6lj389$3u6$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Shaun Jackman <sjackman@rogers.wave.ca> writes:
:I have a section of code
:
:#S is a socket
:for(;;) {
:  @in = <S>;
:  print @in;
:  $out = <>;
:  print S $out;
:}
:
:What I want this to do is display all data received from the socket,
:and then read one line of input and send it to the socket.
:However, @in = <S> reads all data from the socket, and then stops,
:waiting for more... which isn't going to come.
:
:How do I set it to read all currently avaiable data from the buffer, and
:continue on if no more data is currently avaiable.

Well, you are assuming that you get EOF from S on reading before 
you provide data back to it, which means it has to know to 
call shutdown(S,1).  

You could learn about nonblocking stuff.

    # nonblock($socket) puts socket into nonblocking mode
    sub nonblock {
        my $socket = shift;
        my $flags;
        
        $flags = fcntl($socket, F_GETFL, 0)
                or die "Can't get flags for socket: $!\n";
        fcntl($socket, F_SETFL, $flags | O_NONBLOCK)
                or die "Can't make socket nonblocking: $!\n";
    }

Or even FIONREAD if stdio doesn't intrude.

--tom
-- 
    OOPS!  You naughty creature!  You didn't run Configure with sh!
    I will attempt to remedy the situation by running sh for you...
        --Larry Wall in Configure from the perl distribution


------------------------------

Date: Tue, 09 Jun 1998 12:09:46 +0200
From: Leif Jonsson <eraflll@ki.ericsson.se>
Subject: how to execute UNIX history
Message-Id: <357D09EA.47EA@ki.ericsson.se>

how to execute UNIX history with a perl scrip.
I have tried:
open (HIS,"history|");

even tried to run it:
system(history);

but i dont work
how to do????
leif.jonsson@ki.ericsson.se


------------------------------

Date: 9 Jun 1998 13:59:39 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: lambda fun in Perl
Message-Id: <6ljf4b$rr4$1@info.uah.edu>

In article <yo33edf2dj3.fsf@shell13.ba.best.com>,
	Xah Lee <xah@shell13.ba.best.com> writes:
:  "Perl: all unix's stupidity in one."

 ...and when we hook it to the Troll-O-Meter...

    [...................../]
                 TROLL! TROLL! TROLL!

This could get ugly. :-)

Greg
-- 
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF


------------------------------

Date: Tue, 9 Jun 1998 14:42:25 +0100
From: "James" <james@cydaps.co.uk.NOSPAM>
Subject: locking DBM files...
Message-Id: <897399846.16995.0.nnrp-05.c2de3f1b@news.demon.co.uk>

Hi,

What is the best way to lock a DBM file? I have been told that they don't
have any locking features of their own, so I should use Flock(), but is
there any special method to using flock() with DBM files or would the
following work okay??


dbmopen(%DATA, "database.dbm", 0666);
&lock_excl(DATA); # should this be &lock_exel(%DATA);??
$data_out = $DATA{$name};
dbmclose(%DATA);
&lock_unlock(DATA);#should this be &lock_unlock(%DATA);


#### flock commands...

sub lock_excl {
# File locking constants
$LOCK_EXCL   = 2;
flock($_[0], $LOCK_EXCL);
}

sub lock_share {

# File locking constants
$LOCK_SHARED = 1;
flock($_[0], $LOCK_SHARED);
}

sub lock_unlock {
# File locking constants
$LOCK_UNLOCK = 8;
flock($_[0], $LOCK_UNLOCK);
}



Thanks for any help with this.


James

Please remove .NOSPAM if replying by email.





------------------------------

Date: Tue, 09 Jun 1998 13:22:37 +0000
From: Nicholas Konidaris <npk@bnl.gov>
Subject: Package Question -- How can I circularly include?
Message-Id: <357D371D.9584201C@bnl.gov>

Hey everyone:

I am trying to make two objects:
ConnectionManager
Connection

Each Connection is to have a reference to the ConnectionManager.  For
some reason, perl is not allowing me to do this.  I have the following
code:

ConnectionManager.pm
~~~~~~~~~~~~~~~~~~~
package ConnectionManager;
BEGIN {
    use Connection;
    ...
}

Connection.pm
~~~~~~~~~~~~
package Connection;
BEGIN {
    use ConnectionManager;
    ...
}


So, it does not seem I can have a circular 'use'

What am I doing wrong?

Thank you,
nick



------------------------------

Date: Tue, 09 Jun 1998 13:48:33 GMT
From: John Porter <jdporter@min.net>
Subject: Re: pass the gravy and the hashref, please
Message-Id: <357D3EB7.BF@min.net>

Chris Winters wrote:
> A problem that's puzzling me. I will try to explain it as clearly
> as I can.

Post the code.

John Porter


------------------------------

Date: Tue, 09 Jun 1998 11:03:27 +0200
From: Dennis Stark <stark@wuelfrath.de>
Subject: password-window ?
Message-Id: <357CFA5A.6675D708@wuelfrath.de>

I4m searching for the funktion to make the browser open an extra window for
asking the user for id and password !

thanks for every kind of inspiration !

Dennis


------------------------------

Date: 9 Jun 1998 10:39:17 GMT
From: juergen@lth330dn.sbs.de (Juergen Heinzl)
Subject: Re: password-window ?
Message-Id: <slrn6nq4bu.4ss.juergen@lth330dn.sbs.de>

In article <357CFA5A.6675D708@wuelfrath.de>, Dennis Stark wrote:
>I4m searching for the funktion to make the browser open an extra window for
>asking the user for id and password !

This is not really a function but the servers business and if you've apache
see AuthName, AuthType and related topics.

Bye, Juergen

-- 
\ Real name	  : Juergen Heinzl    \                          /
 \ Email (office ) : idoinet@sbs.de    \       no flames,       /
  \ Email (private) : unicorn@noris.de  \  send money instead  /
   \ Phone (private) : +49 911-4501186   \                    /


------------------------------

Date: Tue, 09 Jun 1998 14:31:15 +0100
From: lassehp@imv.aau.dk (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)
Subject: Re: perl-frage
Message-Id: <lassehp-0906981431150001@mimer.imv.aau.dk>

In article <01bd923c$143a4ca0$97a5a8c1@default>, "wolfram.oehms"
<wolfram.oehms@metronet.de> wrote:

>Gibt es eine Mvglichkeit, die Mail-Adresse eines Besuchers zu verwenden,
>ohne da_ sie von ihm eingegeben werden mu_?

Nur wenn die Mail-Adresse schon dem Server bekannt ist, zum Beispiel durch
Authentication oder Cookies. In diesem Fall reicht es aus einmal die
Adresse einzugeben. Die Adresse wird danach gelagert und spdter wird der
Nutzer durch ein Password oder Cookie identifiziert, und die Adresse ist
davon gegeben.

Aber das war keine Perl-Frage, sondern eine CGI-Frage.

For non-german speakers:
Only if the mail address is known to the server already, for example
through authentication or cookies. In that case it is sufficient to enter
the address once. The address is then stored and later the user is
identified with a password or cookie, leading to the address.

But that was not a Perl-question, but a CGI-question.

-Lasse


------------------------------

Date: 9 Jun 1998 02:54:58 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Preventing file conflicts
Message-Id: <6li862$qu0@mozo.cc.purdue.edu>

Tom Christiansen <tchrist@mox.perl.com> writes:

}There is no room in this world, or this newsgroup, for the notion that
}"I'm screwed into being stuck on Windows (`a tale told by an idiot...')
}so I will just ask for free consulting help instead of looking things
}up things in the docs on my own system."

Thank goodness there's room to rant.

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


------------------------------

Date: Tue, 9 Jun 1998 13:50:18 +0300
From: "Antti Boman" <antti.boman***SP@MPROTECTION***mindcom.fi>
Subject: Prob in FAQ: Week of the year
Message-Id: <6lj41f$27u$1@hiisi.inet.fi>

The FAQ states:

$week_of_year = int($day_of_year / 7);

This is most of the time incorrect. The first week of the year is usually
not seven days. This year, the first day of the year is Thursday. According
to the formula Wednesday 7th is in week one, not two (as it is).

Just my two cents.

- Antti Boman




------------------------------

Date: 09 Jun 1998 07:39:46 -0500
From: Quentin  Fennessy <quentin@shaddam.amd.com>
Subject: Re: Prob in FAQ: Week of the year
Message-Id: <ximu35uoijx.fsf@shaddam.amd.com>

>>>>> "Antti" == Antti Boman <antti.boman***SP@MPROTECTION***mindcom.fi> writes:

    Antti> The FAQ states: $week_of_year = int($day_of_year / 7);
    Antti> This is most of the time incorrect. The first week of the
    [...]

And of course you can use use Date::DateCalc and the week_number()
subroutine from Date::DateCalc.

Perhaps Date::DateCalc should be mentioned in the faq like this:

Data: Dates
     How do I find the week-of-the-year/day-of-the-year?

     The day of the year is in the array returned by localtime()
     (see the section on localtime in the perlfunc manpage):

         $day_of_year = (localtime(time()))[7];

     or more legibly (in 5.004 or higher):

         use Time::localtime;
         $day_of_year = localtime(time())->yday;

     You can find the week of the year by calling week_number() as
     provided by Date::DateCalc.  Date::DateCalc is available in
     CPAN.

Here is the Date::DateCalc section on week_number():

     ===========================================

     ($week,$year) = week_number($year,$mm,$dd);

     ===========================================

     This function calculates the number of the	week in	which the
     given date	lies.

     This can occasionally be the last week of the previous year
     or	the first week of the next year.

     If	the given date is invalid, an empty list is returned.

-- 
Quentin Fennessy			AMD, Austin Texas
Secret hacker rule #11 - hackers read manuals


------------------------------

Date: 9 Jun 98 12:28:49 GMT
From: timc@carlton.innotts.co.uk (Tim Cooper)
Subject: Re: Reading a file from the bottom up
Message-Id: <357d2a81.0@mapperley.innotts.co.uk>

REUBEN LOGSDON (rlogsdon@io.com) wrote:
: On Sat, 6 Jun 1998, Tan wrote:
: > Is there a way to read files starting from the end?
: ...
: this reads file line-by-line from last line to first line:
: open(F,"<file");
: foreach (reverse <F>) {
: 	$myLine = ..etc
: 	}

Yup this works fine but I suspect it still reads
the whole file in first.

Using this on a humungously huge data file
caused my script to core dump but it was ok
with small files.

Tim Cooper


------------------------------

Date: 9 Jun 1998 12:40:06 GMT
From: imc@comlab.ox.ac.uk (Ian Collier)
Subject: Re: rexx to perl conversion
Message-Id: <14583-anthem.imc@comlab.ox.ac.uk>

In article <357C8431.F4FC47D6@gwise.louisville.edu>, Patrick Hughes <pjhugh01@gwise.louisville.edu> wrote:
>Has anyone seen, heard of, dreamt about or otherwise gained knowledge of
>a REXX to perl translator...

Anders Christensen presented a paper at the Rexx Symposium in 1997 on this
subject and basically came to the conclusion that it would be impractical
to construct such a translator.  It is easier to rewrite the program by hand
instead.
-- 
---- Ian Collier : imc@comlab.ox.ac.uk : WWW page below
------ http://www.comlab.ox.ac.uk/oucl/users/ian.collier/imc.html


------------------------------

Date: Tue, 09 Jun 1998 13:44:22 GMT
From: skyboy@my-dejanews.com
Subject: Script for webmail
Message-Id: <6lje7n$ial$1@nnrp1.dejanews.com>

Does anyone have a Perl script that allow the users in my LAN acess
e-mails through Web ?

Thanks
ACJr.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


------------------------------

Date: 9 Jun 1998 10:14:16 GMT
From: tly@Japan.ml.COM (Thong Ly)
Subject: sybperl-1.011 backtick problem
Message-Id: <6lj1to$jj$1@news.ml.com>
Keywords: sybperl

Has anyone come across a problem with using backtick in sybperl-1.011
(based on perl-4.036) on Sun's Ultra-2 system running Solaris 2.5.1?
Backtick works fine for perl-4.036, but with sybperl-1.011, it
hangs waiting for input from STDIN.

Any info would be very much appreciated.

Thanks,
Thong


------------------------------

Date: Tue, 09 Jun 1998 10:41:32 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Test running PERL script in Windows 95
Message-Id: <357D034C.AE061DB0@nortel.co.uk>

Ong Joo Chin wrote:

> ... PERL script and test run in
> my Window 95 machine with Netscape browser before FTP to the remote
> site.

 This is not a Perl question. You need a webserver to test CGI. Then
loopback to access 127.0.0.1 ... But I am still waiting for someone to
grab the Netscape source code and build the Perl interpreter into !!! :)

--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________





------------------------------

Date: Tue, 09 Jun 1998 10:31:05 +0200
From: Denis DORR <dorr@cetrel.lu>
Subject: Re: test..
Message-Id: <357CF2C9.A667417B@cetrel.lu>

Bryan Seltzer wrote:
> 
> ignore...test

Are you the famous Bryan Seltzer from the 'Stray Cats' ???

-- 

    "We're gonna rock this town ..."

dorr@cetrel.lu


------------------------------

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 2820
**************************************

home help back first fref pref prev next nref lref last post