[9982] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3575 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 28 12:03:13 1998

Date: Fri, 28 Aug 98 09:00:22 -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           Fri, 28 Aug 1998     Volume: 8 Number: 3575

Today's topics:
        [ANNOUNCE] GIFgraph 1.04 (Martien Verbruggen)
        ANNOUNCE: Cstools 0.155 (Honza Pazdziora)
        ANNOUNCE: Date::Manip-5.32 (Sullivan N. Beck)
        ANNOUNCE: Htpasswd-0.03 posted to CPAN (Steve Purkis)
    Re: Can IOCTL be used to read the table of contents fro <rootbeer@teleport.com>
    Re: comp.lang.perl.windows.misc (Greg Bacon)
    Re: comp.lang.perl.windows.misc (Greg Bacon)
    Re: Determining strlen <aqumsieh@tigre.matrox.com>
    Re: even or odd dave@mag-sol.com
    Re: explicit cast from @ to % ?!?!? dave@mag-sol.com
    Re: Hash of function refs with variable args <jdporter@min.net>
        Help Please! HTML Address translation filter <paul@neolution.com>
    Re: how can I print 10 digit nos. using 0s as place hol <jdporter@min.net>
        Is this how it's supposed to be? webmuse@my-dejanews.com
    Re: need and INI File parser in perl <jdporter@min.net>
        Perl Contract Engineer <@san.rr.com>
    Re: Perl Database ???? <rootbeer@teleport.com>
    Re: Perl needtobie wants info on DBI DBD Oracle Netscap (John D Groenveld)
        Perl-LZO (Compress::LZO) 1.00 released <k3040e4@wildsau.idv-edu.uni-linz.ac.at>
        POE 0.01 Available (Rocco Caputo)
    Re: SWF (Shockwave Flash) file format <jmoore@sober.com>
    Re: Trouble with getc()... (Mark-Jason Dominus)
    Re: typeglobs and references... (re: Prog Perl, p 117) <rootbeer@teleport.com>
    Re: Unreadable Scripts? (Greg Bacon)
    Re: Unreadable Scripts? (Chris Russo)
    Re: use vars and my, have I got it right? <rootbeer@teleport.com>
        variable interpolation in regular expressions <r20030@glo.be>
    Re: Why do these two differ? <merlyn@stonehenge.com>
    Re: Y2K Date Support (Patrick Timmins)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 28 Aug 1998 14:57:47 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: [ANNOUNCE] GIFgraph 1.04
Message-Id: <6s6ghb$3qr$1@news.neta.com>

I am in the process of uploading GIFgraph 1.04 to PAUSE. It should
appear at a CPAN near to you soon.

GIFgraph 1.03 was released a few days ago because I didn't think I'd
have the time to make more changes. But I did get the time.

[Extract from README]

MOST IMPORTANT CHANGES SINCE VERSION 1.03

- Added mixed type graph.
  GIFgraph::mixed
  options types and default_type
- Added callback functionality to format y values
  option y_number_format
- Added control over axis label placement
  option [xy]_label_position

MOST IMPORTANT CHANGES SINCE VERSION 1.01

- Vertical printing of X axis labels
- CHANGED DEFAULTS for zero_axis and zero_axis_only
- Fixed problems with negative values, data ranges without 0, and
  printing of the x axis labels (I hope)
- No more support for perl 5.003. Since perl 5.005 is out, and I don't
  have a 5.003 here to test all the time, I won't support it anymore.

As always, documentation is included in the source, as pod.

# perldoc GIFgraph

should give you everything you want to know about it. Please, also
read the README.

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |




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

Date: 28 Aug 1998 14:58:08 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: ANNOUNCE: Cstools 0.155
Message-Id: <6s6gi0$3qt$1@news.neta.com>

Hello,

    http://www.fi.muni.cz/~adelton/perl/Cstools-0.155.tar.gz
 
has entered CPAN as
 
  file: $CPAN/authors/id/JANPAZ/Cstools-0.155.tar.gz
  size: 22129 bytes
   md5: e5dd63026332423b865fc9d2262bdf67

This module provides routines for charset conversions, aimed primarily
on the Czech language. It can be however usefull to other people as
well because it has nice way of stripping accents to (for example)
plain ASCII, and one of the pseudo charsets is tex, so you can easily
convert
	mali\v{c}k\'a kr\accent23uta

to ISO-8859-2 or even ISO-8859-1.

Enjoy,

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
Sorry if this email reaches you late/after deadline, 've been gone for few days.




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

Date: 28 Aug 1998 14:58:24 GMT
From: sbeck@cise.ufl.edu (Sullivan N. Beck)
Subject: ANNOUNCE: Date::Manip-5.32
Message-Id: <6s6gig$3qv$1@news.neta.com>


This is to announce the release of Date::Manip 5.32.  I just uploaded it to
CPAN, so it should be available within a day or two from the CPAN site nearest
you.

>From the README file:

