[6783] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 408 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 1 16:07:14 1997

Date: Thu, 1 May 97 13:00:25 -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           Thu, 1 May 1997     Volume: 8 Number: 408

Today's topics:
     Re: @INC and . <dorman@s3i.com>
     Re: a question on striping characters (Jeff Stampes)
     Re: Array Elements <Jan.Krynicky@st.ms.mff.cuni.cz>
     Re: Books available online? ()
     Re: Built in Perl func to expand env vars??? (Jeff Stampes)
     Re: CGI & PL <Jan.Krynicky@st.ms.mff.cuni.cz>
     Re: hashes, -d's "x", and Data::Dumper (Don Reid)
     Intel v. Randal: The Essential Cower (Jeffrey Kegler)
     Re: Interactive Perl Webpage (Jeff Yoak)
     Re: Line search through text file not functioning corre (Simon Hyde (aka Jeckyll))
     Re: Loosing clpm regulars (was Re: Perl auto-replier) (Jon Bell)
     Re: Notice to antispammers PLEASE READ <a3200@hotmail.com>
     Re: perfunc mkdir question (Jeff Stampes)
     Re: Perl auto-replier <John.Adams@BentonvilleAR.ncr.com>
     Re: Perl auto-replier (Jon Bell)
     PerlIS and Server-Side Includes <rudy@apd.saic.com>
     Re: PRINTF irregularities? (Joel Graber)
     Re: PRINTF irregularities? (Abigail)
     quoting parens in m() expression (Tim  Smith)
     SOLVED: IO::* and Solaris 2.x (Tim  Smith)
     streaming encryption (Peter Cox)
     Re: Turn array into hash then import into another names (M.J.T. Guy)
     variable substitution <bjlockie@nortel.ca>
     Re: variable substitution (A. Deckers)
     Why no regex char class for punc chars??? (Jete Software Inc.)
     Re: Why no regex char class for punc chars??? (A. Deckers)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 01 May 1997 11:06:06 -0400
From: Clark Dorman <dorman@s3i.com>
Subject: Re: @INC and .
Message-Id: <dyb9zteox.fsf@s3i.com>


dan@more.net (Dan Niles) writes:
> Why does perl stop printing if I remove '.' from @INC?

 ------------------------------
#!/home/dorman/bin/perl -w

use strict;
print "(@INC)\n\n";
pop(@INC);
print "(@INC)\n";
 ------------------------------

Produces:

(/home/dorman/lib/perl5/sun4-solaris/5.00393 /home/dorman/lib/perl5
/home/dorman/lib/perl5/site_perl/sun4-solaris
/home/dorman/lib/perl5/site_perl .)

(/home/dorman/lib/perl5/sun4-solaris/5.00393 /home/dorman/lib/perl5
/home/dorman/lib/perl5/site_perl/sun4-solaris
/home/dorman/lib/perl5/site_perl)

So, it appears to be printing fine.  Please post some stripped code that
stops printing, and what you've done to test it, and the results of perl -V
and maybe we can help.

--
Clark



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

Date: 1 May 1997 18:44:51 GMT
From: stampes@xilinx.com (Jeff Stampes)
Subject: Re: a question on striping characters
Message-Id: <5kaob4$bi0$1@neocad.com>

spanky@direct.ca wrote:
: how can you strip the character string, Ex ->  "I_LIKE_THE_NUMBER_9"
: to get just the number 9?

By reading the perlfunc manpage and studying the substr() function,
or the perlre manpage and understanding how regular expressions
work.  Or you could see the FAQ, or read any perl book, or even
search Deja News.

$foo = "I_LIKE_THE_NUMBER_9"
$bar = substr($foo,-1,1);


--
Jeff Stampes -- Xilinx, Inc. -- Boulder, CO -- jeff.stampes@xilinx.com


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

