[7076] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 703 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 7 21:17:25 1997

Date: Mon, 7 Jul 97 18:08:16 -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           Mon, 7 Jul 1997     Volume: 8 Number: 703

Today's topics:
     Re: Pattern Matching Question <usenet-tag@qz.little-neck.ny.us>
     Re: Pattern matching question (Colin Kuskie)
     Perl 5.004 binary for Solaris 2.5 <andy@cyberware.co.uk>
     Re: Perl 5.004 binary for Solaris 2.5 <rootbeer@teleport.com>
     Perl controlling a PPP dialout session? (Lloyd Zusman)
     Perl for Win32 and Win32::NetResource? (Marc Haber)
     Re: Perl for Win32 and Win32::NetResource? (Marc Haber)
     Perl library, .BAS, dll for VB? (doug a blaisdell)
     Perl on NT with IIS <dwyan@pc.jaring.my>
     Re: Perl on NT with IIS (Jeremy D. Zawodny)
     Re: Perl-Win32  OLE and Excel  Flakey ? (Scott McMahan)
     Perl5 for IRIX 6.2!!! <cbsmith@titan.tcn.net>
     Re: Perl5 for win/dos (etta )
     Re: Perl: Array String cutting <rootbeer@teleport.com>
     pipes to telnet <leggett@mhpnutau.physics.lsa.umich.edu>
     Re: please add this to the warning list for perl code (Andrew M. Langmead)
     preventing break-out... (Ali Anghaie)
     Re: preventing break-out... (Nathan V. Patwardhan)
     Re: print reverse (Honza Pazdziora)
     Re: Printing to a serial port duplicates first 4k, then <rootbeer@teleport.com>
     Problem building perl5.004_01 forster@na-cp.rnp.br
     Problem with pack() and unsigneds <support@dwx.com>
     Re: Q: PGP & PERL <rootbeer@teleport.com>
     Re: Question - help (Tung-chiang Yang)
     Re: Question - help <ajohnson@gpu.srv.ualberta.ca>
     Re: quick regex help <sfairey@adc.metrica.co.uk>
     Receiving an UDP broadcast <remco@cal010031.student.utwente.nl>
     Re: regexp grouping with parens but only matching one s (Tad McClellan)
     Re: regexp substituting with processing (Tad McClellan)
     Re: regexp substituting with processing <rootbeer@teleport.com>
     Re: Running script fragment in different file, same con (M.J.T. Guy)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 3 Jul 1997 16:46:22 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: Pattern Matching Question
Message-Id: <5pgl0u$r0$1@news.netusa.net>

Mark A. O'Neil <Mark.A.O'Neil@Dartmouth.EDU> wrote:
> If I have a string: $fp = "/one/two/three/aFile.txt"
> The $fp string will always be an unknown path.
> $fp =~  s#.*/##;   #returns the last element (in this case "aFile.txt")
> 
> The snippet "s#.*/##" is from O'Reilly's  Learning Perl, and is presented
> w/o much of an explanation and I cannot find anything in the Camel book
> which elucidates on the use of # in pattern matching, so any help with that

This is because there is nothing special about #. All of these work
just as well (but some are not advised for other reasons):

	s".*/""
	s;.*/;;
	s:.*/::
	s%.*/%%
	s@.*/@@
	s!.*/!!
	s&.*/&&
	s$.*/$$
	s^.*/^^
	s?.*/??
	s{.*/}{}
	s[.*/][]
	s<.*/><>
	s(.*/)()

FWIW, most of those work in ed and vi as well.

> What I would like to end up with is something similar which would change
> $fp to "/one/two/three", I can accomplish this with multiple pattern

	$fp =~ s,/[^/]*$,,;