Notes for version 5.32:
  Mainly a bug fix release.
  Added Polish and Dutch support.
  *** Changed .DateManip.cnf to Manip.cnf (to get rid of problems on OS's
     that insist on 8.3 filenames) for all non-Unix platforms (Wintel, VMS,
     Mac).  For all Unix platforms, it's still .DateManip.cnf .  It will only
     look in the user's home directory on VMS and Unix.
  Added "in N days" and "N days ago" parse formats.
  Added "N days/weeks/months later" parse formats (both dates and deltas).
  Allow timezones in the formats "STD-#DST-#" and "+HHMM (NAME)".
  Added several timezones.
  Added "A.M." parsing (not just "AM").

Backwards incompatibilities:

  Version 5.32
    Old style Date_Init arguments no longer supported.
    *** .DateManip.cnf changed to Manip.cnf on all non-Unix platforms.

  Version 5.30
    The internal format of a delta has changed.  This will cause some people
       problems.  Use the routine Delta_Format to extract information from
       a delta.
  ############################################################################

This is a set of routines designed to make any common date/time
manipulation easy to do.  Operations such as comparing two times,
calculating a time a given amount of time from another, or parsing
international times are all easily done.  From the very beginning, the main
focus of Date::Manip has been to be able to do ANY desired date/time
operation easily, not necessarily quickly.  There are other modules that
can do a small subset of the operations available in Date::Manip much
quicker than those presented here, so if speed is a primary issue, you
should look elsewhere.  Check out the CPAN listing of Time and Date
modules.  But for sheer flexibility, I believe that Date::Manip is your
best bet.

Date::Manip deals with time as it is presented the Gregorian calendar (the
one currently in use).  The Julian calendar defined leap years as every 4th
year.  The Gregorian calendar improved this by making every 100th year NOT
a leap year, unless it was also the 400th year.  The Gregorian calendar has
been extrapolated back to the year 1000 AD and forward to the year 9999 AD.
Note that in historical context, the Julian calendar was in use until 1582
when the Gregorian calendar was adopted by the Catholic church.  Protestant
countries did not accept it until later; Germany and Netherlands in 1698,
British Empire in 1752, Russia in 1918.  Note that the Gregorian calendar
is itself imperfect.  Each year is on average 26 seconds too long, which
means that every 3,323 years, a day should be removed from the calendar.
No attempt is made to correct for that.

Date::Manip is therefore not equipped to truly deal with historical dates,
but should be able to perform (virtually) any operation dealing with a
modern time and date.

Date::Manip has (or will have) functionality to work with several fundamental
types of data.

DATE

Although the word date is used extensively here, it is actually somewhat
misleading.  Date::Manip works with the full date AND time (year, month,
day, hour, minute, second).  It doesn't work with fractional seconds.
Timezones are also supported.

NOTE:  Much better support for timezones (including Daylight Savings Time)
is planned for the future.

DELTA

This refers to a duration or elapsed time.  One thing to note is that, as
used in this module, a delta refers only to the amount of time elapsed.  It
includes no information about a starting or ending time.

RECURRENCE

A recurrence is simply a notation for defining when a recurring event
occurs.  For example, if an event occurs every other Friday or every
4 hours, this can be defined as a recurrence.  With a recurrence and a
starting and ending date, you can get a list of dates in that period when
a recurring event occurs.

GRAIN

The granularity of a time basically refers to how accurate you wish to
treat a date.  For example, if you want to compare two dates to see if
they are identical at a granularity of days, then they only have to occur
on the same day.  At a granularity of an hour, they have to occur within
an hour of each other, etc.

NOTE:  Support for this will be added soon.

Among other things, Date::Manip allow you to:

1.  Enter a date and be able to choose any format conveniant

2.  Compare two dates, entered in widely different formats to determine
    which is earlier

3.  Extract any information you want from ANY date using a format string
    similar to the Unix date command

4.  Determine the amount of time between two dates

5.  Add a time offset to a date to get a second date (i.e. determine the
    date 132 days ago or 2 years and 3 months after Jan 2, 1992)

6.  Work with dates with dates using international formats (foreign month
    names, 12/10/95 referring to October rather than December, etc.).

7.  To find a list of dates where a recurring event happens.

Each of these tasks is trivial (one or two lines at most) with this package.


------------------------------------------------------------------------------
Sullivan Beck                      http://www.cise.ufl.edu/~sbeck/
 sbeck@cise.ufl.edu  | This space reserved for some saying demonstrating great
 PH : (352) 392-1057 | wisdom, wit, or insight.  I'll fill it in just as soon
 Fax: (352) 392-1220 | as I have any of the above.
------------------------------------------------------------------------------




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

Date: 28 Aug 1998 14:56:12 GMT
From: spurkis@tiamat.epn.ml.org (Steve Purkis)
Subject: ANNOUNCE: Htpasswd-0.03 posted to CPAN
Message-Id: <6s6gec$31n$1@news.neta.com>
Keywords: Apache Htpasswd .htaccess

Htpasswd 0.03 has just been posted to CPAN; it should be accessible in my
home directory 'SPURKIS' in a few minutes.