Date: Thu, 01 May 1997 20:42:37 -0700
From: Jan Krynicky <Jan.Krynicky@st.ms.mff.cuni.cz>
To: zpalastair@unl.ac.uk
Subject: Re: Array Elements
Message-Id: <336962AD.2DE5@st.ms.mff.cuni.cz>

ALASTAIR AITKEN CLMS wrote:
> 
> In article <5j1q11$lpq@noc1.gwi.net>, geecee@burbot.netquarters.net (Gary Chambers) writes:
> >Can someone confirm the correct method of determining the number of
> >elements in an array?  I'm *VERY* new to Perl, and I've looked in the
> >Camel book and Llama book and found nothing definitive.  Here's what I
> >have been able to gather:
> 
> $#array is the last element subscript so ..
> $#array++ is the number of elements (but increments the array too) so ..
> $elements = $#array++; # which i think doesn't increment the array but
> $elements = $#array; $elements++ # definitely doesn't.
> 
> This has been well documented since perl2.
> 
> Alastair.

And what about the most simple

 $#array+1

huh?

Jenda


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

Date: 1 May 1997 19:27:14 GMT
From: scott@lighthouse.softbase.com ()
Subject: Re: Books available online?
Message-Id: <5kaqqi$l2a$14@mainsrv.main.nc.us>

Tammy Cotter (cottert@sonic.net) wrote:
: McMillan Publishing has a variety of books on-line.  I think there's a PERL
: book.

Their Using Perl book isn't that great. I looked at it and passed on
buying it.

Scott



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

Date: 1 May 1997 18:47:23 GMT
From: stampes@xilinx.com (Jeff Stampes)
Subject: Re: Built in Perl func to expand env vars???
Message-Id: <5kaofr$bi0$2@neocad.com>


Eric Kischell (keesh@cs.cmu.edu) wrote:
: I am currently learning Perl from the Camel book.
: Is there any built-in Perl functionality(non system calls) to expand
: environmental variables?

: ex parsed from file.)
: CT header file:  $(PATIENT_DIR)/ct/hdr.I20886_3.001

: $(PATIENT_DIR) would be expanded to what it is set to in the user's
: current environment.

If this is the 2nd edition Camel...see p. 138 for a description
of the %ENV hash:

$patient_dir = $ENV{PATIENT_DIR}

--
Jeff Stampes -- Xilinx, Inc. -- Boulder, CO -- jeff.stampes@xilinx.com


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

Date: Thu, 01 May 1997 21:40:15 -0700
From: Jan Krynicky <Jan.Krynicky@st.ms.mff.cuni.cz>
To: Alwin Bijvoet <info@audiovisueel.com>
Subject: Re: CGI & PL
Message-Id: <3369702F.5E10@st.ms.mff.cuni.cz>

Alwin Bijvoet wrote:
> 
> Hello,
> 
> I am using win95
> I installed perl for Win32 Build 306 (apr 97)
> I am using frontpage97
> The problem:
> scripts with *pl extension are running fine but when i try scripts with cgi
> extension I get the message:
>    HTTP/1.0 500 Server Error
> Renaming *.cgi to *.pl helps but is not a charming solution.
> In the registry both 'pl' and 'cgi' are registered.
> What to do?
> 
> Thanks for your answer
> Alwin Bijvoet

Where are they registered?

in the associations or in

HKEY_LOCAL_MACHINE/System/CurrentControlSet/Service/w3svc/parameters/scriptmap
?

  (Not completely sure about the path).

The first is useless, the second mapping must be present.

Hi, Jenda


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

Date: 1 May 1997 18:51:05 GMT
From: donr@cv.hp.com (Don Reid)
Subject: Re: hashes, -d's "x", and Data::Dumper
Message-Id: <5kaomp$orj$2@hpcvca.cv.hp.com>

:    $myhash{'A'}{'1'} = "now";
:    $myhash{'A'}{'1'}{'X'} = "is";

Is $myhash{'A'}{'1'} a scalar (containing "now"), or a hash?


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

