[10741] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4340 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 2 08:07:16 1998

Date: Wed, 2 Dec 98 05:00:35 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 2 Dec 1998     Volume: 8 Number: 4340

Today's topics:
    Re: c:\perl\bin %s %s david.drecq@dcg.sncf.fr
    Re: c:\perl\bin %s %s <cgormley@netcomuk.co.uk>
        Does "XS_unpack_charPtrPtr" exist? dmulholl@cs.indiana.edu
    Re: Does (.*?) do what I think it does? (brian d foy)
    Re: executing scripts when html page is loaded (Ronald J Kimball)
        Extracting version/type information from DLL's? elcaro@my-dejanews.com
    Re: Handling the last line of a file differently (123) <Arved_37@chebucto.ns.ca>
        Help: The internals of setting env.vars rt@brandx.net
        How to use Perl-script as filter? <k.molkenthin@amdiv.de>
        imitating user input <avitala@macs.biu.ac.il>
    Re: imitating user input <zenin@bawdycaste.org>
        Net::POP3 <lscom@tin.it>
        New idiom? (Sean McAfee)
    Re: New idiom? (Sean McAfee)
    Re: Perl "Expert" for Global Remove E-mail List <erikd@zip.com.au>
    Re: Perl binary manipulation <conmara@tcon.net>
        Perl Script to take data off a form and post it to the  <en02@gre.ac.uk>
        problem with \ifthenelse inside tabularx <priocreux@cs.man.ac.uk>
    Re: Strip and add, perl style <ebohlman@netcom.com>
    Re: Using RCS in Perl scripts <zenin@bawdycaste.org>
    Re: Using RCS in Perl scripts <rra@stanford.edu>
    Re: Using RCS in Perl scripts <zenin@bawdycaste.org>
    Re: Why is "... @foo ..." occasionally a syntax error? (Bart Lateur)
        win32API module available for Unix? elcaro@my-dejanews.com
    Re: win32API module available for Unix? (Jeremy D. Zawodny)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Wed, 02 Dec 1998 11:10:40 +0100
From: david.drecq@dcg.sncf.fr
Subject: Re: c:\perl\bin %s %s
Message-Id: <36651220.F58E51F3@dcg.sncf.fr>

i have the same problem with Peer web services on windows NT 4 workstation and
Netscape!

Eric Luhman wrote:

> Configuring .pl applications in IIS 4.0 to run via c:\perl\bin\perl.exe %s
> %s works fantastic for calling perl scripts with the exec cgi= command.
> However, after doing this I cannot open a perl script in netscape with
> http://my domain/scripts/myscript.pl.  Netscape opens up a "save as" dialog
> box rather than running the script.  IE 4.0 runs the script just fine.
> Suggestions for Netscape?
>
> RICK

--

_____________________________________________________________________
"L'imagination est plus importante que le savoir" (Albert EINSTEIN)
mailto:docgen@multimania.com
Soyez les bienvenus sur http://www.multimania.com/docgen/index.shtml
Thhmes abordis: le C.N.A.M., la ginialogie, France98
Rejoignez l'anneau web "LA GENEALOGIE FRANCOPHONE"
   sur http://www.multimania.com/docgen/webring.html
_____________________________________________________________________




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

Date: Wed, 2 Dec 1998 11:19:55 -0000
From: "Clinton Gormley" <cgormley@netcomuk.co.uk>
Subject: Re: c:\perl\bin %s %s
Message-Id: <7437ob$rvh$1@taliesin.netcom.net.uk>

Netscape is fussier about headers.  If you use the print $query->header from
CGI.pm, it should sort it out.

Clint


Eric Luhman wrote in message <742d12$n5s$1@ins8.netins.net>...
>Configuring .pl applications in IIS 4.0 to run via c:\perl\bin\perl.exe %s
>%s works fantastic for calling perl scripts with the exec cgi= command.
>However, after doing this I cannot open a perl script in netscape with
>http://my domain/scripts/myscript.pl.  Netscape opens up a "save as" dialog
>box rather than running the script.  IE 4.0 runs the script just fine.
>Suggestions for Netscape?
>
>RICK
>
>




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

Date: Wed, 02 Dec 1998 05:01:14 GMT
From: dmulholl@cs.indiana.edu
Subject: Does "XS_unpack_charPtrPtr" exist?
Message-Id: <742hip$r79$1@nnrp1.dejanews.com>