Htpasswd is both an oo interface and a collection of subs I've found useful
to manipulate user-password files for Apache's .htaccess interface.  It's a
fairly simple module; the only reason it's not yet been released as 1.0 is
because I'm not sure if anything like this already exists.

I'd appreciate some feedback from the Perl community before I take this
project any further.

regards,
+--
 Steve Purkis, Computer Engineering
 spurkis@engsoc.carleton.ca




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

Date: Fri, 28 Aug 1998 15:34:14 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Can IOCTL be used to read the table of contents from a CD?
Message-Id: <Pine.GSO.4.02A.9808280832410.13017-100000@user2.teleport.com>

On Fri, 28 Aug 1998 bpeck@my-dejanews.com wrote:

> Subject: Can IOCTL be used to read the table of contents from a CD?

If it can, it's done the same way whether the program is written in Perl
or not. That's a sure sign that it's not really a Perl question, of
course. I'm not sure which newsgroup would have information about such
uses of IOCTL; maybe you should look in the various ones with 'unix' in
the name. Good luck!

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



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

Date: 28 Aug 1998 15:15:49 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: comp.lang.perl.windows.misc
Message-Id: <6s6hj5$jia$3@info.uah.edu>

In article <No.unsoiliciteds-2808980731540001@cs11i33.ppp.infoweb.or.jp>,
	No.unsoiliciteds@dead.end (Norman UNsoliciteds) writes:
: In article <6s49ml$j0f$1@info.uah.edu>, Greg Bacon <gbacon@cs.uah.edu> wrote:
: > I invite anyone who disbelieves to sit idly on EFNet #perl for at
: > most an hour.  The great majority of FAQs and off-topic questions
: > will undoubtedly be from mIRC (a Win32 IRC client) users.  If you
: > don't believe me, ask Chip or Randal or Tom or Nate or gnat or
: > anyone else who frequents #perl.
: 
: I would say that of IRC in general the worst users are the ones about 13
: years old, who have installed LINUX on thier comps to get a simil-shell
: account, choose nicks like DeT0n@tOr and try and convince evryone they're
: a "_real_ hacker *honest*".

Oh.. I see you've spent lots of time on #perl.

: AS for the Efnet #perl channel - it seems like any other channel
: containing more than 30 users - the ops don't speak except through the
: messages they put on thier kick/bans, there are too many convos in the
: public channel to make any sense of what people are actually talking about
: - why don't you set the +M(oderated) channel mode that stops anyone from
: talking until they get the +V(oice) mode.

Yep, that definitely confirms my previous observation.

Let me offer you a clue.  If you know absolutely nothing about something,
you will only make yourself look foolish by speculating about it.

: That would cut down on the
: useless chatter and bring the channel into line with
: comp.lang.perl.moderated

Please provide evidence for what you're insinuating.

Greg
-- 
I used to be sad because I had no woman.  Then I met a man who had no hands. 
    -- Rick Riebs


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

Date: 28 Aug 1998 15:11:25 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: comp.lang.perl.windows.misc
Message-Id: <6s6hat$jia$2@info.uah.edu>

In article <35E5BF15.781C6DCB@gusun.georgetown.edu>,
	Dave Stephens <stepherd@gusun.georgetown.edu> writes:
: This whole thread seems absurd.  We all use perl.  Period.  This is a gr
: Perl users, right?  Many of us use multiple platforms, not just one.

Just because you happen to be running your program on a Win32 platform
doesn't mean that questions about or discussion related to it would be
forced into clp.win32.  On the other hand, discussion of Win32-specific
issues would be.

Greg
-- 
It has been discovered that C++ provides a remarkable facility for concealing
the trival details of a program--such as where its bugs are. 
    -- David Keppel


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

Date: 28 Aug 1998 10:49:50 -0400
From: Ala Qumsieh <aqumsieh@tigre.matrox.com>
Subject: Re: Determining strlen
Message-Id: <x3yd89l9n5d.fsf@tigre.matrox.com>


Dave Wreski <dave@nic.com> writes:

[snip]
> 
> If I do something like:
> 
>     if ($str =~ /<A HREF=http:/)
>         ...
> 
> it works ok, but I don't understand why the following doesn't work:
> 
>     if ($str =~ /<A HREF=http:*>/)
>         ...
> 
> Argh, very frustrating, and the FAQ is more complicated than I"m ready for right now..
> I just haven't had the time to learn how to do this..
> 
> Thanks,
> Dave

Well, without reading, you will gain absolutely nothing. The * means
match zero or more of the preceding character, which happens in this
case to be a colon ':' .. this is no good for you. You should change
it to something like

/<A HREF=http:.*>/i

But notice that this is a naive approach. Asterisks are greedy
matchers by default .. so you might end up matching something like:

<A HREF="http://www.bla.com/>Click <bold>here</bold>


-- 
Ala Qumsieh             |  No .. not Just Another
ASIC Design Engineer    |  Perl Hacker!!!!!
Matrox Graphics Inc.    |
Montreal, Quebec        |  (Not yet!)


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