Date: 1 May 1997 18:44:57 GMT
From: cybersalem@algorists.com (Jeffrey Kegler)
Subject: Intel v. Randal: The Essential Cower
Message-Id: <5kaoba$pcp@samba.rahul.net>


                    Letter from Cybersalem 7
                       The Essential Cower
                        by Jeffrey Kegler


I have already introduced Richard Cower, the Intel Network
Security Specialist, State's Expert and expert witness for the
trial in Oregon v. Schwartz.  This impressive set of titles
understates Cower's importance in the prosecution of Randal
Schwartz.  According to the prosecutor, without Rich Cower beside
him at the prosecutor's table during every moment of the trial,
Randal could not have been prosecuted:

  "I can tell you this from some of my witnesses, I'm learning
  new things that I don't know the answer to all the time,
  including this morning.  I'm learning things that I didn't
  know about the computer, that if just talking with my own
  witnesses is producing that, then I absolutely do need Mr.
  Cower right by my side to ask him about that during trial.  I
  can tell you that because there are things that have already
  happened this morning that I don't understand, and it was on
  a fairly simple point, I thought, until the witness started
  talking."

  "So just with my own witness, I can tell you this, that I
  need his ability to translate what they are saying to me in a
  language that I can understand.  So from that standpoint, he
  is essential based upon what has already occurred this
  morning." [1]

  "[ ... ] I'm asking the Court to exercise your discretion in
  allowing Mr. Cower to remain present during the trial.  I'm
  also indicating to the Court that in order for me to
  translate the language that the witnesses speak in, it is
  essential that he act as a translator to me.  And I can't
  tell you what it is that the words that will be spoken that
  will require translation.  I can tell you this, they have
  already occurred this morning when I was talking to some of
  the witnesses that I anticipate calling this morning, such
  that -- and he was not present when it occurred, such that I
  have a call in to him to try to find out what this means."
  [2]

As you might imagine, Tintera found it humiliating to admit that
he was incapable of prosecuting this case without an Intel
employee watching him full-time, and he consumed considerable
court time looking for a face-saving way to avoid this.  But
Judge Bonebrake, trying to ensure Randal's conviction survived
appeal, required this admission from Tintera. [3]

Having persons other than the prosecutor sit in as State's Expert
is not rare, but these are nearly always law officers.  For the
victim to be able to demand and get a seat at the prosecution
table is highly irregular.  And in this case, the alleged victim
is a Security Officer working for the employer of the most of the
witnesses -- an employer who demonstrates with this case that
their co-workers who find themselves unpopular with management
can go to jail for deeds which in other circumstances and for
other employees do not even produce a reprimand.

For Cower to become the prosecutor should not be necessary in the
first place.  If the D.A. does not understand why the defendant
is guilty, instead requiring Cower to continually remind him, how
is he expecting to properly convince a jury?

Additionally, there is a very important reason why witnesses like
Cower are almost never allowed to listen to other witnesses'
testimony, as Cower was able to do after turning Tintera into his
sidekick.  Quoting Judge Bonebrake:

  "I also keep in mind, something I've observed over the last
  25 or 30 years, when witnesses are permitted to remain in
  court, there certainly is a risk that they will -- we're
  always concerned about people lying, making up testimony,
  maybe something less than that, forgetting some facts in
  order to make their testimony coincide with the testimony of
  other witnesses that they hear testify.  That's the risk,
  certainly." [4]

===========================================================

The Friends of Randal Schwartz Web site archives the material on
all sides of this issue, including the trial transcripts:
<URL:http://www.lightlink.com/fors>.

Of the many opportunities to do something, three head the list:

1.) To sign a letter objecting to Intel's role in this sorry
matter, see <URL:http://www.lightlink.com/fors/us2intel>.

2.) To sign a letter to the Computer Law Committee of Oregon
State Bar, see <URL:http://www.lightlink.com/fors/us2oregon>.