Elijah
------
#!/usr/bin/perl -w
$_="<j!y~f^v* >h.g=c+m\@q[p;r} ?x/t|d:l# )e\\p.d-s]p{c<,\n";$j=0;while(
s"[^\w\s,](.*)"($u=$1,$u=~s;(\w);(($s=ord($1)-97),chr((($s+$j++)%26)+97
));gex,$u)"ex){}exit !print;#18/5/97:etb


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

Date: 3 Jul 1997 16:56:16 -0700
From: colink@defiant.latticesemi.com (Colin Kuskie)
Subject: Re: Pattern matching question
Message-Id: <5phe70$1gd@defiant.latticesemi.com>

In article <33B75900.719E@icd.com.au>, P Nibbs  <pnibbs@icd.com.au> wrote:
>I would like to test for IP numbers between a certain range
>(203.63.0.0 -> 203.63.255.255)
>
>if ($ENV{REMOTE_ADDR} == /203.[0-63].[0-255].[0-255]/){
>
>This isn't working - can anyone please tell me what i am doing wrong?
I'm in the middle of reading Jeffrey Friedl's excellent book
Mastering Regular Expressions, and immediately noticed that the answer
to your question comes from chapter 1 and deals with character classes.

In short:
[a-z] is the class of characters from a to z
[a-zA-Z] is the class of characters from a to z and A-Z
[0-9] is the class of characters from 0 to 9, i.e. 1 2 3 4 5 6 7 8 9

[...] is a *character* class, not a number generator.  This is
easy to confuse when you see examples like:
[\040-\056] which is the class of characters defined by octal numbers
040 to 056.

Disecting your code:

[0-63] is the class of characters 0 to 6 and 3 (redundant 3)
[0-255] is the class of characters 0 to 2 and 5 and 5 (redundant 5)

It turns out that matching a valid IP address exactly is quite a bit of
work.  It takes Jeffrey three pages to define all the problems (pgs 123-125).
The answer to your question is a modification of the code found on page 124.

Good luck,
Colin Kuskie


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

Date: 6 Jul 97 10:41:06 GMT
From: "Andy Fletcher" <andy@cyberware.co.uk>
Subject: Perl 5.004 binary for Solaris 2.5
Message-Id: <01bc89fc$d6a78d00$0edd4ac2@194.74.221.2>

I am looking for a perl 5.004 binary for our Netra to run under Solaris
2.5.

Can anyone help ?


many thanks

Andy Fletcher
andy@cyberware.co.uk



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

Date: Sun, 6 Jul 1997 12:15:15 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Andy Fletcher <andy@cyberware.co.uk>
Subject: Re: Perl 5.004 binary for Solaris 2.5
Message-Id: <Pine.GSO.3.96.970706121408.2360C-100000@kelly.teleport.com>

On 6 Jul 1997, Andy Fletcher wrote:

> I am looking for a perl 5.004 binary for our Netra to run under Solaris
> 2.5.
> 
> Can anyone help ?

Sure. Download the source from CPAN and compile it. :-)  It takes only a
couple of commands to get it started, and it's better (for umpteen
reasons) than getting just an opaque binary. Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: 4 Jul 1997 20:53:39 GMT
From: asfast@asfast.com (Lloyd Zusman)
Subject: Perl controlling a PPP dialout session?
Message-Id: <slrn5rqok4.fv.asfast@ljz.asfast.net>

I have Perl 5.004_01 installed under Linux, and I'm looking for
something written in Perl that can control PPP dialout sessions.  I am
*not* interested in anything which runs 'dip' or 'chat' or any other
piece of software ... I'd like to find something that goes straight
out to the modem port and manages the PPP connection solely in Perl.

Does such a thing exist?  I couldn't find anything like this over
at CPAN.

Thanks in advance.


-- 
 Lloyd Zusman
 ljz@asfast.com


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

Date: Thu, 03 Jul 1997 16:35:41 GMT
From: s_haber@ira.uka.de (Marc Haber)
Subject: Perl for Win32 and Win32::NetResource?
Message-Id: <5pgka2$nul$1@nz12.rz.uni-karlsruhe.de>

Hi!

I am trying to use the Win32::NetResource module. The FAQ mentions
that the module was forgotten in the binary release, I have a
netresource.pll file. Look:

e:\perl>type test.pl
use Win32::NetResource;

e:\perl>perl -v

This is perl, version 5.003_07

Copyright 1987-1996, Larry Wall

        + suidperl security patch
        Win32 port Copyright (c) 1995-1996 Microsoft Corporation.
                All rights reserved.
        Developed by ActiveWare Internet Corp.,
http://www.ActiveWare.com

Perl for Win32 Build 306 - Built 17:50:28 Apr 10 1997

Perl may be copied only under the terms of either the Artistic License
or the GNU General Public License, which may be found in the Perl 5.0
source kit.


e:\perl>perl test.pl
Can't load 'd:/Perl/lib/auto/Win32/NetResource/NetResource.pll' for
module Win32::NetResource: 31 at d:/Perl/lib/DynaLoader.pm line 450.

 at test.pl line 1