While running "make test" on an XS project compilation goes just fine and then
as the test.pl script is executed the error message appears:

/usr/bin/perl: can't resolve symbol 'XS_unpack_charPtrPtr'

In what library should this be in?  Or is this a bogus message?  I am running
Perl 5.005_02.

Any help appreciated




-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 02 Dec 1998 01:09:58 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Does (.*?) do what I think it does?
Message-Id: <comdog-ya02408000R0212980109580001@news.panix.com>

In article <199812020500.WAA02654@asarian-host.org>, Mark <admin@asarian-host.org> posted:

> Hi, Bernd. For starters, let us correct, and add to the list:

> .* match any character zero or as much as you can (greedy)
> .*? match any character zero or as much as you can (non-greedy)
> .? match any character zero or one time
> .+ match any character one or more times (greedy)
> .+? match any character one or more times (non-greedy)

note that "any character" means "any character except a newline".
to make . match a \n you need the s option ;)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Wed, 2 Dec 1998 00:39:17 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: executing scripts when html page is loaded
Message-Id: <1djdsyt.11fp73ye8pqN@bay1-549.quincy.ziplink.net>

<jlhughes@pobox.com> wrote:

> I have a virtual postcard script that uses perl to create a html document.
> The link to that document is sent to the recipient of the card, who then can
> view the card by clicking on the link. (The original script is from http://
> bignosebird.com)
> 
> I want to add e-mail notification to the sender when the card is read.
> Creating the cgi script to notify the sender shouldn't be a problem.  But how
> do I execute the script from the html document?
> 
> I could invite the recipient to press a button to notify the sender that the
> card was read. But I would rather "hide" the notification.

Just send the recipient the URL of a CGI script instead of a static HTML
document, of course.


For example:

http://bignosebird.com/cgi-bin/viewcard.pl?id=123456789


viewcard.pl will:

look up the id; get the sender's address, the postcard URL,
  and a notified flag
if the notified flag is not set, send a notification to the sender
  and set the notified flag for this id
redirect the user's browser to the actual URL of the postcard

