[9313] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2908 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 19 03:17:24 1998

Date: Fri, 19 Jun 98 00:00:51 -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, 19 Jun 1998     Volume: 8 Number: 2908

Today's topics:
    Re: $a: numeric or NOT ? (Ronald J Kimball)
    Re: 2 questions about lists (Larry Rosler)
    Re: 2 questions about lists (Ronald J Kimball)
    Re: 2D arrays (Martien Verbruggen)
        [Q] On WAKING a sleeping process... <NOSPAMkEynOn@panix.comNOSPAM>
        ANNOUNCE: Win32API::SerialPort (Bbirthisel)
        Arabic renderer in four lines of Perl <czyborra@cs.tu-berlin.de>
    Re: C/XS code to accept oddball Perl constructs? (Ilya Zakharevich)
    Re: Ctrl+C disable in perl program (Larry Rosler)
    Re: Ctrl+C disable in perl program (Michael Schilli)
    Re: exception handlng with eval (Mark-Jason Dominus)
    Re: gurusamy vs activeware perl nt (Martien Verbruggen)
    Re: Help combining two files. <psdspss@execpc.com>
    Re: How do you pre-append using "open" <rootbeer@teleport.com>
    Re: How do you pre-append using "open" <psdspss@execpc.com>
    Re: mkdir MODE problem (Martien Verbruggen)
    Re: ohsir.pl : suggestive perl poem <grs@pfxcorp.com>
        Perl on Linux access database on NT 4? <molkiheg@sp.zrz.tu-berlin.de>
        Perl standard distribution and IIS 4 <matt2@lonelyplanet.com.au>
        Problem with references <nathanw@post1.com>
    Re: Problem with references <rootbeer@teleport.com>
    Re: Problem with references (Mark-Jason Dominus)
    Re: regex terminator not allowed in comment in extended <mgregory@asc.sps.mot.com>
    Re: Sick things to do in foreach loops <rootbeer@teleport.com>
    Re: the ?PATTERN? match syntax <rootbeer@teleport.com>
    Re: the ?PATTERN? match syntax (Mark-Jason Dominus)
        Writing to a file on the same line <khalifa@blitz.cs.pitt.edu>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 19 Jun 1998 02:05:54 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: $a: numeric or NOT ?
Message-Id: <1daujis.ly53znyklarkN@bay1-264.quincy.ziplink.net>

Abigail <abigail@fnx.com> wrote:

> Ronald J Kimball (rjk@coos.dartmouth.edu) wrote on MDCCLII September
> MCMXCIII in <URL: news:1dasg3d.127knwz1715swmN@bay1-374.quincy.ziplink.net>:
> 
> ++ Actually, I noticed that.  I did think it was odd that it was called
> ++ "underline" instead of "underscore".
> ++ 
> ++ Nevertheless, this does not say that underscores are allowed *only* in
> ++ numeric literals.  That fact is not found anywhere in the standard
> ++ documentation.
> 
> 
> I doubt you will find anywhere in the standard documentation that ,
> is not allowed in numbers.
> 
> Yet, I would not want to draw any conclusion from that, or suggest
> something is missing in the documentation.
> 
> I don't see any conflict in "You cannot do X" and "The fact you cannot
> do X is not mentioned in the documentation".

You're splitting hairs.  No where in the standard documentation does it
say that , *is* allowed in numbers.  On the other hand, it *does* say in
the standard documentation that _ is allowed in numeric literals.  What
is missing is the statement that _ is not allowed in strings or input.

Note that scientific notation, which is mentioned as a format for
numeric literals, *does* work in strings and input.  Some of the formats
work in any number, whether literal, string, or input, and others work
only in numeric literals.  The standard documentation does not mention
this, and that is what is missing.

The conflict is between "You can do X in situation Y, but not in
situation Z" and "The fact you cannot do X in situation Z is not
mentioned in the documentation".

-- 
 _ / '  _      /         - aka -         rjk@coos.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: Thu, 18 Jun 1998 19:50:26 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: 2 questions about lists
Message-Id: <MPG.ff371c9b62bee199896a3@nntp.hpl.hp.com>

[This followup was posted to comp.lang.perl.misc and a copy was sent to 
the cited author.]

In article <3589870C.61CA@min.net>, John Porter <jdporter@min.net>says...
> Larry Rosler wrote:
 ...
> Maybe I'm misunderstanding what you're saying here, but...
> 
> 	$a = 0;
> 	for ( $a ) { $_ = 1; }
> 
> sets $a to 1, so the effect is "visible"; whereas...
> 
> 	for ( 0 ) { $_ = 1; }
> 
> is fatal:
> 	Modification of a read-only value attempted

I made my second post before I read yours.  We agree, of course.  I think 
there is a documentation problem.

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 19 Jun 1998 02:05:56 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: 2 questions about lists
Message-Id: <1daujvo.yjo4rf17ewyp2N@bay1-264.quincy.ziplink.net>