BEGIN failed--compilation aborted at test.pl line 1.

e:\perl>dir d:\perl\lib\auto\win32\netresource\netresource.pll

 Volume in drive D is MH1 D          Serial number is 11E4:242F
 Directory of  D:\perl\lib\auto\win32\netresource\netresource.pll

10.04.97  17:53          54.784   ___A_  NetResource.pll
        54.784 bytes in 1 file and 0 dirs    65.536 bytes allocated
   113.147.904 bytes free

e:\perl>

What am I doing wrong?

Any hints will be appreciated.

Greetings
Marc

-- 
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber          |   " Questions are the         | s_haber@ira.uka.de
Karlsruhe, Germany  |     Beginning of Wisdom "     | Fon: *49 721 966 32 15
Nordisch by Nature  | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29


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

Date: Fri, 04 Jul 1997 10:20:19 GMT
From: s_haber@ira.uka.de (Marc Haber)
Subject: Re: Perl for Win32 and Win32::NetResource?
Message-Id: <5piim8$as4$1@nz12.rz.uni-karlsruhe.de>

s_haber@ira.uka.de (Marc Haber) wrote:
>I am trying to use the Win32::NetResource module.

>e:\perl>perl test.pl
>Can't load 'd:/Perl/lib/auto/Win32/NetResource/NetResource.pll' for
>module Win32::NetResource: 31 at d:/Perl/lib/DynaLoader.pm line 450.

As this seems to work under Windows NT, I suspect that NetResource is
incompatible with Windows 95. Can anycone confirm this?

Do I have a chance to connect a local drive letter on Windows 95 to a
network resource without having to shell out to "net use"?

Any hints will be appreciated.

Greetings
Marc

-- 
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber          |   " Questions are the         | s_haber@ira.uka.de
Karlsruhe, Germany  |     Beginning of Wisdom "     | Fon: *49 721 966 32 15
Nordisch by Nature  | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29


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

Date: Thu, 3 Jul 1997 18:01:04 GMT
From: dougb@world.std.com (doug a blaisdell)
Subject: Perl library, .BAS, dll for VB?
Message-Id: <ECr8ps.6FE@world.std.com>

Does there exist a library, .bas file, or dll with Perl-ish functions
in it (eg "split", associative arrays, etc) that can be called from
VB to do perl-like processing in VB. I don't want to "shell out" to
Perl programs--all the perl-ish functions have to be implemented in VB.


thanks



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

Date: 7 Jul 1997 14:40:14 GMT
From: "David Yan" <dwyan@pc.jaring.my>
Subject: Perl on NT with IIS
Message-Id: <01bc8ae3$7a052ca0$e4e58ea1@nitron.jaring.my>

Help ! I'm a new user to perl.... I 'm currently trying to install perl 5
on my company Windows NT 4.0 Server with IIS 3 . Is there any detail source
of information to guide me to get perl works under my system ( I mean real
detail ).
Is there any replacement program for sendmail under UNIX which will work
for NT. I'm going to use it as a way to post some information through CGI
with Perl.
Just wonder if any of you familiar with Netscape Mail Server 2.02 (NT
version) ..... is there any program in it to replace sendmail ( for UNIX).
Please send the information to me at david@ag.com.my
Many appreciation to your help....Thanks


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

Date: Mon, 07 Jul 1997 16:57:22 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Perl on NT with IIS
Message-Id: <33c11f5e.443837073@igate.hst.moc.com>

On 7 Jul 1997 14:40:14 GMT, "David Yan" <dwyan@pc.jaring.my> wrote:

>Help ! I'm a new user to perl.... I 'm currently trying to install perl 5
>on my company Windows NT 4.0 Server with IIS 3 . Is there any detail source
>of information to guide me to get perl works under my system ( I mean real
>detail ).

Yes, follow the instructions included with Perl and the IIS3
documentation.  If there is information missing, let us know what
you've tried and what didn't work.

>Is there any replacement program for sendmail under UNIX which will work
>for NT. I'm going to use it as a way to post some information through CGI
>with Perl.

Yes.  It's called blat.exe.

>Just wonder if any of you familiar with Netscape Mail Server 2.02 (NT
>version) ..... is there any program in it to replace sendmail ( for UNIX).

Un-perl.

>Please send the information to me at david@ag.com.my

Why?  You don't read this newsgroup?  Why did you post here?

>Many appreciation to your help....Thanks