(this could be as simple as: the sender's address is stored in
123456789_sender, the notified flag is the 123456789_notified file,
and the URL is http://bignosebird.com/postcards/123456789.html)


Hope that helps!

-- 
 _ / '  _      /         - aka -          rjk@linguist.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Wed, 02 Dec 1998 12:11:11 GMT
From: elcaro@my-dejanews.com
Subject: Extracting version/type information from DLL's?
Message-Id: <743aou$f6j$1@nnrp1.dejanews.com>

Does anyone know how one might extract DLL version and type (16/32 bit)
information from Windows DLL files?

This work has to be done under Unix (with Perl naturally) and the DLL's are
local on a unix filesystem, so they are directly accessible for reading. Is
this information available in a set place within a DLL that can be simply
extracted, or does it have to go through the windoze subsytem to get this
info out, in which case it might be a problem under Unix.

Thanks alot

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 2 Dec 1998 06:38:42 -0400
From: Arved Sandstrom <Arved_37@chebucto.ns.ca>
Subject: Re: Handling the last line of a file differently (123)
Message-Id: <Pine.GSO.3.95.iB1.0.981202063601.20584C-100000@halifax.chebucto.ns.ca>


Assuming you read that line already, and are testing after the fact, prior
to another read - eof FILEHANDLE, or just eof if the file in question is
the last one you read from.

On 29 Nov 1998, Nick Halloway wrote:

> How can I tell if it's the last line of a file, when reading 
> lines from it?  Thanks.



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

Date: Wed, 02 Dec 1998 07:19:06 GMT
From: rt@brandx.net
To: tamstorf@fa.disney.com
Subject: Help: The internals of setting env.vars
Message-Id: <742pl9$15b$1@nnrp1.dejanews.com>

Can anyone explain the gory details of how perl sets environment variables ?
Please !!!

I've been looking at the source code and trying to make sense of it, but what
I think it does based on the source code doesn't match reality when I create
small test scenarios :-(

First a few facts: I'm running 5.005_01 under IRIX 6.2 compiled with Perl's
own malloc routine. Now when I look at util.c it seems that the guts of
setting environment variables happens in my_setenv(). The first time this
function is called the unix environ is apparently copied into a new array
allocated by perl's malloc (through the macro 'New') and in the following
perl then mucks with that array.

That's all fine *except* that if you embed perl in an application that sets
environment variables itself I would think that bad things would happen. When
you call 'putenv' from C to add a new environment variable it will (at least
under IRIX) attempt to do a realloc on the global environ variable, but now
that environ points to a piece of memory that has been allocated by perl's
malloc this means that a system realloc tries to mess with a piece of memory
it has no control over :-(

That's my theory, but in reality is works somewhat nicer. At least when I
create the simplest possible application that embeds perl (taken from the
perlembed manpage) I can't make it crash when I subsequently use 'putenv' in
C. My question is therefore : What is it that I've missed ??? Doesn't perl
copy the environ array as I think ? - Or does it restore it somehow ? If so
where and how ?

I have embedded perl in a much bigger application, and using 'putenv' there
after having done $ENV{FOO}='bar' in perl causes much havoc, so I'm trying to
figure out what's causing the problem.

Any help and insight will be greatly appreciated.

Rasmus

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 02 Dec 1998 13:44:31 +0100
From: Kay Molkenthin <k.molkenthin@amdiv.de>
Subject: How to use Perl-script as filter?
Message-Id: <3665362F.8807BEB6@amdiv.de>

Hi,

I need to modify a text, I write in vi (my standard editor). After
writing the text i want to pipe it through this script and want the
modified text in vi instead of the old one.

Q1: Is this possible?

Q2: How do I redirect the input?

Kay.


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

Date: Wed, 2 Dec 1998 13:31:17 +0200
From: "avshalom avital" <avitala@macs.biu.ac.il>
Subject: imitating user input
Message-Id: <7438ei$j6i$1@news.ibm.net.il>

hi all,
say I want to init a process, but continue monitoring it (imitating
keyboard input, for
instance, well- precisely), is there any way of doing that?
e.g. - do the following automatically:
run telnet
input username and passwd
# run some commands #
exit

thanx in advance, avshi







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

Date: 02 Dec 1998 12:06:08 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: imitating user input
Message-Id: <912600439.219127@thrush.omix.com>

[posted & mailed]

avshalom avital <avitala@macs.biu.ac.il> wrote:
: hi all,
: say I want to init a process, but continue monitoring it (imitating
: keyboard input, for
: instance, well- precisely), is there any way of doing that?
: e.g. - do the following automatically:
: run telnet
: input username and passwd
: # run some commands #
: exit

	If you're actually doing telnet, check out the Net::Telnet module. 
	If you're handling a local process, check out the Comm.pl lib,
	and/or the newer Expect module.

	All available at your local CPAN, of course. :-)

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Wed, 2 Dec 1998 10:16:09 +0100
From: "Lorenzo Cataldi" <lscom@tin.it>
Subject: Net::POP3
Message-Id: <7430c3$m0i$2@nslave1.tin.it>

Salve a tutti,
spero che qualche abile programmatore possa colmare una mia piccola lacuna
riguardo all'uso del modulo Net:::POP3.
Sto facendo un programma ed ho la nescessit` (usando questo modulo) di poter
leggere la risposta del MailServer al momento della connessione, per poter
estrarre da questa la stringa utile per criptare la password con MD5 e poter
procedere al login in APOP.
    Purtroppo alla creazione di un nuovo oggetto Net::POP3, la risposta del
server la posso solo intuire a seconda che il valore che mi torna indietro
sia undefined o defined.
Avevo pensato di usare una connessione tramite il modulo Socket e con questo
carpire l'agognata risposta del Server, ma poi (ovviamente) mi era
impossibile utilizzare l'informazione ottenuta con Net::POP3.
Sperando in un risolutivo aiuto,
anticipatamente ringrazio

    Lorenzo
    E-Mail: itacom@technologist.com









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

Date: Wed, 02 Dec 1998 07:40:57 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: New idiom?
Message-Id: <da692.2239$CY1.9080887@news.itd.umich.edu>

When working with a hash-of-hashes, I found myself writing code like this:

while (($host, $param) = each %paramhash) {
    foreach $key (keys %$param) {
        print "host $host: param $key = $param->{$key}\n";
    }
}

It occurred to me that the above could also be written like this:

while (($host, *param) = each %paramhash) {
    foreach $key (keys %param) {
        print "host $host: param $key = $param{$key}\n";
    }
}

It doesn't add much in this case, but in a routine where the second-level
hash is referenced often, eliminating all of the -> operators significantly
reduces how cluttered the code looks.  I would imagine that the new code
would be faster as well.

In a subroutine, *param would of course be localized.

The idiom could also be applied to other kinds of complex data structures,
for example, a hash of array references:

@array;  # to avoid "@array now must be written as \@array" message
%foo = ( bar => [1, 4, 6], baz => [5, 10, 12] );
print "$key: @array\n" while ($key, *array) = each %foo;

Comments?  Any hidden gotchas that I haven't noticed?

-- 
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
            | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
            | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu


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

Date: Wed, 02 Dec 1998 08:10:22 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: New idiom?
Message-Id: <OB692.2240$CY1.9089272@news.itd.umich.edu>

In article <da692.2239$CY1.9080887@news.itd.umich.edu>,
Sean McAfee <mcafee@waits.facilities.med.umich.edu> wrote:
>while (($host, *param) = each %paramhash) {
>    foreach $key (keys %param) {
>        print "host $host: param $key = $param{$key}\n";
>    }
>}

>Comments?  Any hidden gotchas that I haven't noticed?

Found one already!  When I ran code similar to the above with warnings
enabled, I got

Undefined value assigned to typeglob at ...

when each() returned undef after iterating through the entire hash.

Oh well.  It looked like such a nifty little idiom...

-- 
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
            | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
            | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu


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

Date: Wed, 02 Dec 1998 19:32:41 +1100
From: Erik de Castro Lopo <erikd@zip.com.au>
Subject: Re: Perl "Expert" for Global Remove E-mail List
Message-Id: <3664FB29.52674068@zip.com.au>

Jeffery DeMarco wrote:
> 
> Contract work - Part Time - Tele-Commute
> 
> I am looking for an 'OFF THE SHELF"
> Perl Script to be used as a 'Global Remove List'
> for e-mail addresses.

"Global Remove Lists" are all a scam and I would not have 
anything to do with anybody even proposing such a thing.

If someone spams me I have a bot that complains to all the
appropriate places to get the spammer's accounts nuked.

Erik
-- 
+-------------------------------------------------+
     Erik de Castro Lopo     erikd@zip.com.au
+-------------------------------------------------+
When a user mailbombs me with 100,000 messages, we 
call it denial of service and the guy can be thrown 
in jail.  When 100,000 SPAMMERS send me one mail each, 
we call it marketing.


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

Date: Wed, 02 Dec 1998 07:23:45 -0500
From: Ken McNamara <conmara@tcon.net>
Subject: Re: Perl binary manipulation
Message-Id: <36653151.E0E7B7DF@tcon.net>

Kevin -

Try the bit shift operators:  "<< or >>".  You can extract just the parts of
the number you are interested in and reduce the confusion.

KenMc

Kevin Wormington wrote:

> Hi, I am fairly new to perl and am trying to extract fields from a binary
> field that has the layout below.  I have managed to get the field converted
> to binary padded to 32bits using pack("N") and viewed in binary via unpack
> ("B32"), but when I try to use something like unpack("B3B5B3B4B1B6B10") it
> seems to stop on the singe bit designated B1.  Can anyone provide any hints
> on how to extract this info?
>
> Thanks
> Kevin
>
> 31-29           Reserved
> 28-24           Type field (Currently unused)
> 23-21           Chassis field
> 20-17           Slot field
> 16              PM field
> 15-10           Link field
> 9-0             Channel field
>
> Translate 1041 to binary :
>
> 10000010001
>
> Pad to 32 bits :
>
> 00000000000000000000010000010001
>
> Separate the fields by a space :
>
> 000 00000 000 0000 0 000001 0000010001





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

Date: Wed, 02 Dec 1998 11:38:25 +0000
From: Neil Elliott <en02@gre.ac.uk>
Subject: Perl Script to take data off a form and post it to the operator
Message-Id: <366526B1.A181EFFB@gre.ac.uk>

I have been trying to get this perl script to work with a form for ages
and I have hit my head on a brick wall
I know there arse some bugs but I can't really find them.

The Perl Script is ment to take the information inputting in the form
and display html pages when data is inputed
and then right the data to a file then mail that file to me.

The address for this is

Location of Webpage  http://www.gre.ac.uk/~en02/code/accept/accept.htm
Then form calls
http://www.gre.ac.uk/~en02/cgi-bin/testform.pl

If any one has any suggestions there would be greatly appreated.

_____________________________________________________________________________________

Neil Elliott
CMS Support
The University of Greenwich
London
England

E-mail en02@gre.ac.uk



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

Date: 02 Dec 1998 11:57:21 +0000
From: Peter Riocreux <priocreux@cs.man.ac.uk>
Subject: problem with \ifthenelse inside tabularx
Message-Id: <9kd862dae6.fsf@cs.man.ac.uk>

I am trying to create tables with a variable number of lines based on
the values of the arguments to the macro that generates them.  Someone 
locally suggested using the ifthen package, which does almost
everything I want, but there is a remaining problem.

Using the code below:

-------------------------------------------------------------
\documentclass{article}
\usepackage{tabularx}
\usepackage{ifthen}

\begin{document}

\newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp}

\newcommand{\mycommand}[3]{%
\par% 
  \begin{tabularx}{\linewidth}{|>{\bfseries}l<{\textnormal}|>{\PreserveBackslash\raggedright}X|}%
    \hline% 
    Name & #1 \\ \hline%
    \ifthenelse{\equal{#2}{}}{}{Definition & \texttt{#2} \\ \hline}%
    \ifthenelse{\equal{#3}{}}{}{Example & \texttt{#3} \\ \hline}%
  \end{tabularx}%
}

\mycommand{}{}{}
\mycommand{a}{}{}
\mycommand{}{b}{}
\mycommand{}{}{c}
\mycommand{a}{}{c}
\mycommand{a}{b}{}
\mycommand{}{b}{c}
\mycommand{a}{b}{c}

\end{document}
-------------------------------------------------------------

The 4th, 5th, 7th and 8th tables are produced correctly, but the
others are not.  The incorrect ones have an extension to the first two 
vertical lines, below the proper extent of the table.  The correct
ones are always the ones that have something in the third argument
(the number is irrelevant, it is the *last* argument, whatever number
of arguments there are).

I cannot fathom a reason for this, and it stumped the person who
suggested the ifthen package.  It doesn't produce any kind of error,
it just does it wrong.  I thought perhaps the \ifthenelse was being
evaluated to a {} and it was starting a new line of the table, but if
that were the case, it would complain about a lack of an & and/or
would generate all three vertical lines.  Can anyone offer a
suggestion as to a) why?  and b) how to make it do what I want it to
do?

Pete

-- 
Peter Riocreux, Amulet Group, Dept. Computer Science, Manchester University,
Oxford Road, MANCHESTER, M13 9PL, UK.      <http://www.cs.man.ac.uk/amulet/> 
Voice: +44 161-2753531      Mobile: +44 7970-611366     Fax: +44 7970-524798


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

Date: Wed, 2 Dec 1998 06:06:42 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Strip and add, perl style
Message-Id: <ebohlmanF3BqB7.JFr@netcom.com>

Mark D. <mark@doddx.com> wrote:
: Yes, it doesn't work on my system. I've got 5.04 installed, here's my
: results:

: $cgi_client{'foo'} = "test  test again.gif";
: srand( time() ^ ($$ + ($$ << 15)) );	
: $cgi_client{'foo'} = (int(rand(100000)) + 1) . $cgi_client{'foo'};
: $cgi_client{'foo'} =~ s/[&()\s]|\.html//gi;
: print "$cgi_client{'foo'}\n";	
: __END__
: testtestagain.gif

: I'm not sure what's going on. :(

Neither am I.  I captured the code directly from your post and ran it on 
two different systems (5.004 under SunOS and 5.005 under Win95) and both 
times I got a number in front of the string you got.

Was the code you posted cut-and-pasted from your actual code, or did you 
retype it for the post?  If the latter, it's possible you have a mistake 
in your actual code but the phenomenon called "psychological set" 
(basically, the tendency to see what you expect to see) is causing you to 
correct the error as you type (i.e. you're typing what your code should 
be rather than what it actually is).

Also, did you run only the code that you posted, or did you run a larger 
program that contained it?  If the latter, it's possible there's a 
mistake somewhere else that's confusing the interpreter.  Try retrieving 
your post, cutting-and-pasting exactly the above code into a new file, 
and running the new file through perl.



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

Date: 02 Dec 1998 10:55:00 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Using RCS in Perl scripts
Message-Id: <912596171.483484@thrush.omix.com>

Russ Allbery <rra@stanford.edu> wrote:
: Zenin <zenin@bawdycaste.org> writes:
: > This is a little long, but it gets the job done nicely:
: > $VERSION = do { sprintf '%d.%03d'.'%02d' x ($#r-1), (q$Revision: 2.10 $ =~ /\d+/g) };
: Where do you set @r?

	Duh.  I tryed to reformat it shorter before I posted it, and didn't
	test it well enough.  My bad. :-P

	Ok, here's my original version that does work:

	$VERSION = do { my @r = (q$Revision: 2.0 $ =~ /\d+/g); sprintf '%d.%03d'.'%02d' x ($#r-1), @r};

: Doesn't seem to be working quite right.
: If you don't use branches, this works fine:
: ($VERSION = (qw$Revision: 1.2 $)[-1]) =~ s/\.(?!\d\d)/.0/;

	Only up to 1.99 however, which can quickly fail if you check in
	even once a day.

: Argh.  I can *almost* do this accounting for branches in a single
: 80-column line, but not quite.  I could if we had variable-length negative
: lookbehind in the regex engine.

	If we only had support for triples in UNIVERSAL::VERSION(), we
	wouldn't have to play any of these games. ;-)

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: 02 Dec 1998 03:09:59 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Using RCS in Perl scripts
Message-Id: <ylk90a7qbc.fsf@windlord.stanford.edu>

Zenin <zenin@bawdycaste.org> writes:
> Russ Allbery <rra@stanford.edu> wrote:

>> Doesn't seem to be working quite right.
>> If you don't use branches, this works fine:
>> ($VERSION = (qw$Revision: 1.2 $)[-1]) =~ s/\.(?!\d\d)/.0/;

> 	Only up to 1.99 however, which can quickly fail if you check in
> 	even once a day.

Yeah, yeah.  Picky.  :)

($VERSION = (qw$Revision: 1.2 $)[-1]) =~ s/\.(\d+)/sprintf '.%03d', $1/e;

There should be a shorter way of doing that.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 02 Dec 1998 12:00:50 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Using RCS in Perl scripts
Message-Id: <912600121.138742@thrush.omix.com>

Russ Allbery <rra@stanford.edu> wrote:
	>snip<
: ($VERSION = (qw$Revision: 1.2 $)[-1]) =~ s/\.(\d+)/sprintf '.%03d', $1/e;
:
: There should be a shorter way of doing that.

	There should also be a way to make MakeMaker respect multi-line
	version definitions, or better yet some way it could respect
	my version.pm module without needing to fully eval the entire
	module.  I wrote version.pm to be able to do things like:

	use version q$Revision: 1.2 $, 'beta';

	And have it sanely make a $VERSION that VERSION() would like, string
	"beta" or whatever.  But alas MakeMaker won't see any $VERSION, and
	more importantly neither will CPAN.pm... :-/

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Wed, 02 Dec 1998 09:24:56 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Why is "... @foo ..." occasionally a syntax error?
Message-Id: <3665fa85.2631786@news.skynet.be>

Russ Allbery wrote:

>Er, that's perfectly legal Perl.  It means the same thing as:
>
>        $extra = join ($", @resource) if ($typ eq 'lab');
>
>His meaning isn't ambiguous in this case, provided that there's actually
>an array @resource in his program.

That's just it, I think. My guess is that @resource is ONLY used (and
set) in one of the reuired files, besides this one statement in the main
script.

"Mention" this array in the main script in plain form as well, and you
should have no more problems.

	Bart.


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

Date: Wed, 02 Dec 1998 12:08:02 GMT
From: elcaro@my-dejanews.com
Subject: win32API module available for Unix?
Message-Id: <743aj1$f31$1@nnrp1.dejanews.com>

Does anyone know if the win32API is available for Unix? I've seen the module
but it seems to be precompiled for i386 and I need to do this work under Sun
Solaris.

Thanks alot

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 02 Dec 1998 07:37:18 -0500
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: win32API module available for Unix?
Message-Id: <u3e6y3ekh.fsf@hou.moc.com>

elcaro@my-dejanews.com writes:

> Does anyone know if the win32API is available for Unix? I've seen
> the module but it seems to be precompiled for i386 and I need to do
> this work under Sun Solaris.

You're joking, right?

Jeremy
-- 
Jeremy D. Zawodny       Web Geek, Perl Hacker, etc.
Marathon Oil Company    zawodny@hou.moc.com

LOAD "LINUX",8,1


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

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

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