3.) To get an auto-reply giving Randal's own statement, and
discussing how you can contribute to his Legal Defense Fund, send
an empty message to <URL:mailto:fund@stonehenge.com>

Permission is granted to freely copy the Cybersalem Letters in
electronic form, or to print them for personal use.

===========================================================

Note 1:  <URL:http://www.lightlink.com/fors/court/7-13-95.txt>,
page 12, lines 5 to 22.

Note 2:  <URL:http://www.lightlink.com/fors/court/7-13-95.txt>,
page 16 line 23 to page 17, line 12.

Note 3:  The discussions of Cower's status are
<URL:http://www.lightlink.com/fors/court/7-11-95.txt>, page 360,
line 14 to page 368, line 20;
<URL:http://www.lightlink.com/fors/court/7-12-95.txt>, page 14,
line 17 to page 23, line 5; and
<URL:http://www.lightlink.com/fors/court/7-13-95.txt>, page 4,
line 3, to page 25, line 6.

Note 4:  <URL:http://www.lightlink.com/fors/court/7-13-95.txt>,
page 23, line 22 to page 24, line 5.


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

Date: Thu, 01 May 1997 15:42:36 GMT
From: jeff@yoak.com (Jeff Yoak)
Subject: Re: Interactive Perl Webpage
Message-Id: <5kao7n$1pn@dfw-ixnews11.ix.netcom.com>

q8e192@ugrad.cs.ubc.ca (Henry Avatar Chan) wrote:

>This Java Applet allows a user to write Perl code and submit it
>through the web

1.)  The applet is annoying in that it is huge, normal escapes don't
work and until maximizing it, I couldn't find the "Quit."  button at
the bottom.  Wouldn't be surprised if people at 640 x 480 couldn't
quit at all without killing it.

2.)  No it doesn't.  At least not what I saw.  It lets you order the
statements you provide.


>Any feedback is appreciated.

Jeff Yoak  jeff@yoak.com  http://yoak.com/



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

Date: Thu, 01 May 1997 18:27:30 GMT
From: shyde@poboxes.com (Simon Hyde (aka Jeckyll))
Subject: Re: Line search through text file not functioning correctly
Message-Id: <336ae067.11958541@news>

On Thu, 01 May 1997 00:38:23 GMT, posenj@lancet.co.za (Kevin Posen) wrote:

>Hi.
>
>I'm writing a script to search for a given city name in a data file and
>return the time zone.
>
>This is the structure of the datafile:
>
>*snip*
>This is the search function:
>*snip*
> if ($_ =~ /$city/i) {
>*snip*
>It works fine for all name (including those with spaces - eg. New York)
>except for those containing brackets. For these it says that no match was
>found in the data file. However, if I escape the characters ('( = %27)' and
>') = %28)') it works perfectly.
>
>Any suggestions?

this: /$city/i is a regular expression (take a look at man perlre
(http://www.perl.com/perl/nmanual/pod/perlre.html) if you don't know what a regular
expression is) and in regular expressions certain charecters have special meaning
(including brackets) and must therefore be escaped if you want to use them, this can be
done in 2 ways, the latter only working with perl5:
1 copy the string into a different variable and replace all possibly offending charecters
with an escaped version of them:
($regexcity = $city) =~ s/(\W)/\\$1/g;
if (/$regexcity/i) {

or simply use the perl5 \Q escaping option which stops brackets (and other things) being
missenterpreted (using \E to end it, although in this case that isn't neccessary since
it's ended at the end of the string anyway):
if(/\Q$city\E/i) {



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

Date: Thu, 1 May 1997 15:35:36 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: Loosing clpm regulars (was Re: Perl auto-replier)
Message-Id: <E9IDzC.LCt@presby.edu>

 A. Deckers <I-hate-cyber-promo@man.ac.uk> wrote:
>
>I would like to know what regular readers of clpm think about adding a
>comp.lang.perl.moderated to the pre-RFD. As I doubt we could find
>enough human moderators willing to take on the job, I propose an
>auto-moderated group.  Articles would have to include a "magic cookie"
>in a given header in order to be passed by the moderation script. IMHO,
>this should cut down the noise level to almost zero, as anyone who
>reads bofh will realise.

I'd support some kind of automoderation measure myself.  Have you 
investigated comp.infosystems.www.authoring.cgi?  They recently converted 
to an automoderated group.  I think the basic idea is to "hold" all 
first-time postings from newcomers and e-mail them a copy of the FAQ, 
along with instructions on how to "release" their posting if they still 
want to go through with it.  I don't read that group myself, so I don't 
know how well this has worked in practice.

-- 
Jon Bell <jtbell@presby.edu>                        Presbyterian College
Dept. of Physics and Computer Science        Clinton, South Carolina USA
[for beginner's Usenet info, see http://web.presby.edu/~jtbell/usenet/ ]


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

Date: Thu, 01 May 1997 14:25:51 -0300
From: Me <a3200@hotmail.com>
Subject: Re: Notice to antispammers PLEASE READ
Message-Id: <3368D21D.59D@hotmail.com>

> >> In any case, why exactly does a new server maintainer need real
> >> addresses?
> 
> The question is not "new server maintainer". It is "other USENET users."
> 

I have an idea to stop all this, the reason we are all fighting is that
Tom wants to put email-mungers real eMail addresses on a page, so other
USENET users can contact the poster easily.

What some don't like is the fact that these addresses being on a page
are very very easy for spam bots to get and use.

The simple way Tom can stop that is to split each address into 2 parts
without using links, like so...

<B>a3200 at hotmail.com</b>
<B>Joe at did.com</b>

This will make it hard for spam bots to read the addresses but the real
users, ie. you and me can use the addresses easily.

Just something to think about, Cya!


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

Date: 1 May 1997 18:54:36 GMT
From: stampes@xilinx.com (Jeff Stampes)
Subject: Re: perfunc mkdir question
Message-Id: <5kaotc$bi0$3@neocad.com>

Paul Lussier (plussier@synnet.com) wrote:

: Is there mkdir -p foo/bar/whatever functionality?

You're looking for the File::Path module...It's in the standard
distribution.

--
Jeff Stampes -- Xilinx, Inc. -- Boulder, CO -- jeff.stampes@xilinx.com


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

Date: Thu, 1 May 1997 16:19:55 GMT
From: John Adams <John.Adams@BentonvilleAR.ncr.com>
Subject: Re: Perl auto-replier
Message-Id: <3368C2AB.6591@BentonvilleAR.ncr.com>

rga wrote:
> 
> Ronald.J.Kimball@dartmouth.edu (Chipmunk) wrote:

>         I thought of ... hmmm .. maybe a group
>         called <comp.lang.perl.newbie> ..
> 
>         But, then who would answer the questions ?
>         <;-)> 
Well, I (very rarely) answer a question that is within my capabilities
and let the others go by. That's how I'm getting a clue how the hard
things work.

So, given such a group (or clp.new-user, or clp.help, or...), I think 
that the less clueless newbies (such as myself) will appreciate the
chance to take on some of these questions.

	John Adams


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

Date: Thu, 1 May 1997 15:37:51 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: Perl auto-replier
Message-Id: <E9IE34.LHu@presby.edu>

 Alan J. Flavell <flavell@mail.cern.ch> wrote:
>
>Oddly enough, we seem to be having much the same discussion on
>c.i.w.authoring.html at the moment as you folks are having here
>in this thread.

And in comp.lang.c++.  Of course, in that situation, we already *have* a 
parallel comp.lang.c++.moderated...

-- 
Jon Bell <jtbell@presby.edu>                        Presbyterian College
Dept. of Physics and Computer Science        Clinton, South Carolina USA
[for beginner's Usenet info, see http://web.presby.edu/~jtbell/usenet/ ]


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

Date: Thu, 01 May 1997 15:03:55 -0400
From: Rudy Keiser <rudy@apd.saic.com>
Subject: PerlIS and Server-Side Includes
Message-Id: <3368E91B.3A65@apd.saic.com>

I have PerlIS Build 306 and it works well for URLs that point to Perl
scripts.

I'm now trying to invoke a Perl script from an EXEC SSI, for example:

<p>Testing
<!--#exec cgi="/cgi-bin/test2.pl" -->

with test2.pl being simply:
print "output from test2.pl\n";

What I get is:

Testing
HTTP/1.0 200 OK output from test2.pl 


The "HTTP/1.0 200 OK" appears to be from the change in Build 305 that is
described in RELEASE.TXT.  Is there a flag to turn this feature off when
used in an SSI?

Any help would be appreciated.


Rudy Keiser - SAIC Vienna, VA
rudy@apd.saic.com


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

Date: 01 May 1997 19:08:03 GMT
From: jgraber@daldd.sc.ti.com (Joel Graber)
Subject: Re: PRINTF irregularities?
Message-Id: <JGRABER.97May1140803@sun_7407>


In article <5kab7p$brm$1@bigdog.ais-gwd.com> TechSupport@Greenwood.net (Jeremy T. Elston) writes:
>         printf("%10s  %8s   %-10s    %6.2f   %3.2f\n",
>                 $date, $time, $pmname, $minutes, $minutes/60);

> Output:
>   Login       Time     Portmaster    Time(min)    Time(hrs)
> 05/01/1997  07:10:07   pm2e-3        1204.77   20.08
                                       1234567
 ...
>  The 
> point is that the time(min) column does not right align.  The 4 spaces after 
> (%-10s) pushes to the edge of the T in Time.  I presumed that the %6.2f would 
> left pad the number, so columns would align along the decimal.  Is this a 
> glitch in Perl, a misunderstanding (by me) of printf??? 

It is a misunderstanding by you of printf,  rtfm  printf or man 5 formats
To convert from what you think is  %m.nf format,  use %z.nf  where z=m+n+1 


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

Date: Thu, 1 May 1997 18:54:55 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: PRINTF irregularities?
Message-Id: <E9In7J.GKF@nonexistent.com>

On Thu, 01 May 1997 15:01:25 GMT, Jeremy T. Elston wrote in
comp.lang.perl.misc URL: news:5kab7p$brm$1@bigdog.ais-gwd.com:
++ Greetings...
++ 
++         A little confused by some output.  I am a beginning Perl
++         programmer.  
++ I am using Perl 5.003 on a BSDI 2.1 box.
++ 
++         The confusion lies in the output from a printf statement.  I have
++         used 
++ perl -w and also checked the FAQs.  The man pages for printf do not explain 
++ this behavior, but perhaps I am just unaware of "how things work".
++ 
++ The relevant section of code:
++ ----------------
++ foreach (sort @user_hist) {
++         ($date,$time,$pmname,$minutes) = split(/#/);
++         printf("%10s  %8s   %-10s    %6.2f   %3.2f\n",
++                 $date, $time, $pmname, $minutes, $minutes/60);
++ ----------------
++ 
++ Output:
++ ----------------
++   Login       Time     Portmaster    Time(min)    Time(hrs)
++ 05/01/1997  07:10:07   pm2e-3        1204.77   20.08
++ ---------------
++ 
++         Although, depending on your fonts, this may not mean anything.  The 
++ point is that the time(min) column does not right align.  The 4 spaces
++ after 
++ (%-10s) pushes to the edge of the T in Time.  I presumed that the %6.2f
++ would 
++ left pad the number, so columns would align along the decimal.  Is this a 
++ glitch in Perl, a misunderstanding (by me) of printf???  Any suggestions
++ are 
++ welcome.

It's your misunderstanding of printf. "%6.2f" does *NOT* mean use 
6 cells, a dot and 2 cells, but 'use at least 6 cells for the
entire number, of which 2 are after the point'. You probably
want:

printf "%10s  %8s   %-10s    %9.2f   %5.2f\n"


Abigail


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

Date: 1 May 1997 11:43:04 -0700
From: trs@azstarnet.com (Tim  Smith)
Subject: quoting parens in m() expression
Message-Id: <5kao7o$pfs@web.azstarnet.com>

I'm trying to understand why this happens, hoping someone knows:

The following script works just fine ...
#!/usr/bin/perl -w

use strict;

my $item_line = 'item heading(text, level) : verbatum {';

my ($tag, $kywd, $field, $base, $rest);
unless (($tag, $kywd, $field, $base, $rest) = (
    $item_line =~ m(^\s*
	([\w\\]+)\s+			# tag
	([\w\\]+)\s*			# keyword
	(\Q(\E[\s\w\\,]*\Q)\E)?\s*	# field
	(?::\s*([\w\\]+))?\s*		# base
	(.+)?$				# rest
    )x
    ))
{
    print "invalid format: $item_line\n";
}
else {
    $^W = 0;
    print map({"[$_]"} $tag, $kywd, $field, $base, $rest), "\n";
    $^W = 1;
}


 ...but if I change the # field line to:


	(\([\s\w\\,]*\))?\s*		# field


I get the following error:
/^\s*
        ([\w\\]+)\s+                    # tag
        ([\w\\]+)\s*                    # keyword
        (\([\s\w\\,]*))?\s*             # field
        (?::\s*([\w\\]+))?\s*           # base
        (.+)?$                          # /: unmatched () in regexp at \
/tmp/trstest line 15.


I know I could use another character around the match (eg. with m{...} it
works fine) but I'm wondering why the \( doesn't work.  Just too
many parens there, confusing the parser?  This is perl 5.003, by the way.

Thanks,

Tim



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

Date: 1 May 1997 11:26:55 -0700
From: trs@azstarnet.com (Tim  Smith)
Subject: SOLVED: IO::* and Solaris 2.x
Message-Id: <5kan9f$jmg@web.azstarnet.com>


Several people asked me to share any solutions I got to a problem I
was having getting the IO::* modules to compile under Solaris 2.x using
gcc.

I could only get it to work when perl5 was compiled for dynamic loading
(dl_open.xs, not dl_none.xs when you run perl -V).  To get this to work,
I did the following:

PATH=/usr/ccs/bin:/opt/gnu/bin:/bin:/usr/bin:/usr/local/bin; export PATH

Then, when the Configure script asked which command should be used to
compile (and defaults to cc), I told it to use gcc.  I did not have to
use the -B/usr/ccs/bin trick described in one of the FAQ's, since I put
/usr/ccs/bin in my path before the GNU tools.  Also make sure that the
/usr/ucb is not in the path and not in the list of library directories.

Once you get perl to compile with dynamic loading, the IO::* modules should
compile cleanly.

Hope this helps,

Tim



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

Date: 1 May 1997 18:35:05 GMT
From: pcox@unix2.megsinet.net (Peter Cox)
Subject: streaming encryption
Message-Id: <slrn5mhoi2.bhj.pcox@unix2.megsinet.net>

I'm looking for a routine to plug into a perl script that will do
simple encryption of a data stream through a socket. 
Does anyone know of a failry simple way of doing this?
The encryption only has to be one-way (from the client to the server).

Thanks,
Peter



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

Date: 1 May 1997 17:53:48 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Turn array into hash then import into another namespace
Message-Id: <5kalbc$423@lyra.csx.cam.ac.uk>

Devin Ben-Hur  <dbenhur@egames.com> wrote:
>
>Are you particularly attached to the alternate namespace idea?
>Why not just use a hash to map names to index?  eg:
>
>my (%field_index,$i);
>for ($i=0; $i<@fields; ++$i) { $field_index{$fields[$i]} = $i; }
>
>Then instead of $Fields::name, you use $field_index{name}.

Or, for those averse to typing

my %field_index; @field_index{@fields} = 0..$#fields;


Mike Guy


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

Date: Thu, 01 May 1997 13:49:41 -0400
From: Bob Lockie <bjlockie@nortel.ca>
Subject: variable substitution
Message-Id: <3368D7B5.1671@nortel.ca>

I have 2 variables,
one named $type and one named $index.

I want to do the following inside a print statement.

print "$type_ac$index\n";

but Perl treats "$type_ac" as a variable name.

I tried "$type\_ac" with no luck.

I want to do this INSIDE :-) a print statement. :-)

Is there a way to force Perl to take the variable name that
I want it to?


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

Date: 1 May 1997 18:59:57 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: variable substitution
Message-Id: <slrn5mhq12.od.I-hate-cyber-promo@nessie.mcc.ac.uk>

In comp.lang.perl.misc,
	bjlockie@nortel.ca wrote:
>I have 2 variables,
>one named $type and one named $index.
>
>I want to do the following inside a print statement.
>
>print "$type_ac$index\n";
>
>but Perl treats "$type_ac" as a variable name.
>
>I tried "$type\_ac" with no luck.
>
>I want to do this INSIDE :-) a print statement. :-)
>
>Is there a way to force Perl to take the variable name that
>I want it to?

I've tried to figure out exactly _which_ variable name you want it to
take, but I'm not sure I've got it.

If it's $index, you just want to escape the first dollar sign:

print "\$type_ac$index\n";

HTH,

Alain

-- 
Perl information: <URL:http://www.perl.com/perl/>
        Perl FAQ: <URL:http://www.perl.com/perl/faq/>
    Perl archive: <URL:http://www.perl.com/CPAN/>
>>>>>>>>>>>>> NB: comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<<<<<


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

Date: 1 May 1997 13:52:05 -0400
From: jete@dgs.dgsys.com (Jete Software Inc.)
Subject: Why no regex char class for punc chars???
Message-Id: <5kal85$p1v@dgs.dgsys.com>

I was wondering why there is no regular express character class
for punctuation characters?? or is there one and i am just unaware
of it. I looked through the Camel 5 book and couldn't find it.

This would work the same way that \w does (for [a-zA-Z_0-9])
This way I can easily check for these characters without having
to worry about meta-characters screwing things up. There should
really be two classes 1) simply the punct. chars and 2) all of
the printable characters.

What is the most elegant way to perform this check ??

- Norman


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

Date: 1 May 1997 19:19:20 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: Why no regex char class for punc chars???
Message-Id: <slrn5mhr5d.od.I-hate-cyber-promo@nessie.mcc.ac.uk>

In comp.lang.perl.misc,
	jete@dgs.dgsys.com wrote:
>I was wondering why there is no regular express character class
>for punctuation characters?? or is there one and i am just unaware
>of it. I looked through the Camel 5 book and couldn't find it.
>
>This would work the same way that \w does (for [a-zA-Z_0-9])
>This way I can easily check for these characters without having
>to worry about meta-characters screwing things up. There should

To quote Camel2: "Note that most other metacharacters", ie not ^, -, \, ]
and the various "letter metachars" (\a, \b, etc), "loose their meta-ness
inside square brackets".

>really be two classes 1) simply the punct. chars and 2) all of
>the printable characters.
>
>What is the most elegant way to perform this check ??

Maybe  m/[:;,.!?]/ would do?

HTH,

Alain

-- 
Perl information: <URL:http://www.perl.com/perl/>
        Perl FAQ: <URL:http://www.perl.com/perl/faq/>
    Perl archive: <URL:http://www.perl.com/CPAN/>
>>>>>>>>>>>>> NB: comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<<<<<


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

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

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