You're welcome.

Jeremy
-- 
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio

http://www.marathon.com


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

Date: 3 Jul 1997 17:53:39 GMT
From: scott@lighthouse.softbase.com (Scott McMahan)
Subject: Re: Perl-Win32  OLE and Excel  Flakey ?
Message-Id: <5pgov3$sh8$2@mainsrv.main.nc.us>

Vince Webb (vince.webb@reuters.com) wrote:

: Instructions prior to the OLE part have a bad effect
: on the OLE operation.

This should not be happening. If you post (or e-mail me) code, I could
tell you more. Other code should have *no* effect on OLE Automation
whatsoever, unless you create strings at runtime which are wrong and
pass it to OLE Automation functions.

: I would love to hear answers or similar problems.

I've found OLE automation with Excel to be very bizarre.  First of all,
they changed the object model substantially between version 5, which
must be what the Win32 Perl documentation uses, and now. Scripts simply
won't work. I'd get a good book (Excel 97 Developer's Handbook is a
good one) on Excel programming and learn the new object model, and then
try to adapt that to Perl.

Even then, many things simply don't work, or work in bizarre ways. (I
can't get document saving to work, for example!) There's no way to
debug what is going on, because everything is noninteractive. It's like
trying to debug a CGI program on a foreign computer.

Here's my advice: write all the stuff you want to do as an Excel VBA
subroutine, and execute that subroutine from Perl.  Minimize the number
of OLE Automation calls from Perl to the absolute, bare minimum.

Scott





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

Date: Fri, 04 Jul 1997 08:11:26 -0400
From: Christopher Smith <cbsmith@titan.tcn.net>
Subject: Perl5 for IRIX 6.2!!!
Message-Id: <33BCE86E.41C6@titan.tcn.net>

Hi there. I am migrating from IRIX 5.3 to 6.2 and I'm having a heck of a
time finding Perl5 binaries for that platform (my 5.3 binaries seem to
fail whenever I load a perl library).

Is there a location where I can find an up to date version of Perl5
easily?

--Chris
cbsmith@adeo.com


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

Date: Sun, 06 Jul 1997 18:10:48 GMT
From: etta@fyi.com (etta )
Subject: Re: Perl5 for win/dos
Message-Id: <33bfdbbf.168603454@netnews.worldnet.att.net>


Get Pfe its a windows editor that will run perl or java scripts and
echo back the results with in the program. So you will see if there
are any error, it will tell you the error and the line number where
the error occurs. And there's also a function that will automaticly
put line numbers on your script so you won't have to count them
yourself to find the line that has the error. Just click a icon to
turn it on or off.

You can find it here:  http://www.lancs.ac.uk/people/cpaap/pfe

Hope this helps,

etta 

On Sat, 05 Jul 1997 17:47:46 GMT, ralessi@bright.net (Rikky Alessi)
wrote:

>I'm looking for a perl for perl5( i already have 4) that runs in
>windows and dos.  I mean that if I go to run and type 
>
>c:\perl\perl c:\cgi\gb.pl
>
>It will run the script and do whatever I tell it to do.  I've found
>some like this but they don't work because it runs the script then
>closes the window so I can't see if it worked correctly.  If you can
>find something like this drop me a line.
>
>



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

Date: Fri, 4 Jul 1997 07:02:38 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Shaun O'Shea <lmisosa@eei.ericsson.se>
Subject: Re: Perl: Array String cutting
Message-Id: <Pine.GSO.3.96.970704070205.10208E-100000@kelly.teleport.com>

On Fri, 4 Jul 1997, Shaun O'Shea wrote:

> 	I have an array called @type whose elements are of the form:
> 155 04-
> 143 12-
> 3/155 04-
> 206 34-
> 13/143 12-
> etc
> 
> i.e some of the elements have a number followed by a "/" at the
> beginning. I want to remove the the  "number/" bit from the elements
> which have them.

You could use a s/// inside a loop. Have you tried that? Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: Fri, 04 Jul 1997 17:26:15 -0400
From: The Electric Snark <leggett@mhpnutau.physics.lsa.umich.edu>
Subject: pipes to telnet
Message-Id: <33BD6A76.18CD@mhpnutau.physics.lsa.umich.edu>

I've written numerous routines to handle reading and writing with a
pipe to a telnet command, using both simple pipes and the more complex
double fork technique. They have all worked fine on an HPUX platform,
but when I transferred them to a Sun or Alpha, they don't work. Here's
the essence of the problem:

open(TEL,"|telnet $host $port");
print TEL $data;
close TEL;

On the HP, this works find an prints the output of the telnet to the
screen. However on the Sun, all I get is the Connection message:
Trying...
Connected to xxxxxxxxxxxxxxxx
Escape character is '^]'.
 
And then it exits. 

Redirecting the output to a file doesn't help.

Anyone know what is going on? I don't really want to rewrite everything
I have using the Net::Telnet module (which does work fine), as this 
would involve a lot more effort than fixing this problem (if the 
solution is a trivial one that is....).


                           thanks in advance.... charles
 
------------------------------------------------------------------------------
Charles Leggett           DoD# 963   |   "Unto each man is given the key that 
                                     | will open the door to Heaven. The same
leggett@mhpbob.physics.lsa.umich.edu | key unlocks the gates of Hell."
University of Michigan at CERN       |             - ancient Buddhist proverb
---------------------- http://www.umich.edu/~cleggett/ -----------------------


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

Date: Sat, 5 Jul 1997 00:57:36 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: please add this to the warning list for perl code
Message-Id: <ECtMo0.9sA@world.std.com>

Curtis Hrischuk <ceh@arcturus.sce.carleton.ca> writes:

>It turns out the bogus code executed properly, except the
>initialization issued a warning about the hash having an odd number of
>parameters.  

>This was so obvious that I didn't see it.

>Would it be possible to warn about this?

>From what I've been told years ago, unix was built around several
written and unwritten concepts. (Eventually more of them got written
down in books like "Life With Unix") the one that seems to apply here
is:

	Don't stop stupid people from doing stupid things, because
	then you stop clever people from doing clever things.

Someone else may create an object constructor that takes a single hash
reference as an argument. I'd hate for their code that called their
module to have spurious warnings because of a mistake that you will
never make in another month or two.

-- 
Andrew Langmead


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

Date: 4 Jul 1997 22:59:38 GMT
From: ali@iriquois.eel.ufl.edu (Ali Anghaie)
Subject: preventing break-out...
Message-Id: <5pjv8q$k85@huron.eel.ufl.edu>


Is there any way of preventing breaking out of a Perl script?  I would like
to write some scripts, set them SUID/SGID, and allow the lab operators to
handle day-to-day chores without having to have the root password...

Any ideas would be greatly appreciated... thanks...
-- 

  - Ali A. (Amir-Ali R. Anghaie)
  - ali@eel.ufl.edu

  { Any opinions herein are not facts :) }


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

Date: 5 Jul 1997 00:40:09 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: preventing break-out...
Message-Id: <5pk559$l88@fridge-nf0.shore.net>

Ali Anghaie (ali@iriquois.eel.ufl.edu) wrote:

: Is there any way of preventing breaking out of a Perl script?  I would like
: to write some scripts, set them SUID/SGID, and allow the lab operators to
: handle day-to-day chores without having to have the root password...

You should look into your documentation for SIG, signals, signal
handling, etc.  I'm not sure if these things are implemented on
NTPerl.


--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Fri, 4 Jul 1997 11:48:34 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: print reverse
Message-Id: <adelton.868016914@aisa.fi.muni.cz>

sysop@diamonds.com (Zisha Weinstock) writes:

> $foo = reverse("12345");
> print $foo;
> 
> prints 54321
> 
> print reverse("12345");
> 
> prints 12345. Why?

Because:

	reverse LIST
		In a list context, returns a list value consisting of
		the elements of LIST in the opposite order.  In a
		scalar context, returns a string value consisting of
		the bytes of the first element of LIST in the opposite
		order.

	(man perlfunc, search reverse)

So you might want to try

print scalar(reverse("12345"));

Hope this helps.

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Thu, 3 Jul 1997 17:44:46 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Greg Mortensen <loki@world.std.com>
Subject: Re: Printing to a serial port duplicates first 4k, then OK
Message-Id: <Pine.GSO.3.96.970703174230.6445N-100000@kelly.teleport.com>

On Thu, 3 Jul 1997, Greg Mortensen wrote:

> On the perl (receiving) side this happens:  The first 4k (or so) prints
> to STDOUT just fine, then it repeats the first 4k (with Control-J's this
> time), then the rest of the file prints without any problems. 

