[8371] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1988 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 27 22:15:16 1998

Date: Fri, 27 Feb 98 19:00:27 -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           Fri, 27 Feb 1998     Volume: 8 Number: 1988

Today's topics:
    Re: "Or" Operator? (Jonathan Feinberg)
        "PERL" puzzle. <kevin@wx3.com>
    Re: "PERL" puzzle. <uri@sysarch.com>
        Advice on good CGI Form CONTENT <winter@mot.com>
    Re: AIX 4.3 vs. perl5.004_04: won't build <morrow@cheetah.spots.ab.ca>
        ANNOUNCE: Curses 1.02 is released <wsetzer@unity.ncsu.edu>
        ANNOUNCE: jdb, flat-ascii database functions for shell  johnh@ISI.EDU
    Re: Creating new files. NOBODY? <zenin@best.com>
    Re: dbm file format? <ap958@chebucto.ns.ca>
        getservbyname('smtp','tcp') Problem (Michael Fischer)
    Re: How do you put a string into a array? (John Stanley)
    Re: IP-Address in Perlscripts <Matthew.Healy@yale.edu>
    Re: Killfile Triage (John Stanley)
        Looking for a program called 'Brief' (Sanjay Sinha)
    Re: Matching with the //o option (Jonathan Feinberg)
    Re: Musings on English.pm (Ilya Zakharevich)
        Perl on Win95 not working (newbie question) and flip /' <sb67@dial.pipex.com>
        QUIZ: what good is this code? <uri@sysarch.com>
        Searching for a string! <miller@bigsky.net>
    Re: Searching for a string! (Mike Stok)
    Re: seeking and changing /etc/passwd <shankeyp@charlestoncounty.org>
    Re: seeking and changing /etc/passwd <shankeyp@charlestoncounty.org>
        Setting security attribs for registry keys? <taautry@ti.com>
    Re: The Ineffable Tom C. (Nathan V. Patwardhan)
        The Perl Journal #9, table of contents (Jon Orwant)
    Re: What does this one-liner do? <mconty@year.grain.cargill.com>
    Re: What does this one-liner do? <mconty@year.grain.cargill.com>
    Re: Why doesn't "tr/\x0D//d" work? (Tom Grydeland)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 27 Feb 1998 10:39:30 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: "Or" Operator?
Message-Id: <MPG.f60a841de4b914f989749@news.concentric.net>

abigail@fnx.com said...
:     !($var1 ne 'value1'  ||   $var1 ne 'value2')   ==    (Morgan's law)
:     !($var1 ne 'value1') && !($var1 ne 'value2')   ==
:       $var1 eq 'value1'  &&   $var1 eq 'value2'

I knew that discrete math course would come in handy some day.

-- 
Jonathan Feinberg         jdf@pobox.com        Sunny Brooklyn, NY


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

Date: Fri, 27 Feb 1998 12:27:28 -0500
From: "Kevin J. Lin" <kevin@wx3.com>
Subject: "PERL" puzzle.
Message-Id: <34F6F780.11FF437B@wx3.com>

(This is a puzzle, not a real PERL question; if you don't like puzzles
skip to the next post.  Knowlege of PERL and or Unix will be helpful,
but not required to solve it.)

I've been porting something to PERL and am almost done.  But I've had
some problems with it.  Here are my questions:

1) What am I trying to port?

2) Can you provide a line-by-line transcript of the original source?

3) What code could I use to fill in the blanks (marked by "????????") If
you can think of better code for any other section, I'd like to see it.

Here's the code:

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

#!/usr/bin/perl

&lv($i,my($self));

$want=&lv($u,$me);

if ($i<0){
	$want=++$me;
}

grep my($self)/$me;
$want=(grep $u/$me);

if(unlink $me){
	$want=alarm $me;
}

$want=~ tr/$u/ /c;

if ($thinking=$u){
	utime time, time, my($self);	
}

$want=~ tr/$u/ /c;

#o!o!o!

bless($me,$u);
??????????????
??????????????
$want=my($u);      
 
CLOSE(my($i)); CLOSE(my($i)); 
see you before me
if ($u eq 'IGNORE'){
	die $i;
}

??????????????
??????????????
while ($i>$knees){
	--$i;
}
for (;$u==$u;){
	do (anything.pl)
}

$want=~ tr/$u/ /c;