Alexander Farber <eedalf@eed.ericsson.se> wrote:

> thanks for the replies and i am sorry, that my 1st question 
> was actually answered in FAQ. I've forgotten to check there.
> 
> I am aware of Cperl-mode for emacs and i do have it, i am just
> looking for other indentation modes, since i don't like the one,
> that is included in Cperl and i don't know LISP myself to do my own.

Then why didn't you say so when you asked the question?

> "Oh man"... Though i usually never do it, i would like to note 
> smth this time: i am sick of people like Mike, who don't help 
> but just annoy.

I'm sick of people like you, who ask silly questions and complain when
someone refers them to the answers elsewhere.  That's pretty annoying
too.

> Mike, i have Llama and Camel books, the Perl 
> FAQ is in my home dir (ok, i missed it this time) and i know 
> how to use Dejanews. 

If you have all those resources, then why weren't you able to find the
answers to your questions?

> So if i am posting a question here, i could not find the answer 
> myself yet

Perhaps because you didn't bother trying.  As you noted above, you
didn't even look in the FAQ before asking your questions here.

> and i am hoping that maybe it is very obvious for 
> someone, and he/she will write me "hey, don't you know there's 
> already such an operator ... ?"

Michael told you where to find the answers to your questions.  What's
the problem?

-- 
 _ / '  _      /         - aka -         rjk@coos.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: 19 Jun 1998 03:00:33 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: 2D arrays
Message-Id: <6mck8h$qek$2@comdyn.comdyn.com.au>

In article <01bd9a8f$58d1fec0$26c809c0@internet>,
	"Thomas Mclaughlin" <it.sllas@btinternet.com> writes:
> I have been looking thru the "Learning Perl" book on arrays but
> cannot find 2D arrays. I am a perl newbie and want to use a 2D array
> like in C (it has been a few 

# perldoc perldata
# perldoc perllol
# perldoc perlref
# perldoc perldsc

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | The number of the beast is not 666. The
Commercial Dynamics Pty. Ltd.       | number is 95, and it's awake.
NSW, Australia                      | 


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

Date: 19 Jun 1998 06:50:54 GMT
From: k y n n <NOSPAMkEynOn@panix.comNOSPAM>
Subject: [Q] On WAKING a sleeping process...
Message-Id: <6md1oe$cv4@news1.panix.com>



Hi.  I have a process that every hour analyzes the contents of a large
datafile, and sleeps in between.  Occasionally, however, I would like
to have it analyze the data on command; i.e. I'd like to wake it up,
as it were.  So, my question is, how can I wake a sleeping process, so
that it proceeds exactly as if its sleep time had elapsed?  In case it
matters, the OS in question is IRIX6.2.

Thanks for all help,

K.

-- 
To reply directly by e-mail, remove the upper-case letters from the
return address in the header.



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

Date: 19 Jun 1998 04:11:26 GMT
From: bbirthisel@aol.com (Bbirthisel)
Subject: ANNOUNCE: Win32API::SerialPort
Message-Id: <1998061904112600.AAA00953@ladder03.news.aol.com>

Hi All:

The fourth alpha of Win32API::Serialport (version 0.08) is now available at:

## http://members.aol.com/Bbirthisel/alpha.html (CPAN shortly)

It runs on both Win95 and NT. Using both AS and GS perl releases. Features
a high-level interface with perl objects, non-blocking I/O, simultaneous use
of multiple ports, timeouts on operations, and configuration from a file.

Still alpha until I finish a few features and add a tutorial. But includes
demos
and a test suite (which runs automatically if Test::Harness is installed).

Comments and feedback welcome.

-bill
Making computers work in Manufacturing for over 25 years (inquiries welcome)


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

Date: Thu, 18 Jun 1998 12:12:20 +0000
From: Roman Czyborra <czyborra@cs.tu-berlin.de>
To: Unicode List <unicode@unicode.org>
Subject: Arabic renderer in four lines of Perl
Message-Id: <Pine.LNX.3.96.980618121150.4434A-100000@czyborra.cs.tu-berlin.de>

#!/usr/local/bin/perl

# arabjoin - a simple filter to render Arabic text
# B) 1998-06-18 roman@czyborra.com
# Freeware license at http://czyborra.com/
# Latest version at http://czyborra.com/unicode/
# PostScript printout at http://czyborra.com/unicode/arabjoin.ps.gz

# This filter takes Arabic text (encoded in UTF-8 using the Unicode
# characters from the U+0600 Arabic block in logical order) as input
# and performs Arabic glyph joining on it and outputs a UTF-8 octet
# stream that is no longer logically arranged but in a visual order
# which gives readable results when formatted with a simple Unicode
# renderer like Yudit that does not handle Arabic differently yet 
# but simply outputs all glyphs in left-to-right order.

# This little script also demonstrates that Arabic rendering is not
# that complicated after all (it makes you wonder why some software
# companies are still asking hundreds of dollars from poor students
# who just want to print their Arabic texts) and that even Perl 4 can
# handle Unicode text in UTF-8 without any nifty new add-ons.

# Usage examples:

# echo "X#YYX'Y X(X'YX9X'YY!" | arabjoin
# prints  !o;"o;o:o;o;o:o: Yo;<o;+o:
# which is the Arabic version of "Hello world!"

# | recode ISO-8859-6..UTF-8 | arabjoin | uniprint -f cyberbit.ttf
# prints an Arabic mail of charset=iso-8859-6-i on your printer

# | arabjoin | xviewer yudit
# delegates an Arabic UTF-8 message to a better viewer

# ftp://sunsite.unc.edu/pub/Linux/apps/editors/X/ has uniprint in yudit-1.0
# ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/pretest/ has recode-3.4g
# http://czyborra.com/unicode/ has arabjoin
# http://czyborra.com/unix/ has xviewer
# http://www.bitstream.com/cyberbit.htm or
# ftp://ccic.ifcss.org/pub/software/fonts/unicode/ms-win/ or
# ftp://ftp.irdu.nus.sg/pub/language/bitstream/ has cyberbit.ttf

# This is how we do it: First we learn the presentation forms of each
# Arabic letter from the end of this script:

while(<DATA>)
{
    ($char, $_) = /^(\S+)\s+(\S+)/;
    ($isolated{$char},$final{$char},$medial{$char},$initial{$char}) =
	/([\xC0-\xFF][\x80-\xBF]+)/g;
}

# Then learn the (incomplete set of) transparent characters:

foreach $char (split (" ", "
 Y Y Y
 Y Y Y Y0
 [ [ [ [ [ [ [ [  [! [" [# [$ [' [( [* [+ [, [-"))
{
    $transparent{$char}=1;
}

# Finally we can process our text:

while (<>)
{
    s/\n$//; # chop off the end of the line so it won't jump upfront

    @uchar = # UTF-8 character chunks
	/([\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+)/g;

    # We walk through the line of text and do contextual analysis:

    for ($i = $[; $i <= $#uchar; $i = $j)
    {
	for ($b=$uchar[$j=$i]; $transparent{$c=$uchar[++$j]};){};

	# The following assignment is the heart of the algorithm.
	# It reduces the Arabic joining algorithm described on
	# pages 6-24 to 6-26 of the Arabic character block description
	# in the Unicode 2.0 Standard to four lines of Perl:

	$uchar[$i] =  $a && $final{$c} && $medial{$b} 
	||  $final{$c} && $initial{$b}
	||  $a && $final{$b}
	||  $isolated{$b}
	||  $b;

	$a = $initial{$b} && $final{$c};
    }

    # Until the Unicode Consortium publishes its Unicode Technical
    # Report #9 (Bidirectional Algorithm Reference Implementation)
    # at http://www.unicode.org/unicode/reports/techreports.html
    # let us oversimplify things a bit and reverse everything:
 
    $_= join ('', reverse @uchar);

    # The following 8 obligatory LAM+ALEF ligatures are encoded in the
    # U+FE70 Arabic Presentation Forms-B block in Unicode's
    # compatibility zone:

    s/o:o;/o;5/g;
    s/o:o; /o;6/g;
    s/o:o;/o;7/g;
    s/o:o; /o;8/g;
    s/o:o;/o;9/g;
    s/o:o; /o;:/g;
    s/o:o;/o;;/g;
    s/o:o; /o;</g;

    # Bitstream's Cyberbit font offers 57 of the other 466 optional
    # ligatures in the U+FB50 Arabic Presentation Forms-A block:

    s/o;"o:/o0/g;
    s/o;2o;/o02/g;
    s/o:o;/o0?/g;
    s/o:"o;/o1
    s/o:&o;/o1/g;
    s/o;"o;/o1/g;
    s/o;0o;/o1/g;
    s/o;2o;/o1/g;
    s/o;"o;'/o1/g;
    s/YY/o1/g;
    s/Y
Y/o1/g;
    s/YY/o1 /g;
    s/YY/o1!/g;
    s/YY/o1"/g;
    s/o:.o:/o1*/g;
    s/o;&o:/o1-/g;
    s/o;2o:/o1//g;
    s/o:.o:/o10/g;
    s/o;&o:/o13/g;
    s/o;2o:/o15/g;
    s/o;2o;(/o2/g;
    s/o:.o;4/o2/g;
    s/o;&o;4/o2/g;
    s/o: o:/o2/g;
    s/o:$o:/o2/g;
    s/o:(o:/o2/g;
    s/o;$o:/o2/g;
    s/o: o:/o2!/g;
    s/o:$o:/o2"/g;
    s/o:(o:/o2#/g;
    s/o;$o:/o2$/g;
    s/o;$o:/o2&/g;
    s/o;$o:/o2(/g;
    s/o;$o:#/o2*/g;
    s/o;$o:'/o2,/g;
    s/o;$o:3/o20/g;
    s/o: o;/o3	/g;
    s/o:$o;/o3
    s/o:(o;/o3/g;
    s/o;$o;/o3/g;
    s/o;,o;/o3
/g;
    s/o: o;#/o3/g;
    s/o:$o;#/o3/g;
    s/o:(o;#/o3/g;
    s/o;$o;#/o3/g;
    s/o: o;'/o3/g;
    s/o:$o;'/o3/g;
    s/o:(o;'/o3/g;
    s/o;$o;'/o3/g;
    s/o: o;3/o3/g;
    s/o:$o;3/o3/g;
    s/o:(o;3/o3/g;
    s/o;$o;3/o3/g;
    s/o:$o;$o;/o6/g;
    s/o;*o; o;o:
/o72/g;
    s/o;"o; o:3o;-/o;*o;4o; o;/g;
    s/o;*o;o:o; o:/o;o:/g;

    print "$_\n";
}

# The following table lists the presentation variants of each
# character.  Each value from the U+0600 block means that the
# necessary glyph variant has not been assigned a code in Unicode's
# U+FA00 compatibility zone.  You may want to insert your private
# glyphs or approximation glyphs for them:

__END__
X!	o:
X"	o:o:
X#	o:o:
X$	o:o:
X%	o:o:
X&	o:	o:
X'	o:
o:
X(	o:o:o:o:
X)	o:o:
X*	o:o:o:o:
X+	o:o:o:o:
X,	o:o:o: o:
X-	o:!o:"o:$o:#
X.	o:%o:&o:(o:'
X/	o:)o:*
X0	o:+o:,
X1	o:-o:.
X2	o:/o:0
X3	o:1o:2o:4o:3
X4	o:5o:6o:8o:7
X5	o:9o::o:<o:;
X6	o:=o:>o;
X7	o;o;o;o;
X8	o;o;o;o;
X9	o;	o;
X:	o;
o;o;o;
Y
Y	o;o;o;o;
Y	o;o;o;o;
Y	o;o;o;o;
Y	o;o;o; o;
Y	o;!o;"o;$o;#
Y	o;%o;&o;(o;'
Y	o;)o;*o;,o;+
Y	o;-o;.
Y		o;/o;0 // o/)o/(
Y
Y1	o- // o-
Y2	Y2Y2
Y3	Y3Y3
Y4	Y4
Y5	Y5Y5
Y6	Y6Y6
Y7	o/Y7
Y8	Y8Y8Y8Y8
Y9	o-&o-'o-)o-(
Y:	o-o-o-!o- 
Y;	o-o-o-o-
Y<	Y<Y<Y<Y<
Y=	Y=Y=Y=Y=
Y>	o-o-o-o-
Y?	o-"o-#o-%o-$
Z
Z	ZZZZ
Z	ZZZZ
Z	o-6o-7o-9o-8
Z	o-2o-3o-5o-4
Z	ZZZZ
Z	o-:o-;o-=o-<
Z	o->o-?o.o.
Z	o.o.	
Z		Z	Z	
Z
Z	ZZ
Z	o.o.
Z
	o.o.
Z	o.o.
Z	ZZ
Z	ZZ
Z	o.o.
Z	ZZ
Z	ZZ
Z	ZZ
Z	ZZ
Z	ZZ
Z	ZZ
Z	o.
Z	ZZ
Z	ZZZZ
Z	ZZZZ
Z	ZZZZ
Z	ZZZZ
Z	ZZZZ
Z	ZZZZ
Z 	Z Z Z Z 
Z!	Z!Z!Z!Z!
Z"	Z"Z"Z"Z"
Z#	Z#Z#Z#Z#
Z$	o-*o-+o--o-,
Z%	Z%Z%Z%Z%
Z&	o-.o-/o-1o-0
Z'	Z'Z'Z'Z'
Z(	Z(Z(Z(Z(
Z)	o.o.o.o.
Z*	Z*Z*Z*Z*
Z+	Z+Z+Z+Z+
Z,	Z,Z,Z,Z,
Z-	o/o/o/o/
Z.	Z.Z.Z.Z.
Z/	o.o.o.o.
Z0	Z0Z0Z0Z0
Z1	o.o.o.o.
Z2	Z2Z2Z2Z2
Z3	o.o.o.o.
Z4	Z4Z4Z4Z4
Z5	Z5Z5Z5Z5
Z6	Z6Z6Z6Z6
Z7	Z7Z7Z7Z7
Z:	o.o.Z:Z:
Z;	o. o.!o.#o."
Z<	Z<Z<Z<Z<
Z=	Z=Z=Z=Z=
Z>	o.*o.+o.-o.,
[
[	o.&o.'o.)o.(
[	[[
[	[[
[	[[
[	o/ o/!
[	o/o/
[	o/o/
[	o/o/
[		o/"o/#
[
[	o/o/
[	o/<o/=o/?o/>
[
	[
[
[	[[[[
[	o/$o/%o/'o/&
[	[[[[
[	[[
[	[[
[	[[
[	[[
[	[[
[	[[
[	[[
[		[	[	
[
[	[[
[	[[[[
[
	[
[
[	[[[[
[	[[[[
[	[[[[
[	o..o./
[	o.0o.1
[	[
b




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

Date: 19 Jun 1998 04:52:22 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: C/XS code to accept oddball Perl constructs?
Message-Id: <6mcqq6$41q$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Ken Fox
<kfox@pt0204.pto.ford.com>],
who wrote in article <6mce6l$hk91@eccws1.dearborn.ford.com>:
> >     if (SvROK(psvBase) && (SvTYPE(psvBase) == SVt_RV))
> >     {
> 
> This just checks psvBase (twice) to see if it's a reference.  You need
> to check to see if it's an *array* reference.  Use this instead:

Wrong.  (SvTYPE(psvBase) == SVt_RV) has nothing to do with psvBase
being a reference (*).  In fact has nothing to do with anything, so it is
wise to remove it (the result is garbage from Perl point of view), as
you did:

>   if (SvROK(psvBase) && (SvTYPE(SvRV(psvBase)) == SVt_PVAV))

PVAV isn't polymorphic, so it *has* sense to check that the type is
*equal* to SVt_PVAV.

Hope this helps,
Ilya

(*) RV is polymorphic, so ROK stuff may be RV, PV or anything starting
from PVIV (well, possibly with exceptions of PVAV and friends, but I
would not be sure).


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

Date: Thu, 18 Jun 1998 19:56:07 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Ctrl+C disable in perl program
Message-Id: <MPG.ff37324b78246ed9896a4@nntp.hpl.hp.com>

In article <3589A4E8.27E9A1F5@inet.net>, Li Xiaoning 
<lxn@inet.net>says...
> I am writing a system configuration program in perl, I want to disable
> control+C in program. appreciate for any idea on that.

If you mean to ignore interrupts, you might try

$SIG{INT} = 'IGNORE';

Look for %SIG in `perldoc perlvar`.

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 19 Jun 1998 03:44:02 GMT
From: schilli@tep.e-technik.tu-muenchen.de. (Michael Schilli)
Subject: Re: Ctrl+C disable in perl program
Message-Id: <6mcmq2$h97$1@sparcserver.lrz-muenchen.de>

Li Xiaoning (lxn@inet.net) wrote:
> I am writing a system configuration program in perl, I want to disable
> control+C in program. appreciate for any idea on that.

$SIG{'INT'} = IGNORE;

disables handling of the SIGINT signal and so prevents your script from 
reacting to ^C.

--
Michael 

--------------------------------------------------------------------------
  Michael Schilli            More Info:   http://mission.base.com/mschilli
--------------------------------------------------------------------------


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

Date: 19 Jun 1998 01:15:39 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: exception handlng with eval
Message-Id: <6mcs5r$ga2$1@monet.op.net>


In article <6mbmuk$8c2$1@news.bctel.net>,
Bing Ran <bing_ran@bc.sympatico.ca> wrote:
>Why does the following code not work?

Worked for me too.  Try changing this:
>    print $@, "\n";

to this:

>    print "Caught exception: ", $@, "\n";

That might make it clearer what happened.

Perhaps your confusion is that you were expecting it to report the
exception as having occurred at line 7 or 11, instead of line 3?



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

Date: 19 Jun 1998 02:56:04 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: gurusamy vs activeware perl nt
Message-Id: <6mck04$qek$1@comdyn.comdyn.com.au>

In article <3588e00b.0@news.lamine.com>,
	"no" <no@no.no> writes:
> What is the difference between gurusamy perl nt version and activeware
> version of perl nt ?

Why don't you have a look at http://www.perl.com/win32desc.html?

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Hi, Dave here, what's the root
Commercial Dynamics Pty. Ltd.       | password?
NSW, Australia                      | 


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

Date: Thu, 18 Jun 1998 22:25:49 -0500
From: Deva Seetharam <psdspss@execpc.com>
Subject: Re: Help combining two files.
Message-Id: <6mcl87$kj0@newsops.execpc.com>

steve wrote:

> Hi,
> I am working on a Usenet utility and have run into a problem. I have two files
> that contain complete and/or partial newsgroups names that I use to set
> restrictions for users. The format of the files are as follows:
>
> alt.*,!alt.comp.*,alt.comp.unix.*,!alt.comp.unix.bsd
>
> which says a user can read anything in the alt hierarchy except alt.comp, but
> can read anything in alt.comp.unix except alt.comp.unix.bsd.
>
> The problem is I need to combine these files into one and need to ensure the
> ordering of these is done correctly. So if one file contains alt.* and the
> other contains !alt.comp.* the order appears correctly. The program wont
> function correctly if these are out of order.
>
> Could someone please help me get started with this, I just can't find a good
> starting point. Any help is greatly appreciated.
>
> -steve.

I was just wondering, what if you could prepare a list of forbidden newsgroups,
and prevent the user(s) from accessing those newsgroups.

1. Read the files.
2. Prepare a list of forbidden newsgroups by selecting the ones
    that are preceded by '!'.
3. Check whether the requested newsgroup is in the forbidden list.
    If so, prevent access.

This method does not require any sorting to be done.

Hope this helps.
Deva

PS:-    I apologize if I had not understood the problem properly,
and suggesting a stupid solution.





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

Date: Fri, 19 Jun 1998 02:54:24 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: How do you pre-append using "open"
Message-Id: <Pine.GSO.3.96.980618195259.17544J-100000@user2.teleport.com>

On Fri, 19 Jun 1998, Nick Forte wrote:

> I'm trying to pre-append a record to a flat file. I want the record to
> be inserted on the first line everytime instead of appending it to the
> end. Can someone help me?

Section five of the FAQ has an entry on this oxymoronic notion of
"appending to the beginning" of a file. Hope this helps! 

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



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

Date: Thu, 18 Jun 1998 23:13:01 -0500
From: Deva Seetharam <psdspss@execpc.com>
Subject: Re: How do you pre-append using "open"
Message-Id: <6mco0n$kj0@newsops.execpc.com>



Nick Forte wrote:

> I'm trying to pre-append a record to a flat file. I want the record to
> be inserted on the first line everytime instead of appending it to the
> end. Can someone help me?
>
> Thanks!

You need to seek the first position of the file, write your
record and then write the original records of the file.
As the following snippet does :

#! /usr/local/bin/perl

#Open the file in **read/write** mode.
open (IN, "+<data") or die "Could not open the file : $!";

#Preserve the original records.
@records = <IN>;

# Record to be inserted.
$insert = "1 1 1";

#Go to the beginnig of file.
seek(IN, 0, 0);

# Write the new record and then the original.
print IN "$insert\n";
print IN @records;

close (IN) or die "Could not close the file : $!";

*********************************
Hope that helps.




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

Date: 19 Jun 1998 03:04:19 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: mkdir MODE problem
Message-Id: <6mckfj$qek$3@comdyn.comdyn.com.au>

In article <6mbn2u$8ps$1@nnrp1.dejanews.com>,
	marius77@my-dejanews.com writes:
> I have a script that creates several new directories, but I'm having trouble
> with the permissions.  I need them to be either
> 
> drwxrwxrwx or drwxr_xrwx and I currently have a umask of 002.

Use a chmod after the mkdir

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


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

Date: Fri, 19 Jun 1998 13:08:41 +1000
From: "Gary R. Schmidt" <grs@pfxcorp.com>
To: Rahul Dhesi <c.c.eiftj@98.usenet.us.com>
Subject: Re: ohsir.pl : suggestive perl poem
Message-Id: <3589D639.A685C0A0@pfxcorp.com>

Rahul Dhesi wrote:
> 
> #! /usr/local/bin/perl
> # (c) Copyright Rahul Dhesi 1998; permission granted to copy provided
> # this copyright statement is preserved.
> # I claim no copyright over the output, only over the perl code.
> # WARNING:  The output is a suggestive poem suitable for adults.
> 
> for ($line = "oh sir please don't touch me"; $count++ < 8; ) {
>    print $line, " ...\n"; $line =~ s/ \S+$//; sleep 3; }
> # end
Actually, I find:
	for ($line = "oh sir please do not touch me"; $count++ < 8; ) {
	   print $line, " ...\n"; $line =~ s/ \S+$//; sleep 3; }
for more amusing!

	Cheers,
		Gary	B-)
-- 
---------------------------------------------------------------------------
Gary R. Schmidt         at Work: grs@pfxcorp.com

			POWERflex Corporation	Developers of PFXplus
			Vox:  +61 3 9888 5833   Fax:  +61 3 9888 5451

			Visit our Web Site:           www.pfxcorp.com

NOTE:	All opinions are mine, and bear no necessary relation to those
	held by my employers.

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


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

Date: Fri, 19 Jun 1998 03:08:02 +0200
From: Kay Molkenthin <molkiheg@sp.zrz.tu-berlin.de>
Subject: Perl on Linux access database on NT 4?
Message-Id: <3589B9F2.5C436D64@sp.zrz.tu-berlin.de>

Hi,

I just finished my diploma application on NT 4. It uses a GUPTA
SQL-Server. For some upcoming apps to my program I would like to build
them on Linux with perl because except this diploma app I only work on
Linux myself.

Is it possible to access this GUPTA-Server and its databases from a
Linux computer over LAN with perl. I need that to generate some
HTML-pages/forms which include informations from that Gupta-databases.

Kay.
-- 
Kay Molkenthin   -   Ruesternallee 45   -   14050 Berlin [GERMANY]
Email:  molkiheg@sp.zrz.tu-berlin.de  /  Kay_Molkenthin@Bigfoot.de
------------------------------------------------------------------
Key fingerprint = A6 1E 73 E7 E7 77 75 E1  7C E6 EF AF 78 A6 6C 38


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

Date: Fri, 19 Jun 1998 14:17:06 +1000
From: "Matt Eckhaus" <matt2@lonelyplanet.com.au>
Subject: Perl standard distribution and IIS 4
Message-Id: <3589e5a4.0@news.syd.att.net.au>

Does anbody have any information about running the Perl standard
distribution (5.004_02) with Internet Information Server 4.0? I can't get
IIS 4 to run my Perl scripts at all...

I have heard that PerlIS from ActiveState works, but I need Perl 5.004,
which means I need the standard distribution. I haven't yet heard of anybody
doing this.

Any help would be very much appreciated...

Matt Eckhaus
matt2@lonelyplanet.com.au




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

Date: Fri, 19 Jun 1998 11:40:23 -0400
From: "Nathan Weston" <nathanw@post1.com>
Subject: Problem with references
Message-Id: <3589dda0.0@oit.umass.edu>

I'm a complete newbie to Perl (I started learning about 3 days ago), and
I've run into a problem using references. Basically, I have a reference to
an associative array, every element of which contains a reference to another
associative array. I am able to get data into this array, but I can't figure
out the syntax to access elements of the inner arrays. Can anyone help with
this?

Nathan




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

Date: Fri, 19 Jun 1998 04:41:06 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Problem with references
Message-Id: <Pine.GSO.3.96.980618211924.17544P-100000@user2.teleport.com>

On Fri, 19 Jun 1998, Nathan Weston wrote:

> I'm a complete newbie to Perl (I started learning about 3 days ago), and
> I've run into a problem using references.

References are perhaps a little complex for your fourth day, but maybe you
have experience with similar things in other languages. 

> Basically, I have a reference to an associative array,

It may seem picky, but these days we call it a "hash". People look at you
funny if you use old terminology, just as if you told us you had the
grippe. :-)

> every element of which contains a reference to another associative
> array. I am able to get data into this array, but I can't figure out the
> syntax to access elements of the inner arrays. Can anyone help with
> this? 

The manpages perlref, perllol, and especially perldsc should be helpful
here. Good luck!

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



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

Date: 19 Jun 1998 01:04:14 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Problem with references
Message-Id: <6mcrge$g8n$1@monet.op.net>
Keywords: Epiphany frill pecan poesy


In article <3589dda0.0@oit.umass.edu>, Nathan Weston <nathanw@post1.com> wrote:
>Basically, I have a reference to
>an associative array, every element of which contains a reference to another
>associative array. 

We like to say `hash' instead of `associative array', because that
saves ten million syllables a year.

Suppose $x is a reference to a hash.  Then $x->{FOO} is the value
associated with FOO in the hash.

Now, suppose that value is itself a reference to a hash.  Then you might use:

	$subhash_ref = $x->{FOO};
	$result      = $subhash_ref->{BAR};

Of course, the temporary variable is unnecessary:

	$result      = $x->{FOO}->{BAR};

Perl has a rule that in between subscripts like {FOO} and {BAR}, you
can omit the -> without changing the meaning of the expression, so
most people would write

	$result      = $x->{FOO}{BAR};

However, you can't omit the -> between $x and {FOO}.
(Exercise: Why not?)

I hope this is what you wanted to know.



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

Date: 19 Jun 1998 09:26:28 +0930
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: Re: regex terminator not allowed in comment in extended regex?
Message-Id: <r8d8c68dsj.fsf@asc.sps.mot.com>

Tom Phoenix <rootbeer@teleport.com> writes:
[...]
> You have to parse the pattern at compile time, but you may not know about
> /x extensions, comments, or other contents until runtime. So the solution
> seems to be the status quo. 

Off line (before I got to see all this good discussion) Ilya persuaded
me of the same: you can't hope to know whether an RE is extended or
not at compile time, so you have to identify the bounds of the RE
*before* stripping out comments.

The most interesting (and embarrassing) thing is that perl does a
pretty good job already of telling you what is going on.  In amongst
the false error messages caused by my improperly terminated regex,
Perl said:

 syntax error at /home/mgregory/bin/foo.pl line 15, near "(."
  (Might be a runaway multi-line // string starting on line 13)

If I had read that properly, it would have been a good clue to what
I'd done wrongly.  Unfortunately, I read it as the ubiquitous 'runaway
mutli line string' error message, and went looking for that type of
thing.  Then I complained!  How embarrasment.

I'd just come to the conclusion that the answer might be to make the
above message just different enough to the "usual" 'runaway multi line
string' message, and was considering offering a patch for that, when I
discovered that I can't provoke that "usual" message at all.  I'd
swear that perl used to say something extremely similar to the above
message when a normal string is unterminated, but now I can only make
it say:

 Can't find string terminator '"' anywhere before EOF at /home/mgregory/bin/foo.pl line 6.

 .. which is an excellent message.

So now I'm wondering whether someone has brilliantly fixed all this up
recently and hence 

syntax error at /home/mgregory/bin/foo.pl line 15, near "(."
  (Might be a runaway multi-line // string starting on line 13)

is now guaranteed to be the more tricky type of problem?

Or maybe I was just off the planet the whole time, in which case sorry
for the disturbance (luckily the resulting discussion did turn out to
be interesting anyhow!)

Cheers,

Martin.






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

Date: Fri, 19 Jun 1998 03:54:14 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Sick things to do in foreach loops
Message-Id: <Pine.GSO.3.96.980618204625.17544N-100000@user2.teleport.com>

On 18 Jun 1998, Peter Scott wrote:

> I had a reason to want to extend the list in a foreach loop, and
> to my pleasant surprise, I found that I could actually push elements
> onto the end of the list while in the loop and still have the loop
> iterate over them.  

Of course, this is undocumented behavior and may be different in a future
(or even current!) version of perl. 

> This made me curious; how does Perl keep track of where it is in the
> list if the list can change during the loop?

It's not how Perl (the language) does it; it's how perl (the
implementation) does it that matters. So the answer is not in the docs.
Use the Source, Luke. :-)

> Segmentation fault (core dumped)

That's what happens when you pull the rug out from under perl. :-)  But if
you do investigate the source, you may find out why this happened and how
to prevent it in the future. That would be an improvement, so I'm looking
forward to seeing your patch. :-)

Cheers!

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



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

Date: Fri, 19 Jun 1998 03:43:01 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: the ?PATTERN? match syntax
Message-Id: <Pine.GSO.3.96.980618203215.17544M-100000@user2.teleport.com>

On Fri, 19 Jun 1998 topher67@my-dejanews.com wrote:

> The match syntax "?PATTERN?" is very useful 

As the Camel book says, most people just bomb out of the loop (say, with
'last') when they get the match they want. Do you find yourself frequently
using some algorithm in which that is not a good way to handle it? 

> an additional option should be added to the match operator which does
> the same thing as "?PATTERN?", perhaps "f".  Then you could do something
> like "/(?f)PATTERN/". 

I wouldn't go so far as to say that this would be useless, but it doesn't
strike me as something to place highly on the to-do list. In addition, I
believe that it would be somewhat difficult to implement. Can you give an
example of a task for which an embedded option like this would be one of
the best ways to handle the job? 

Cheers!

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



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

Date: 19 Jun 1998 01:08:49 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: the ?PATTERN? match syntax
Message-Id: <6mcrp1$g9d$1@monet.op.net>


In article <6mce3p$96f$1@nnrp1.dejanews.com>,
 <topher67@my-dejanews.com> wrote:
>The match syntax "?PATTERN?" is very useful and should *not* be removed from
>perl.

OK.  Why?

I'm not trying to start an argument; I'm really curious.  A few months
ago I tried to make a list of the least-known and littlest-used Perl
features.  I polled some experienced Perl programmers for advice.
When I mentioned ?PATTERN? to them, most of them didn't know what I
was referring to.

When is ?...? useful?  What do you do with it?



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

Date: 19 Jun 1998 06:39:25 GMT
From: Yasir Khalifa <khalifa@blitz.cs.pitt.edu>
Subject: Writing to a file on the same line
Message-Id: <6md12t$s9r$1@usenet01.srv.cis.pitt.edu>

Hi: This might be very trivial, but I would appreciate any help! I am 
writing some attributes and their values (on clicks) to a file. 
The writing is done through multiple web pages. Within one page, the
the cgi can easily write the attributes and their values in one line.
But once I go to the next page, it writes on a new line. Below is a sketch:

# IN page1: the code below writes attributes/vals to a file...
print "
Name \t\t Date \t\t SSN \t Birthdate   # static attributes
$in{'First'} $in{'Middle'} $in{'Last'} \t $sub_date_time \t $in{'SSN'} ";

#In Page2: I want to add the value of the attribute Birthdate (above)
#NEXT to the value of SSN. The code for writing in page2 is:

#open the same file from page1
print "
\t $in{'BDate'}  ";

So far No luck, it keeps writing it on a new line....
The final output should look like:

Name            Date            SSN             Birthdate
John Doe        6/18/98         999999999       January 27, 1998
                                                ^^^^^^^^^^^^^^^^^
                                        this value from pag 2 should be
                                        written here and not on a new line
Any help is appreciated,
-Yasir


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

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

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