That's pretty strange. It may be that your copy of Perl is miscompiled,
but it's hard to be sure. Does it still happen if you use read() instead
of the line input operator? Can you write an equivalent C program which
works properly? Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: Fri, 04 Jul 1997 08:41:10 -0600
From: forster@na-cp.rnp.br
To: forster@na-cp.rnp.br
Subject: Problem building perl5.004_01
Message-Id: <868023496.26879@dejanews.com>

Hello all!

I'm having problems building perl 5.004_01 and I thought someone here
could help me.

System Type: Solaris 2.5

This is what I got when I try "make test":

<---skip--->

lib/socket........ld.so.1: ./perl: fatal: relocation error: symbol not
found: __inet_ntoa: referenced in ../lib/auto/Socket/Socket.so
FAILED on test 0
lib/soundex.......ok
lib/symbol........ok
lib/texttabs......ok
lib/textwrap......ok
lib/timelocal.....ok
lib/trig..........ok
Failed 1 test script out of 152, 96.71% okay.
   ### Since not all tests were successful, you may want to run some
   ### of them individually and examine any diagnostic messages they
   ### produce.  See the INSTALL document's section on "make test".
   ###
   ### Since most tests were successful, you have a good chance to
   ### get information with better granularity by running
   ###     ./perl harness
   ### in directory ./t.
u=1.12  s=0.91  cu=53.55  cs=43.29  scripts=147  tests=4160
make: *** [test] Error 1

Does anyone have an idea on what I could do?

TIA

Antonio Forster

PS: please reply to me via mail because I dont have full access to
newsgroups. Thanks.

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Mon, 07 Jul 1997 13:52:13 -0500
From: DWX <support@dwx.com>
Subject: Problem with pack() and unsigneds
Message-Id: <33C13ADC.E040AC1B@dwx.com>

I'm attempting to create my own animated GIFs using perl; I run into a
problem when trying to create my own GIF Control blocks, with a line
like:

$controlblock = pack("CCCCSCC",0x21,0xF9,0x04,0x00,0,0x00,0x00);

The official GIF89a spec calls for:

byte       type         field              comments/value
1          byte         extension intro    0x21
2          byte         graphic ctl label  0xF9
1          byte         block size         # bytes between delimit
2          packed flds
   3 bits - reserved
   3 bits - disposal method (values 0-3)
   1 bit  - user input flag
   1 bit  - transparent color flag
3-4        unsigned     delay time         x/100 s time to delay
5          byte         transparency color idx
1          block terminator                0x00

My problem? The values I pass as the delay time (the S in the
pack() template) aren't coming out right - when I pass 0, I get
a delay of 0. Otherwise, I get multiples of 256/100 seconds:

pass value of           get delay of
0                       0
1                       256/100 s
2                       512/100 s
3                       3 * 256/100 s

What am I doing wrong? Is the "S" a bad choice, for some reason?

Email copies appreciated - TIA.

Josh Kortbein
kortbein@dwx.com



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

Date: Thu, 3 Jul 1997 18:04:47 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Fabrizio Pivari <Fabrizio.Pivari@agip.it>
Subject: Re: Q: PGP & PERL
Message-Id: <Pine.GSO.3.96.970703180417.6445S-100000@kelly.teleport.com>

On Thu, 3 Jul 1997, Fabrizio Pivari wrote:

> Does it exist a simple perl script that interface PGP?

Check the modules list on CPAN. Hope this helps!

    http://www.perl.com/CPAN/
    http://www.perl.org/CPAN/

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: Sun, 6 Jul 1997 10:30:24 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: Question - help
Message-Id: <tcyangECw7uo.CDB@netcom.com>

Guten Tag :)

$a = 'aa.bb.cc.gg.tt';
$a = $1 if $a =~ /\.([^.]*)$/;

==================================
Afgin Shlomit wrote after zapping the scum of the universe:
: Hi everyone,

: I would like to know how I can get the last parameters in a variable.
: I mean if the variable conatin: aa.bb.cc.gg and the delimiter is '.' 
: I would like to get gg as an answer.
: the problem is that the number of element in the variable is not always 
: the same it can be more or less (eg: aa.bb.cc or aa.bb.cc.gg.tt). 

--
========= Try the low-crossposting robomoderated 'alt.culture.taiwan' ===

soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
   http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml


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

Date: Sun, 06 Jul 1997 12:52:42 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Question - help
Message-Id: <33BFDB6A.79A7ADA0@gpu.srv.ualberta.ca>