if ($thinking=$u){
	utime time, time, my($self);	
}

$want=~ tr/$u/ /c;

#o!o!o! (yeah)

&lv($i,my($self));

$want=&lv($u,$me);

if ($i<0){
	$want=++$me;
}

grep my($self)/$me;
$want=(grep $u/$me);

if(unlink $me){
	$want=alarm $me;
}

$want=~ tr/$u/ /c;

if ($thinking=$u){
	utime time, time, my($self);	
}

$want=~ tr/$u/ /c;

#o!o!o!

$want=$u;
$want=~ tr/$u/ /c;

if ($thinking=$u){
	utime time, time, my($self);	
}
 
#oo ooo ooooo 

for($i=0;i<8;++i){;}

$want=~ tr/$u/ /c;

if ($thinking=$u){
	utime time, time, my($self);	
}

$want=~ tr/$u/ /c;

if ($thinking=$u){
	for ($i=0;i<14;++i){
		utime time, time, my($self);	
	}
}


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

Remember, this is a puzzle.  Think laterally. 
Don't bother trying to run it.  

Kevin Lin
kevin@wx3.com
The Grey Labyrinth
http://www.wx3.com/labyrinth/


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

Date: 27 Feb 1998 14:11:16 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: "PERL" puzzle.
Message-Id: <x7afbc278r.fsf@sysarch.com>

"Kevin J. Lin" <kevin@wx3.com> writes:

> (This is a puzzle, not a real PERL question; if you don't like puzzles
> skip to the next post.  Knowlege of PERL and or Unix will be helpful,
> but not required to solve it.)
> 
> I've been porting something to PERL and am almost done.  But I've had
> some problems with it.  Here are my questions:
> 
> 1) What am I trying to port?
> 
> 2) Can you provide a line-by-line transcript of the original source?
> 
> 3) What code could I use to fill in the blanks (marked by "????????") If
> you can think of better code for any other section, I'd like to see it.

it is obviously (to me) some type of song lyrics, fro al the love, want,
ooo, etc. i can't figure out the song, tho.

uri

-- 
Uri Guttman                     SYStems ARCHitecture and Software Engineering
uri@sysarch.com                                          Have Perl, Will Hack
http://www.sysarch.com                (781) 643-7504 x*2  FAX: (781) 643-2710
Try the Best Search Engine on the Net -------->  http://www.northernlight.com


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

Date: Thu, 26 Feb 1998 12:18:25 -0600
From: Eric Winter <winter@mot.com>
Subject: Advice on good CGI Form CONTENT
Message-Id: <34F5B1F1.F8B546F9@mot.com>

Making the form is trivial my question is what are the guidelines
for writing a good one.

I'm looking for some common sense guidelines when writing the 
standard: send me your name/phone/address CGI form.  

There are lots of 
lousy forms out there.  Forms that ask too much and reject
an input if certain fields are not filled out, etc.  What
I'd like the the advice of someone whose done about 100 of these
silly forms whose made some mistakes which in retrospect seem
trivial and obvious, but didn't when writing their first.


Do:
e.g.: separate first and last names into two fields so it's easy
to figure out which is which.

Include at least (at most?) 2 lines for the address.


Don't:

forget Ms. as a possible title

require ansewers to 50 or more questions


Don't write output to a publicly readable file(?)



Any intelligent advice is welcome



Eric Winter


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

Date: 27 Feb 1998 17:15:01 GMT
From: William Morrow <morrow@cheetah.spots.ab.ca>
Subject: Re: AIX 4.3 vs. perl5.004_04: won't build
Message-Id: <6d6sal$6b1$1@f02s02.tac.net>

ksimpson@ryland.com wrote:
: There is a smit installable version of Perl5.004_4 at
: http://www-frec.bull.com/ if you don't need to build
: it yourself.

It built, eventually. I had to mess with dl_aix.xs, to bypass missing #defines
of FSEEK, FREAD and BEGINNNING in AIX 4.3 /usr/include/ldfcn.h.

Could the AIX version be built with dl_dlopen.xs (suitably modified)? 
AIX has dlopen() now.


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

Date: 27 Feb 1998 16:11:25 GMT
From: William P Setzer <wsetzer@unity.ncsu.edu>
Subject: ANNOUNCE: Curses 1.02 is released
Message-Id: <6d6ojd$kh4$1@news1.teleport.com>