Date: Fri, 28 Aug 1998 15:02:51 GMT
From: dave@mag-sol.com
Subject: Re: even or odd
Message-Id: <6s6gqs$gp8$1@nnrp1.dejanews.com>

In article <35E68CC7.B80EA336@rl.ac.uk>,
  a.g.macinnes@rl.ac.uk wrote:
> Andy Lee wrote:
>
> > Hi,
> >
> >      I need some help to write a script to print out the even number.
> >     This is what  I am trying to do. Read a file and print out only the even
> > number
> >     records. I don't know how to test the number for even or odd. Thanks..
> >
> >     #!/usr/bin/perl
> >     open (file,"phone.dat")
> >     while (<file>)
> >     {
> >         #Test for even number
> >         #print only the even number record
> >     }
> >     close (file)
>
> $temp = $your_number % 2;    # MOD
> if ($temp == 0)
> {
>     print $temp;
> }

This looks to me like it prints a load of zeros! Maybe you meant

if ($temp == 0)
{
    print $your_number;
}

or even

while (<file>)
{
    print unless $_ % 2;
}

hth,

Dave...

--
dave@mag-sol.com
London Perl M[ou]ngers: <http://www.mag-sol.com/London.pm/>

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Fri, 28 Aug 1998 15:06:25 GMT
From: dave@mag-sol.com
Subject: Re: explicit cast from @ to % ?!?!?
Message-Id: <6s6h1g$h2i$1@nnrp1.dejanews.com>

In article <35E69320.172F5AFB@informatik.uni-marburg.de>,
  "K.Posern" <posern@informatik.uni-marburg.de> wrote:
> Look at this: >>>>>>
>
> @iniFile=("Common", "xxx", "bla", "yyy", "blub", "zzz");
> %iniFile = @iniFile;
>
> print "\n", %iniFile, "\n";
>
> print "\nvalues:\n";
> foreach(values %iniFile) { print "    -->$_<--  "; }
> print "\nkeys:\n";
> foreach (keys %iniFile) { print "    -->$_<--  "; }
>
> <<<<<
>
> WHY is the order of the keys (or values):  "Common, blub, bla"
>
> and NOT: "Common, bla, blub" - like I would have expected it?!

Because hashes aren't stored in the same way that arrays are.

hth,

Dave...


--
dave@mag-sol.com
London Perl M[ou]ngers: <http://www.mag-sol.com/London.pm/>

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Fri, 28 Aug 1998 11:48:35 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Hash of function refs with variable args
Message-Id: <35E6D153.670C@min.net>

Brett Denner wrote:
> 
> The user inputs an integer (which corresponds
> to the desired quantity: 100 => pressure, 101 => temperature,
> 102 => density, etc.), and the code runs the proper subroutine
> based on the integer.
> 
> %func_table =
>     {
>     100 => \&calc_pressure,
>     101 => \&calc_temperature,
>     102 => \&calc_density,
>     };

Why does the user input an integer?  Can't she input a string?

%func_table =
    {
    pressure    => \&calc_pressure,
    temperature => \&calc_temperature,
    density     => \&calc_density,
    };


> Then, the function can be called like this:
> 
> $prop = $func_table{$user_option}->(ARGUMENT LIST);

Where do the arguments come from?  Are they already set before
this point, so the user can calculate all/any properties
with the same set of arguments?  How are the arguments stored?
I think the probably ought to be in a single hash.  Then you
can pass a reference to the hash (very efficient indeed!) to
each function call; the function can ignore the ones it doesn't
care about.

	$prop = $func_table{$user_option}->( \%arguments );

-- 
John Porter


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

Date: Fri, 28 Aug 1998 15:50:59 GMT
From: "paul" <paul@neolution.com>
Subject: Help Please! HTML Address translation filter
Message-Id: <DlAF1.1285$lg.5863916@news20.bellglobal.com>

Hello all,
I am a perl beginner who has recently written a program using the Net::NNTP
class to post to usenet. Problem is, the source that I want to post is in
simple html including <a href=www.whatever.com>Whatever</a> text.
I am trying to write a filter than transforms the following:
text text <a href=address.com>English Description</a> text text
to:
text text English Description (address.com) text text
and making little progress.  I have to perl books (camel & llama), so any
pointers to where to look or anything would be most useful.
Thanks!
Paul





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

Date: Fri, 28 Aug 1998 10:55:27 -0400
From: John Porter <jdporter@min.net>
Subject: Re: how can I print 10 digit nos. using 0s as place holders
Message-Id: <35E6C4DF.6C2C@min.net>

Zenin wrote:
> 
> John Porter <jdporter@min.net> wrote:
> : Here's a mind-blower for you newbies.
> 
> You might want to put a "use 5.005" statement at the top of
> that, just to be a little nicer to the newbies. :-)
> -Ya, ya it worked in lesser perls, but it also core dumps in
> them too. :-)