Tung-chiang Yang wrote:
!
! Guten Tag :)
! 
! $a = 'aa.bb.cc.gg.tt';
! $a = $1 if $a =~ /\.([^.]*)$/;

I'd assign to a different variable so as not to
destroy $a right away---and using substr() and rindex()
should prove much more efficient especially with longer
delimited substrings and/or more delimited fields:

$a='aa.bb.cc.tt';
$b=substr($a,rindex($a,".")+1);
print $b;

regards
andrew

! ==================================
! Afgin Shlomit wrote after zapping the scum of the universe:
! : Hi everyone,
! 
! : I would like to know how I can get the last parameters in a
variable.
! : I mean if the variable conatin: aa.bb.cc.gg and the delimiter is '.'
! : I would like to get gg as an answer.
! : the problem is that the number of element in the variable is not
always
! : the same it can be more or less (eg: aa.bb.cc or aa.bb.cc.gg.tt).


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

Date: Mon, 07 Jul 1997 17:52:58 +0100
From: Simon Fairey <sfairey@adc.metrica.co.uk>
To: Miten S Mehta <mehta@mama.indstate.edu>
Subject: Re: quick regex help
Message-Id: <33C11EE9.794B@adc.metrica.co.uk>

Miten S Mehta wrote:
> 
> 7/7/97
> 
> Dear Regex Crackers,
> 
> Here is the string:
> 
> public class SrvFeaturesTransaction extends lpTransaction
>                         implements NsTransaction, FeaturesConstants {
> 
>         protected boolean debug__ = true;
> 
>         private final static int SNMP_GET_WAIT_TIME = 1000;
>         private final static int SNMP_SET_WAIT_TIME = 5000;
> 
>         protected  NsNodeBnx nsNodeBnx_;
>         String community;
>         int cctId     = -1;
> 
>         public SrvFeaturesTransaction () {
> 
>                 if (debug__) {
>                         System.out.println ("===> In SrvFea Constructor");
>                 }
>         }
> 
> Herte is my regex:
> $x = "/* %I% %M% %H% */";
> $y = "private static String sccs_var=\"%W%\";";
> $data=~s/(public( )+((class)||(interface))(.)+{)/$1\n\n\n$y\t$x\n\n\n/;
> 
> I get $1 =  public SrvFeaturesTransaction () {
> I want it to be  as below
> 
> public class SrvFeaturesTransaction extends lpTransaction
>                         implements NsTransaction, FeaturesConstants {
> 
> is there a way I can tell first match only for substitution?
> 
> Have a good day !!!
> 
> Best Regards,
> 
> Miten Mehta.
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!
> Res:                                            |
> Miten S Mehta                                   |
> 311 S Lasalle St, 39E,                          |
> Durham, NC 27705                                |
> Tel: 919 416 3889                               |
> e-mail: mehta@mama.indstate.edu                 |
> resume url:                                     |
> ftp://mama.indstate.edu/users/mehta/resume.html |
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Sorry but I don't have time to work out exactly what you are trying to
get but from the looks of it if all you are interested in is getting
everything upto and including the '{' then you could use:

($funcname_and_bits) = $string =~ /^([^{]+{)/;

Given your suggested string and desired result, this would work.

Alternatively if you have other stuff before then you could use:

($funcname_and_bits) = $string =~ /^\s*(public[^{]+{)/m;

This assumes that you are looking for the first public class
declaration.

Hope this helps.

Simon


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

Date: Sun, 06 Jul 1997 20:30:51 +0200
From: Remco van Mook <remco@cal010031.student.utwente.nl>
Subject: Receiving an UDP broadcast
Message-Id: <33BFE45B.19454FBB@cal010031.student.utwente.nl>

Hi there,

I am currently working on a project to broadcast data on a 
Local Area Network through UDP. I am using perl for this, and the
server-side is already finished. 

The client side, however, has a few problems. Creating a socket, and
then try to recv() data through it, does not seem to work.

Can anyone tell me how to do this ? It seems I'm looking for the
perl-equivalent of recvfrom(2). I couldn't find this on dejanews or
CPAN.

Thanks in advance,

Remco van Mook
mook@cs.utwente.nl

-- 
Remco van Mook     Universiteitsraad UT    Faculteit Informatica
053-4895267        Fractie DD              Bedrijfsinformatietechnologie
      Politics, n.  From Latin "poly", meaning many, and "tics", 
                meaning little blood sucking insects.


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

Date: Thu, 3 Jul 1997 16:10:34 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: regexp grouping with parens but only matching one set of parens
Message-Id: <ag4hp5.r37.ln@localhost>

Tracy Bednar (spectran@netcom.com) wrote:
: How about a split?

: How about a split command:
: (@fields) = split(/[ ]+/,$line);

: where $line = your box.


But that doesn't split the "Martinez,Dave" part...

(@fields) = split(/[ ,]+/,$line);
#                    ^            ;-)


: jason@cimedia.com wrote:
: : I'm writing a program to pull down baseball box scores from the web,
: : parse the boxes and save individual player stats.

: : A line from the box that I want looks like this:

: : Martinez,Dave    RF          4   0   1   0   1   0   0   2   0   0   0
: : 0   0 


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Mon, 7 Jul 1997 07:32:25 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: regexp substituting with processing
Message-Id: <pknqp5.511.ln@localhost>

Timothy Loy (loyt@s054.aone.net.au) wrote:
: I am looking for a way to substitute a reference in plain text to a link
: in html file. 

: The requirements are:
: Starts from

: "rubbish other rubbish Sydney 612:2223 ,2512 something else"

: searches for "Sydney" then takes all the numbers with colons behind it

: eg s/([sS]ydney[ 0-9]?[0-9;,-]*//g

: then prints

: "rubbish other rubbish <a href="sydney+612:2223+,2512"></a> something else"

: ie 
: 1) finds the string with the numbers at the back
: 2) convert all spaces to "+" or delete them
: 3) convert to lower case
: 3) works globaly (ie can take care of multiple occurances on 1 line


------------------
#! /usr/bin/perl -w

$_ = "rubbish other rubbish Sydney 612:2223 ,2512 something else\n";

s!(                         # remember what matched in $1
   sydney                   # the keyword
   [ 0-9,:]+                # the field of interest (except the last char)
   \d                       # last char must be a digit (no trailing space)
  )                         # stop remembering
 !($s=$1)=~tr/A-Z /a-z+/;   # translate to lower case, and space => +
  qq(<a href="$s"></a>)     # generate the replacement string
 !geix;                     # Global, Eval, Ignore case, eXtended regex

print;
------------------


: is this possible with one line? or do i need a loop structure?

You could write it as one line, but what's the point of that? It is
more clear written this way. You probably really meant "one statement"?


: Any comments will be appreciated.


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Mon, 7 Jul 1997 15:22:54 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Timothy Loy <loyt@s054.aone.net.au>
Subject: Re: regexp substituting with processing
Message-Id: <Pine.GSO.3.96.970707152053.10643G-100000@kelly.teleport.com>

On 7 Jul 1997, Timothy Loy wrote:

> Starts from
> 
> "rubbish other rubbish Sydney 612:2223 ,2512 something else"
> 
> searches for "Sydney" then takes all the numbers with colons behind it
> 
> eg s/([sS]ydney[ 0-9]?[0-9;,-]*//g
> 
> then prints
> 
> "rubbish other rubbish <a href="sydney+612:2223+,2512"></a> something else"
> 
> ie 
> 1) finds the string with the numbers at the back
> 2) convert all spaces to "+" or delete them
> 3) convert to lower case
> 3) works globaly (ie can take care of multiple occurances on 1 line
> 
> is this possible with one line? or do i need a loop structure?

Sure, you can do it with one line.

    $some_string =~ s/([sS]ydney[ 0-9]?[0-9;,-]*)/ &my_convert($1) /ge;

Is that what you wanted? I'm sure you can write the sub yourself. :-)
Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: 4 Jul 1997 09:37:06 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Running script fragment in different file, same context
Message-Id: <5pig82$o1a@lyra.csx.cam.ac.uk>

In article <33baf131.4582337@news.one.net>, dave <over@the.net> wrote:
>A quick look thru the camel book led me to believe the easiest way to
>execute a script fragment contained in another file, within the same
>context as the main script, was to open and read the file lines into a
>string variable, then eval the string variable.  Turns out I also had
>to match a reg expression to the string variable and use the matched
>variable because the original string variable was tainted.
>
>Is there an easier way that I stupidly overlooked?

Yes.   See 'do' or 'require' in the perlfunc man page, which package up
exactly what you are doing the hard wayy.


Mike Guy


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

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

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