This is a dynamic loadable curses module for perl5.  You can get this
package at any CPAN archive.

I have not had time to heavily test this; it compiles under Solaris
and SunOS.  Please let me know if there are compile troubles on
other platforms.

New in 1.02:

  o The constants OK and ERR were switched!  They should give the
    right values now.  (Doesn't anyone check their return codes? :-)

  o Rename of Curses.h to pCurses.h for case-impaired systems.

  o New functions supported:  newterm, set_term

  o New hints for BSDOS, BSD386, OS2, and MSWin32(!).

  My thanks to the people who provided the above information.  They're
  listed in the README in the package, but not here, as a courtesy to
  any that might be spam-address-harvester-sensitive.


William




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

Date: 27 Feb 1998 16:07:52 GMT
From: johnh@ISI.EDU
Subject: ANNOUNCE: jdb, flat-ascii database functions for shell scripting
Message-Id: <6d6oco$kbd$1@news1.teleport.com>

JDB is package of commands for manipulating flat-ASCII databases from
shell scripts.  JDB is useful to process medium amounts of data (with
very little data you'd do it by hand, with megabytes you might want a
real database).  JDB is very good at doing things like:

	- extracting measurements from experimental output
	- re-examining data to address different hypotheses
        - joining data from different experiments
	- eliminating/detecting outliers
	- computing statistics on data (mean, confidence intervals, histograms)
	- reformatting data for graphing programs

Rather than hand-code scripts to do each special case, JDB provides
higher-level functions.  Although it's often easy throw together a
custom script to do any single task, I believe that there are several
advantages to using this library:

	- these programs provide a higher level interface than plain Perl
		=> dbrow '_size == 1024' | dbstats bw
		   rather than:
			while (<>) { split; $sum+=$F[2]; $ss+=$F[2]^2; $n++; }
			$mean = $sum / $n; $std_dev = ...
			etc.
		   in dozens of places

	- the library uses names for columns
		=> no more $F[2], use _bw
		=> new or different order columns?  no changes to your scripts!

	- the library is self-documenting (each program records what it did)
		=> no more wondering what hacks were used to compute the
			final data, just look at the comments at the end
			of the output

	- unusual cases and error checking are already handled
		=> custom scripts often skimp on error checking

(The disadvantage is that you need to learn what functions JDB provides.)

JDB is built on flat-ASCII databases.  By storing data in simple text
files and processing it with pipelines it is easy to experiment (in
the shell) and look at the output.  The original implementation of
this idea was /rdb, a commercial product described in the book ``UNIX
relational database management: application development in the UNIX
environment'' by Rod Manis, Evan Schaffer, and Robert Jorgensen (and
also at the web page <http://www.rdb.com/>).  JDB is an incompatible
re-implementation of their idea without any accelerated indexing or
forms support.  (But it's free!).

Installation instructions follow at the end of this document.  JDB
requires Perl 5.003 to run.  There are no man pages currently, but
each command has a complete description in its usage string.  All
commands are backed by an automated test suite.

The most recent version of JDB is available on the web at
<http://www.isi.edu/~johnh/SOFTWARE/JDB/index.html>.

   -John Heidemann
    11-Feb-98




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

Date: 27 Feb 1998 16:08:29 GMT
From: Zenin <zenin@best.com>
Subject: Re: Creating new files. NOBODY?
Message-Id: <888596061.302669@thrush.omix.com>

dylan <sylan@spamnet.yahoo.com> wrote:
: I'm having a problem with perl as I try to create new files. The script runs 
: under User NOBODY thus files created are not world read/writeable. Is there a 
: way to have perl create files owned by the current user (ie not NOBODY) other 
: than using cgiwrap?

	man perlsec

	Search for 'setuid'.  This is a Unix issue, not a perl issue so
	exactly what a "set UID script" is may not be fully explained except
	for any perl only parts. -Eg, "taint" issues and such.

-- 
-Zenin
 zenin@best.com


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

Date: Fri, 27 Feb 1998 13:20:46 -0400
From: Jason Nugent <ap958@chebucto.ns.ca>
To: Kevin B Cohen <kcohen@julius.ling.ohio-state.edu>
Subject: Re: dbm file format?
Message-Id: <34F6F5EE.67B07A9C@chebucto.ns.ca>

    The files are created  using the dbmopen() command.  Something like
this:

 dbmopen(%ARRAYNAME,"db_filename",0644) or die "cannot open or create:
:$!";

 this will either open the file or create a new one if it doesn't already
exist.  You don't create them by hand since they aren't straight text
files.
    This is explained quite well in Learning Perl, the Camel Book, and the
manpages.  Besides, dbmopen is obsolete now.  Use tie instead.
                    Jason


Kevin B Cohen wrote:

> hi,
>
> having looked in the blue camel, and the blue llama, and sniffed about
> in the man pages/faq's, i can't quite figure out how you go about
> making the files that get used by the dbmXXX functions.  i read on the
> "Perl for Win32" faq's that "DBM files are "binary"", so i don't guess
> i'm just going to be creating a couple of text files..... do i need to
> write a script to do the initial creation of the files???
>
> kevin



--
---------------------
Jason Nugent, BSc(Hons), CWM
ap958@chebucto.ns.ca  "Beneath this canvas monochrome
Certified Webmaster  Wrapped in the shroud of this grey home
Member, HTML Writer's Guild I'll paint a picture all my own
Member, Webmaster's Guild I'll paint a picture"

Live to ride,
  Ride to Live.   -Anacrusis

********************************************************************
 The Best Place for Sport on the net! - Sportscience www.sportsci.org
********************************************************************




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

Date: Fri, 27 Feb 1998 17:58:51 GMT
From: mfischer@noet.at (Michael Fischer)
Subject: getservbyname('smtp','tcp') Problem
Message-Id: <34fdf91a.14885788@news.noet.at>

I have problems running the module Mail::Internet. When trying to find
the error it crystalised down to:

perl -e "print getservbyname('smtp','tcp');"

which returns
'Error: Runtime exception'

Am I using the getservbyname function incorrectly or is there
something wrong with my perl-distribution (build 312 by ActiveState
for Win32)?

Second question:
Can someone explain me the use of all those getserv*, gethost* and
getproto*... cause there isn't much (not to say nothing) in the PODs
nor the FAQ.
MFi
__
name:      Michael Fischer
email:     mfischer@noet.at
homepage:  http://www.geocities.com/CapeCanaveral/Lab/1288
perl:      @a=grep(s/9/-/||1,split('0',"7404309201098406501301050912"
           ."093013098204802101309609760720970208096013"));$b=0;for(
           @a){$b += $_;print pack('c*',$b);} print ',';


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

Date: 28 Feb 1998 01:17:32 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: How do you put a string into a array?
Message-Id: <6d7ojc$d6p$1@news.orst.edu>

In article <Ep1MnA.KHK@world.std.com>,
Andrew M. Langmead <aml@world.std.com> wrote:

 .modules removed from newsgroups.

>(Perl's arrays start counting at zero, not one. I know that perl is
>supposed to have more than one way of doing most things, but zero
>based arrays are so ingrained, fighting perl may not be worth it.)

Perl's arrays start counting at whatever you want them to start counting
at. Try perldoc perlvar.



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

Date: Fri, 27 Feb 1998 13:15:11 -0500
From: "Matthew D. Healy, Ph.D." <Matthew.Healy@yale.edu>
Subject: Re: IP-Address in Perlscripts
Message-Id: <6d6vr9$afe$1@news.ycc.yale.edu>

Martin Vorlaender wrote in message
<34f1daa7.524144494f47414741@radiogaga.harz.de>...
>100.191995@germanynet.de wrote:
>: If a Perlscript is called on a WWW-Server, is there any way to get the
>: IP-Address of the caller?
>
>For all you can get, have a look at the environment variables in the CGI
>specification at http://hoohoo.ncsa.uiuc.edu/cgi/env.html, and take
>further questions regarding CGI to comp.infosystems.www.authoring.cgi .

1. My own list of cgi variables can be found at
     http://ycmi.med.yale.edu/~healy/envlist.txt

2. Here's some VBscript ASP code that will show you most of the info
available on your system:

   <html>
   <head><title>ASP Form Test</title><head>
   <body>
   <H3>ASP Form Test</H3>
   First, we shall display the entire Server Variables collection:<p>
   <%
      DIM strCRLF
      strCRLF = CHR(13) & CHR(10)
      'We use this CRLF in many places below
   %>

   <pre>
   <%
      'Looping through all the server variables
      For Each ServerVariable In Request.ServerVariables
          strVariableName = ServerVariable
          strVariableValue = Request.ServerVariables(ServerVariable)
          Response.Write(strVariableName & " = " & strVariableValue &
strCRLF)
      Next
   %>
   </PRE>
   Next, we shall display the form contents, but the method used will
   depend upon how we called this script:<P>
   <pre>
   <%select case Request.ServerVariables("Request_Method")
   REM need to handle each method differently in ASP
      Case "GET"
            Response.Write("Called by GET<P>")
           'Looping through the QueryString collection
                For Each QueryVariable In Request.QueryString
                   strVariableName = QueryVariable
                   strVariableValue = Request.QueryString(QueryVariable)
                   Response.Write(strVariableName & " = " & strVariableValue
& strCRLF)
                Next
      Case "POST"
         Response.Write("Called by POST<P>")
           'Looping through the Form collection
                For Each FormVariable In Request.Form
                   strVariableName = FormVariable
                   strVariableValue = Request.Form(FormVariable)
                   Response.Write(strVariableName & " = " & strVariableValue
& strCRLF)
                Next
      Case ELSE
         'other request methods would go here if handled
         'for now just do nothing except complain
          Response.Write("ILLEGAL METHOD, NULL PARAMS<P>")
      end select
   %>
   </pre>
   End of Form.<p>
   </body>
   </html>

3. Here's a Unix CGI equivalent:

   #!/bin/sh
   echo "Content-type: text/plain"
   echo
   setenv






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

Date: 28 Feb 1998 01:22:57 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Killfile Triage
Message-Id: <6d7oth$fqf$1@news.orst.edu>

In article <slrn6fddna.42f.guckes@rudin.math.fu-berlin.de>,
Sven Guckes <guckes@math.fu-berlin.de> wrote:
>Now, what would happen if everyone just used a valid address?
>Noone would have to scan the complete article for clues.
>No loss of time.  Just followup/reply.  What a concept.

And spammers would have more valid addresses to send spam to, and more
people would have to spend time and money dealing with spam that
they otherwise would not, just because you MIGHT possibly at some time
in the future for some unknown reason want to send them email about
something that probably wasn't on-topic for the newsgroup anyway.



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

Date: 27 Feb 1998 18:25:27 GMT
From: sanjay@ssc.sas.upenn.edu (Sanjay Sinha)
Subject: Looking for a program called 'Brief'
Message-Id: <6d70en$3hk$1@netnews.upenn.edu>
Keywords: info request, brief software program



Greetings,

During the years 1990-91, i had a part time job (date entry) at a
linguistics lab.
There was a DOS program called 'BRIEF', which they used. Being myself, 
i simply could not resist playing around with it.

The features I can remember are
- it was a text editor.
- very powerful search/replace via 'regular expression'
- keystroke macros and immense level of customization.
- Create .exe applications for stand alone processing
- the company was based out of Boston.
- lady at tech support had a really se^Hweet voice.

Search engines and libraries are not of much help with a keyword like 'brief'.

Is that program still around? Evolve into another product?
Any info appreciated. 

thanks
sanjay


p.s. 
while PERL is perfect for my current needs, i don't know any programming
langauges and current books/manuals/faqs with [foo|bar|hello world]
is inappropriate for me.
any other reccomendations?

was hoping to brush up on regular expressions with this dos program while
i make my way thru the blue camel book.














-----
Sanjay Sinha            Resident of Washington D.C.
DoD #1224               Statistically speaking, i'm safer in Beirut.
CB 650 'The Cow'        Standard disclaimers apply.
VT 700C 'nonameyet'


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

Date: Fri, 27 Feb 1998 10:42:44 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Matching with the //o option
Message-Id: <MPG.f60a901e097e42a98974a@news.concentric.net>

uri@sysarch.com said...
: 	return eval "sub { \$_[0] =~ /$regex/ }" ;
: 
: this has many problems (like / in the regex) but illustrates the idea.

Unless I misunderstand you, a simple quotemeta op will take care of that 
problem.

-- 
#!/usr/bin/perl -w --                     Just another Perl hacker,
(open 0),$_=<0>,s,.*- +,,,chop;for(split?@*?){($$_++or$}=$_,y,y \,\
y,<STDIN>,,$$=~s\^\"sub $_ {print'$}'};7"\ee),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg         jdf@pobox.com        Sunny Brooklyn, NY


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

Date: 27 Feb 1998 17:24:52 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Musings on English.pm
Message-Id: <6d6st4$s7o$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Joseph N. Hall
<joseph@5sigma.com>],
who wrote in article <34F68743.43AB660F@5sigma.com>:
> Wow, I can't believe that this actually works:
> 
> $_ = "testing one two three";
> /one/;
> eval q{
>     print "before: $`\n";
>     print "match: $&\n";
>     print "after: $'\n";
> };

    G:\papers>perl
    $_ = "testing one two three";
    /one/;
    eval q{
	print "before: $`\n";
	print "match: $&\n";
	print "after: $'\n";
    };
    ^Z
    before:
    match:
    after:

(It was very buggy before the merge of Jumbo-RE-patch.)

Enjoy,
Ilya


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

Date: 27 Feb 1998 18:18:40 GMT
From: "Barry Phillips" <sb67@dial.pipex.com>
Subject: Perl on Win95 not working (newbie question) and flip /'s problem
Message-Id: <01bd43ac$3d912440$b22a6e01@an1075-mknlho>


HELP.
I'm quite new to perl and have a problem. I've installed Gurusamys's Win32
port of perl onto Windows 95.

However whenever I run any 'module' rouintes I get:-
E.G.

($name,$path,$suffix) = fileparse("lib/File/Basename.pm","\.pm");
undefined subroutine &main::fileparse

use win32;
$win95 = win32::Iswin95();
Undefined subroutine &win32::Iswin95

Are these designed to work ?

I even tried using the updated libwin32-0.10 but still the same problem.

One last thing....

I have to read a file and get a dos pathname, how can I flip the \'s.
or make the \'s double ones ?
i.e.

$file = "c:\program\archive\prog.exe";
to
        $file = "c:/program/archive/prog.exe";
or
        $file = "c:\\program\\archive\\prog.exe";


many thanks
Barry

(PC Config)

This is perl, version 5.004_02

Copyright 1987-1997, Larry Wall

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.
---------------------------------------------

Summary of my perl5 (5.0 patchlevel 4 subversion 02) configuration:
  Platform:
    osname=MSWin32, osvers=4.0, archname=MSWin32
    uname=''
    hint=recommended, useposix=true, d_sigaction=undef
    bincompat3=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='bcc32', optimize='-O', gccversion=
    cppflags='-DWIN32'
    ccflags ='-D_RTLDLL -DWIN32'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=8, usemymalloc=n, randbits=15
  Linker and Libraries:
    ld='tlink32', ldflags =''
    libpth=c:\bc5\lib
    libs=import32.lib cw32mti.lib odbc32.lib odbccp32.lib
    libc=cw32mti.lib, so=dll
    useshrplib=undef, libperl=undef
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='', lddlflags='-Tpd'


Characteristics of this binary (from libperl): 
  Compile-time options: DEBUGGING
  Built under MSWin32
  Compiled at Aug  9 1997 21:42:37
  @INC:
    C:\PERL\lib\site
    C:\PERL\lib
    c:\perl\lib
    c:\perl\lib\site
    c:\perl\lib\site



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

Date: 27 Feb 1998 13:30:14 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: QUIZ: what good is this code?
Message-Id: <x7en0o2954.fsf@sysarch.com>


in the spirit of the stumper, i have an educational quiz. the code below
has a useful purpose. it is a modification of one of my favorite perl
idioms.  see if you can explain exactly what it does and what use it can
be. the initial array values are just example data, the real data would
be up to the application.

@array = qw( a b c d ) ;

@array{ @array } = ( [ @array ] ) x @array ;


uri

-- 
Uri Guttman                     SYStems ARCHitecture and Software Engineering
uri@sysarch.com                                          Have Perl, Will Hack
http://www.sysarch.com                (781) 643-7504 x*2  FAX: (781) 643-2710
Try the Best Search Engine on the Net -------->  http://www.northernlight.com


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

Date: Fri, 27 Feb 1998 11:01:38 -0700
From: "Keith L. Miller" <miller@bigsky.net>
Subject: Searching for a string!
Message-Id: <34F6FF82.B51CB9E5@bigsky.net>

I'm trying to search an arary for a specific string but not having much
luck.  For instance, when I search for camel I get camels and when I
search for big I get bigsky, bigdaddy, etc.

Does anyone know how to get this particular job done?

Thanks!



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

Date: 27 Feb 1998 18:51:58 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Searching for a string!
Message-Id: <6d720e$s2t@news-central.tiac.net>

In article <34F6FF82.B51CB9E5@bigsky.net>,
Keith L. Miller <miller@bigsky.net> wrote:
>I'm trying to search an arary for a specific string but not having much
>luck.  For instance, when I search for camel I get camels and when I
>search for big I get bigsky, bigdaddy, etc.
>
>Does anyone know how to get this particular job done?

If you use \b in a regex it will look for a "word" boundary, this is
explained more fully in the perlre document that comes with recent perl
distributions, so to find the word camel you might use \bcamel\b as the
regex.

If you want more information then Friedl's Mastering Regular Expressions
book or Programming Perl might be places to start.

In general it's worth at least scanning the perfaq document and the
questions in perfaq? documents which come with recent distributions to see
if any might be worth investigating further.

Hope this helps,

Mike


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


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

Date: Fri, 27 Feb 1998 11:27:48 -0500
From: Peter Shankey <shankeyp@charlestoncounty.org>
To: Rahul Dhesi <c.c.eiftj@60.usenet.us.com>
Subject: Re: seeking and changing /etc/passwd
Message-Id: <34F6E984.299BAE33@charlestoncounty.org>

In your third comment:
3. Nothing is ever written back to the file.

How would I write back the changes to the /etc/passwd file??

In your first comment:
1. Locking of the password file is neither done nor discussed.  If you
   believe it should not be locked, this assumption should be clearly
   stated.

How would I lock the file?

what are some good resources for learning perl??

thanks
pete



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

Date: Fri, 27 Feb 1998 11:29:24 -0500
From: Peter Shankey <shankeyp@charlestoncounty.org>
To: Rahul Dhesi <c.c.eiftj@60.usenet.us.com>
Subject: Re: seeking and changing /etc/passwd
Message-Id: <34F6E9E4.2897CA10@charlestoncounty.org>

In your third comment:
3. Nothing is ever written back to the file.

How would I write back the changes to the /etc/passwd file??

In your first comment:
1. Locking of the password file is neither done nor discussed.  If you
   believe it should not be locked, this assumption should be clearly
   stated.

How would I lock the file?

what are some good resources for learning perl??

thanks
pete



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

Date: Fri, 27 Feb 1998 10:34:36 -0600
From: Thomas Autry <taautry@ti.com>
Subject: Setting security attribs for registry keys?
Message-Id: <34F6EB1C.AF68B8BE@ti.com>

I am trying to set/change registry security permissions on certain keys
so that I can remotely administer them.  I can use regedt32.exe to
change permissions, so I should be able to from the command line.  I
have tried RegSetKeySecurity but do not know what the information needed
by the key should be.  I know the syntax but do not have a clue about
how it should look.  Have been unable to find any examples on using this
option.  Any help would be greatly appreciated.  I am just looking for
someone who has successfully used this to change permissions along with
some examples.

Regards,

Thomas Autry



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

Date: 27 Feb 1998 15:39:03 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: The Ineffable Tom C.
Message-Id: <6d6mmn$9jf@fridge.shore.net>

Chipmunk (rjk@coos.dartmouth.edu) wrote:

: Do you even know what "ineffable" means?  Perhaps you should go look it up.

in-ef-fa-ble \(')in-'ef-e-bel\ adj
[ME, fr. MF, fr. L ineffabilis, fr. in- + effabilis capable of being
     expressed, fr. effari to speak out, fr. ex- + fari to speak
     -- more at BAN]
(14c)
1a: incapable of being expressed in words: INDESCRIBABLE <ineffable
joy>
1b: UNSPEAKABLE <ineffable disgust>
2: not to be uttered: TABOO <the ineffable name of Jehovah>
-- in-ef-fa-bil-i-ty \(,)in-,ef-e-'bil-et-e^-\ n 
-- in-ef-fa-ble-ness \(')in-'ef-e-bel-nes\ n 
-- in-ef-fa-bly \-ble^-\ adv 

--
Nathan V. Patwardhan



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

Date: 27 Feb 1998 16:09:51 GMT
From: orwant@alphaville.media.mit.edu (Jon Orwant)
Subject: The Perl Journal #9, table of contents
Message-Id: <6d6ogf$kg3$1@news1.teleport.com>


Issues will be mailed in late March.  68 pages.  

Stately Scripting with mod_perl         Lincoln Stein and Doug MacEachern
Chatbot::Eliza                          John Nolan
CryptoContext                           Nathan Torkington
Perl/Tk: Modeling Mowing Techniques     Steve Lidie
Perl News                               Jon Orwant
Die()ing on the Web                     brian d foy
GD and L-systems                        Jason Reed
Win32::ODBC                             Joe Casadonte
How Regexes Work                        Mark-Jason Dominus
The Perl Machine                        Ray F. Piodasoll
Perl Guts: Basic Anatomy                Chip Salzenberg
Software Construction with Cons         Bob Sidebotham
The Stones Contest: Results             Russell Caton

-Jon

------------------------------------
Jon Orwant            http://tpj.com
Editor & Publisher, The Perl Journal
--




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

Date: Fri, 27 Feb 1998 09:05:44 -0600
From: Mark Conty <mconty@year.grain.cargill.com>
Subject: Re: What does this one-liner do?
Message-Id: <34F6D648.53A4@year.grain.cargill.com>

Eike Grote wrote:
[...]
|> >
|> > print ( $x = ($a) = (7,8,9) );
|> 
|> First point to mention: associativity of '=' is "right" which
|> means that the above is equivalent to
|> 
|>   print ( $x = ( ($a) = (7,8,9) ) );
|> 
|> The reason why the value of '$x' is equal to '3' afterwards can be
|> found in the "Camel", 2nd ed., p.48:
|> 
|>   "List assignment in a scalar context returns the number of
|>    elements produced by the expression on the right side of the
|>    assignment: ..."

 ... but the expression "$x = ( ($a) = ... )" is evaluating a list that
is _one_ element long, not three!  After all, $a is a scalar, not a
list.

Now I'm puzzled too...  *sigh*
-- 
Mark Conty                             mark_conty@cargill.com (work)
Cargill Grain Division                            mdc@isd.net (home)
CGD/LYNX Server Support        <><               Phone: 612/984-0503


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

Date: Fri, 27 Feb 1998 09:48:54 -0600
From: Mark Conty <mconty@year.grain.cargill.com>
Subject: Re: What does this one-liner do?
Message-Id: <34F6E066.5BD0@year.grain.cargill.com>

Yeah, but if it's supposed to reflect the expression to the right of
the assignment, and that expression renders a scalar value, then the
assignment should be of that [scalar] value, not of some subordinate
expression that just happens to be a list.  In the case of the example
from the man page, $x should be neither 2 nor 3, but 1 !

That, or the man page should be changed to read something like:

        Array assignment in a scalar context returns the number of
        elements produced by the _scalar_ evaluation of the 
	_rightmost_* expression of the assignment: [emphasis added]

	(* ... or should that read _innermost_?)
--
Mark Conty                             mark_conty@cargill.com (work)
Cargill Grain Division                            mdc@isd.net (home)
CGD/LYNX Server Support        <><               Phone: 612/984-0503


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

Date: 27 Feb 1998 15:28:49 GMT
From: Tom.Grydeland@phys.uit.no (Tom Grydeland)
Subject: Re: Why doesn't "tr/\x0D//d" work?
Message-Id: <slrn6fdmth.ij7.Tom.Grydeland@mitra.phys.uit.no>

On Fri, 27 Feb 1998 12:52:49 GMT,
Fred Vaughn <spam@no_spam_please.com> wrote:
> open(INFILE, $ARGV[0] ) || die "Error unable to open filename: $infile $!";
                                     Did you mean $ARGV[0] here? ^^^^^^^

> while ( $line = <INFILE> )

Hmm, you didn't use -w, did you?

>  $line =~ tr/\x0D//d;

> The script refuses to remove the "x0D" charaters. Why? what did I do
> wrong?

Don't know.  That particular line works for me.

What happens?

> Fred Vaughn

-- 
//Tom Grydeland <Tom.Grydeland@phys.uit.no>


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

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

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