I noticed that it was very sensitive to how I rigged it up
-- e.g. creating multiple lvalue refs in a loop/map crashed,
but creating the same in distinct statements was o.k.

(I'm using 004_04.)  So, is it fixed and stable in 005?

-- 
John Porter


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

Date: Fri, 28 Aug 1998 15:23:14 GMT
From: webmuse@my-dejanews.com
Subject: Is this how it's supposed to be?
Message-Id: <6s6i13$iak$1@nnrp1.dejanews.com>

Using version 5.004_69 built for MSWin32-x86. Is
this a bug in perl, a bug in THIS build of perl, or
not a bug at all?

I pulled my hair out today on this one. I had a file
that needed to be read in and variables interpolated.
For example, the file had text like:

"Jack and $who went up the $what..."

The part of the script in question was like this:

#---------------

my ($who, $what) = ("Jill", "hill");
my $message;

open FILE, "<file.txt"
    or die ("Couldn't open file.txt: $!\n");

while (<FILE>) {
    s/\$([A-Za-z_]\w*)/${$1}/ge;
    $message .= $_;
}
close FILE;

print $message;

#---------------

The above part of the script appeared inside an IF block,
and when $message was printed, it came out as:

"Jack and  went up the  ..."

I then removed the 'my' from in front of the $who/$what
declarations, and it worked flawlessly:

"Jack and Jill went up the hill..."

It seems as though the s// is being executed outside of
the IF block, and that is why the interpolation doesn't
work when using 'my'. This doesn't make any sense to me...

-thomas

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Fri, 28 Aug 1998 11:36:29 -0400
From: John Porter <jdporter@min.net>
Subject: Re: need and INI File parser in perl
Message-Id: <35E6CE7D.5F15@min.net>

Prasad Suravarapu wrote:
> 
> Mike Stok wrote:
> >
> >   http://www.perl.com/CPAN/CPAN.html
> 
> I get the following when I go that page, anyone know why??
> 
> -----
> Forbidden
> 
> You don't have permission to access /CPAN.html on this server.

I don't know.  It worked for me.
Actually, since this redirects to a random near CPAN site,
you should try it several times.

I like the long list, which is also easy to search in your
web browser:

http://www.perl.com/CPAN/modules/00modlist.long.html

-- 
John Porter


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

Date: Fri, 28 Aug 1998 15:39:47 GMT
From: <@san.rr.com>
Subject: Perl Contract Engineer
Message-Id: <7bAF1.899$KK4.1976593@news.san.rr.com>

We are looking for a contract engineer with experience in Perl 5.1
programming for a project we have.

Please contact via email or phone.

Thank you,

Eric Pemper



IDM, Inc.
4275 Executive Square, Suite 800
La Jolla,  CA  92037

TEL    619.546.2916
FAX   619.458-9498

http://www.id-m.com





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

Date: Fri, 28 Aug 1998 15:44:26 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Perl Database ????
Message-Id: <Pine.GSO.4.02A.9808280843530.13017-100000@user2.teleport.com>

On Fri, 28 Aug 1998 petersrm@my-dejanews.com wrote:

> My ISP has perl5db.pl and AnyDBM_file.pm available for me to use.  I
> have not used these, and I am wondering if anyone as any examples of
> how to use these and what they can do.

Have you tried reading their documentation? Hope this helps!

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



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

Date: 28 Aug 1998 11:01:58 -0400
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: Perl needtobie wants info on DBI DBD Oracle Netscape Enterprise NT
Message-Id: <6s6gp6$5sa$1@tholian.cse.psu.edu>

I've successfully build DBI/DBD::Oracle under perl5.004_04 on NT.
I used MS VC++ 5.0.
John
groenveld@acm.org


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

Date: 28 Aug 1998 14:55:14 GMT
From: "Markus F.X.J. Oberhumer" <k3040e4@wildsau.idv-edu.uni-linz.ac.at>
Subject: Perl-LZO (Compress::LZO) 1.00 released
Message-Id: <6s6gci$31j$1@news.neta.com>


                     Perl-LZO -- LZO bindings for Perl5

              Copyright (c) 1996-1998 Markus F.X.J. Oberhumer
                   <markus.oberhumer@jk.uni-linz.ac.at>


What is LZO ?
=============

LZO is a portable lossless data compression library written in ANSI C.
It offers pretty fast compression and *very* fast decompression.
Decompression requires no memory.

In addition there are slower compression levels achieving a quite
competitive compression ratio while still decompressing at
this very high speed.


What is Perl-LZO ?
==================

Perl-LZO provides LZO bindings for Perl5. I.e. you can access the
LZO library from your Perl scripts thereby compressing ordinary
Perl strings.


Where can I get it ?
====================

Point your browser to http://wildsau.idv.uni-linz.ac.at/mfx/lzo.html


Any caveats ?
=============

As I'm no Perl guru I'm not sure if I got everything right - it
works fine for me, though.

Bug fixes and other feedback are welcome.


Copyright
=========

LZO and Perl-LZO are Copyright (C) 1996, 1997, 1998
Markus Franz Xaver Johannes Oberhumer <markus.oberhumer@jk.uni-linz.ac.at>

LZO and Perl-LZO are distributed under the terms of the
GNU General Public License (GPL).  See the file COPYING.


-- 
-----   Markus Oberhumer <markus.oberhumer@jk.uni-linz.ac.at>   -----
-----          http://wildsau.idv.uni-linz.ac.at/mfx/           -----
-----     5E CB 5C 85 DE AF 9E BF  E9 DA 7E 6A 39 F8 CC 67      -----

                         3 WARPS TO URANUS




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

Date: 28 Aug 1998 14:56:34 GMT
From: troc@netrus.net (Rocco Caputo)
Subject: POE 0.01 Available
Message-Id: <6s6gf2$31s$1@news.neta.com>

HYPE:

POE is a "Perl Object Environment", a non-forking, non-blocking,
co-operative multitasking, buzzword-enriched, object-oriented,
virtual environment.  When finished, it should look almost exactly
like a cross between a MUD and an operating system.

DETAILS:

Version 0.01 implements the buzzwords before "buzzword-enriched".
This includes only the task management layer:

Session.pm implements state machines that accept (and run by) state
transition events.

Kernel.pm provides select(2) logic, alarms, limited signal processing,
and a queue for state transition events.

Driver.pm (and derivatives) to push and pull data through filehandles.

Filter.pm (and derivatives) to frame raw stream data into recognizable
chunks (such as lines or queries) and back.

Wheel.pm (and derivatives) implements reusable state machine
subroutines that graft themselves into (and extract themselves from)
existing Sessions.

DIRECTION:

Still to do are the pieces that implement the buzzwords after
"buzzword-enriched".  These pieces will include an object dictionary,
a runtime environment, and an input parser.

COMPATIBILITY:

Tested with Perl 5.004_04, on Linux, FreeBSD and OS/2.  Includes
MakeMaker install, sample programs and perhaps too much POD
documentation.

AVAILABILITY:

POE-0.01.tar.gz is 24,070 bytes and available from
<URL:http://www.netrus.net/users/troc/perl.html>

-- Rocco Caputo / troc@netrus.net




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

Date: Fri, 28 Aug 1998 10:23:08 -0400
From: jason moore <jmoore@sober.com>
Subject: Re: SWF (Shockwave Flash) file format
Message-Id: <35E6BD4C.709B929C@sober.com>

> >     Larry> I am having difficulty parsing packed binary data from the
> >     Larry> Shockwave Flash file format (.swf), despite having the
> >     Larry> detailed specification in hand.  I have found no module
> >     Larry> that helps either.
> >
> I will overlook the patronizing nature of your response.  Instead, I will
> follow the advice of Jason Moore [jmoore@sober.com], sent to me by email:
> 
> "Send the newsgroup a code sample, and the part of the relevant part of
> the spec.  I'm sure perl can do what you want, and it would probably be
> a cool little addition to Image::Size if gets figured it out."
> 
> Here is the spec excerpt (from <URL:
> http://www.macromedia.com/software/flash/open/spec/SWFfilereference.html
> >.
>

Hi Larry -- i don't think the previous poster was trying to insult you. 
Sometimes there are some pretty silly questions in the perl ng's - he
just mistook your question for one of them! <g>  Anyways, I dug up some
old code where i was trying to read the header of a flash file.  It
doesn't answer your question, but it does read the 5 bit number in the
first part of the RECT field, so maybe this will get you one step
further.

Apologies for the ugliness of the code.. and please note, the
x/y/min/max coordinates are not being unpacked properly.  Also, the spec
says "other types of values that follow one of more bit values are
always aligned to the nearest byte boundary with zero bits as padding." 
I took this to mean that after I extract the 5 bit number which gives me
the number of bits in the remaining 4 fields of the RECT structure, i
can just skip to the next byte.  Anyways, i'm not a master bit diddler,
so have fun.  Let me know how it turns out.

:jason


#!/usr/local/bin/perl

my $buffer; 
my $unpack;
my $s;

open(FLASH, $ARGV[0]) or die("Unable to open file.");
read(FLASH, $buffer, 64);
close(FLASH);

$s = substr($buffer,0,3);
printf("Signature: %s\n", $s);

$s = substr($buffer,3,1);
$unpack = unpack("C", $s);
printf("File Version: %lu\n", $unpack);

$s = substr($buffer,4,4);
$unpack = unpack("L", $s); 
printf("Length: %d\n", $unpack);

## 5 bits of RECT are size of min x/y max x/y

$s = substr($buffer,8,1);

my $and = pack("b8", "11111000");       ## zero extra bits
# my $and = pack("B8", "00011111");     ## zero extra bits      ## same
my $b = ($s & $and);
my $nbit = unpack("C", $b);
printf("Bits in RECT xMin/xMax/yMin/yMax: %d\n", $nbit );

$s = substr($buffer,9,2);       ## 2 bytes cause my file is 16 bits

my($xmin) = unpack("s", $s);    ## 16 bits (short int)
printf("  xmin: %d\n", $xmin);
# print "  xmin (hex): " . unpack("H", $s) . "\n";

$s = substr($buffer,11,2);      ## 2 bytes cause my file is 16 bits
my($xmax) = unpack("s", $s);    ## 16 bits (short int)
printf("  xmax: %d\n", $xmax);  

$s = substr($buffer,13,2);      ## 2 bytes cause my file is 16 bits
my($ymin) = unpack("s", $s);    ## 16 bits (short int)
printf("  ymin: %d\n", $ymin);


 
> ------
> 
> Bit Values
> 
> Bit values are a linear sequences of bits that describe signed and
> unsigned integer and fixed point values. Other types of values that
> follow one or more bit values are always aligned to the nearest byte
> boundary with zero bits as padding.
> 
> Type    Comment
> SB[n]   Signed bit value   - n is number of significant bits
> UB[n]   Unsigned bit value - n is number of significant bits
> 
> ...
> 
> Rectangle Values
> 
> A rectangle value represents a rectangular region defined by a minimum X-
> and Y-coordinate position with a maximum X- and Y-coordinate position.
> 
> The format for a rectangular value within the file is described in the
> following table:
> Field           Type                    Comment
> Nbits           nBits = UB[5]           Bits in each rect value field
> Xmin            SB[nBits]               X minimum position for rect
> Xmax            SB[nBits]               X maximum position for rect
> Ymin            SB[nBits]               Y minimum position for rect
> Ymax            SB[nBits]               Y maximum position for rect
> 
> ------
> 
> And here are the bytes that I *know* contain the desired values (as I
> have successfully decoded the preceding bytes, using unpack -- gee,
> Adrian, I've heard of it!):
> 
> "\x70\x00\x0c\x80\x00"
> 
> The semantics of "Other types of values that follow one or more bit
> values are always aligned to the nearest byte boundary with zero bits as
> padding." are key here, but I cannot grok them.
> 
> I will *not* include my tries at unpack, because they didn't produce
> meaningful results.  If they had, I wouldn't have made the post.
> 
> > HTH,
> >
> > Adrian
> 
> Not even a little bit (or byte, if you wish).
> 
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com


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

Date: 28 Aug 1998 11:04:39 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Trouble with getc()...
Message-Id: <6s6gu7$7qr$1@monet.op.net>

In article <35E6BB41.18C57DEF@mindspring.com>,
Peter Smith  <psmith01@mindspring.com> wrote:
>I usually manage to get about 143 out of 444 characters (bytes) in the
>file.  Any ideas?

Perhaps use

	binmode IN;

after you open IN and before you start reading?


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

Date: Fri, 28 Aug 1998 15:32:10 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: typeglobs and references... (re: Prog Perl, p 117)
Message-Id: <Pine.GSO.4.02A.9808280814100.13017-100000@user2.teleport.com>

On Fri, 28 Aug 1998, Benjamin Low wrote:

> Is there any way of determining what a typeglob aliases to, when it is
> used as a glob for a reference?

If you're using typeglobs, you're probably doing something the hard way.
(The exceptions: If you're passing and returning filehandles, and if
you're doing something very esoteric. And that first one can be done in an
easier way, too.) Typeglobs should almost always be saved for those
special occasions in which nothing else works for you.

Having said that, if you merely wish to find out about the references
passed to your sub, you could try ref(). Or you could just trust whoever
is calling your sub to know what they're doing. :-)

Hope this helps!

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



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

Date: 28 Aug 1998 15:29:55 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Unreadable Scripts?
Message-Id: <6s6idj$jia$4@info.uah.edu>

In article <No.unsoiliciteds-2808980753500001@cs11i33.ppp.infoweb.or.jp>,
	No.unsoiliciteds@dead.end (Norman UNsoliciteds) writes:
: Nathan V. Patwardhan laboured the point:
: <*> Then again, there are always the news.announce newsgroups -- which
: <*> people should read before diving in.
: 
: Oh puuuuuhhhleeeeeze I bet you knew all these things before you came on
: Use Net,  I never seen such a bunch of BOFs (and this doesn't mean birds
: of a feather) trying to pretend they were never kids.

That's why we have news admins.

Greg
-- 
Did you ever notice that "love" spelled backwards is "evil"? Well, not
exactly, but it's still pretty scary.


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

Date: Fri, 28 Aug 1998 08:45:54 -0700
From: news@russo.org (Chris Russo)
Subject: Re: Unreadable Scripts?
Message-Id: <news-2808980845540001@buzz.hq.alink.net>

In article <6s4af8$kpa$1@news.NERO.NET>, stanley@skyking.OCE.ORST.EDU
(John Stanley) wrote:

>What has changed is that people have forgotten that USENET access does
>not imply web access does not imply ftp access ...

True, but I somehow doubt that all of the CGI questions are posted by
people without web access, so I don't think that lack of web access
accounts for a very large percentage of the FAQs.

Regards,

Chris Russo

-- 
Chris Russo
news@russo.org
http://www.russo.org


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

Date: Fri, 28 Aug 1998 15:12:05 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: use vars and my, have I got it right?
Message-Id: <Pine.GSO.4.02A.9808280746570.13017-100000@user2.teleport.com>

On Fri, 28 Aug 1998, Benjamin Low wrote:

> use vars predeclares the quoted "strings literals" as global
> variables, visible from all modules, etc.

Right.

> It doesn't actually create these variables (this fits in with my
> concept of 'use' being a compiler directive). i.e. it's a compile-time
> thing (a bit like extern in C?).

This depends upon your definition of "create". I'd say that it does create
the variables, but you could argue that a variable is not created until
it's assigned a value. (Of course, you'd lose that argument. :-)

> my is pretty much the same, except its scope is only to the enclosing
> block, etc. and it *does* create the variable/s. i.e. it's a
> compile-time declaration and run-time creation thing.

Well, I don't know if that's the best way to think about it. Lexical
("my") variables are very different than globals. 

The 'my' directive tells the compiler to make a new variable which may be
accessed by name only within the smallest enclosing block or file. 'use
vars', on the other hand, deals with global variables, which may be
accessed by name from any code within the program, no matter which file.

Globals in Perl are package variables. That is, they're in a symbol table.
Thus, every variable declared in 'use vars' has a "full name" which
includes its package. (Lexical variables are never in a package.)

    package Chocolate;	# default package (compile-time directive)
	# Now if the compiler sees a name which is neither
	# a lexical variable nor qualified with a package name
	# nor named the same as one of Perl's special variables, 
	# then that name refers to a variable in this package.

    use vars qw/ $milk @truffles %cake /;
	# That told the compiler not to complain when it sees
	#   $milk (meaning $Chocolate::milk) or
	#   @truffles (meaning @Chocolate::truffles) or
	#   %cake (meaning @Chocolate::cake)
	# or any of their relatives (like $truffles[-1] or
	# @cake{ qw/ first_slice second_slice / })

    my $ice_cream;
	# That told the compiler to make a new variable for 
	# (each invocation of) this scope.

Does that get you any closer to what you need? Hope this helps!

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



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

Date: Fri, 28 Aug 1998 17:25:38 +0200
From: "Wim Bartsoen" <r20030@glo.be>
Subject: variable interpolation in regular expressions
Message-Id: <35e6cb37.0@news.ruca.ua.ac.be>

Hi,

Does anyone know how to properly do the following:

s/<!-- INPUT ([\w\-]+) -->/$query->param($1)/;

The purpose obviously is to get perl to accept the substitution variable to
be $query->param($1) instead of $query.

I've found this workaround, but I'm looking for something more elegant:

  if (/<!-- INPUT ([\w\-]+) -->/) {
   $substitution=$query->param($1);
   s/<!-- INPUT $1 -->/$substitution/;
  }

Any help or reference to an explanation on how to do this is greatly
appreciated.

Please reply at wim.bartsoen@glo.be




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

Date: Fri, 28 Aug 1998 15:51:58 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Why do these two differ?
Message-Id: <8cvhndcdf5.fsf@gadget.cscaper.com>

>>>>> "Dan" == Dan Nguyen <nguyend7@msu.edu> writes:

Dan> : #!/usr/bin/perl
Dan> : $length = (0,1,2,3,4,5,6);
Dan> : print $length ."\n";

Dan> it prints 6 because it grabs the last scalar value
Dan> try $length = scalar (0,1,2,3,4,5,6);

Why?  That's exactly the same thing. :)

Or was that your point?

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Fri, 28 Aug 1998 15:06:48 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: Y2K Date Support
Message-Id: <6s6h28$h2p$1@nnrp1.dejanews.com>

In article <6s5kgd$ac9$1@marina.cinenet.net>,
  cberry@cinenet.net (Craig Berry) wrote:
[snip]
> Well, "Perl's notion of time" is really a 32-bit (or 64-bit on some
> architectures, ISTR) signed integer type designated time_t.  It counts
> seconds, ignoring leap seconds, from Jan. 0 1970 (that is, the midnight
> beginning Jan. 1).  localtime() and friends are simply convenient front
> ends for time_t.  And any significant software project is going to involve
> conversions between internal and human-visible data representations; such
> go with the territory.  That numerous programmers have done these
> conversions wrong is a problem with human shortsightedness or stupidity,
> not a problem with time_t or its family of functions.  (The Y2038 bug, in
> contrast, *is* a problem with time_t.)
[snip]

How is it a problem with time_t (not that I am at all familiar with time_t)?
On a 32 bit system in early 2038, the number of seconds since Jan 1, 1970
will reach 2**31. A 32 bit CPU, bus, etc will not be able to work with
anything larger. How is this a software problem, as opposed to a hardware
problem?

Patrick Timmins
U. Nebraska Medical Center

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

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


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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 3575
**************************************

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