[18770] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 938 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 19 11:05:34 2001

Date: Sat, 19 May 2001 08:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <990284709-v10-i938@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 19 May 2001     Volume: 10 Number: 938

Today's topics:
        ActiveState PPM Modules (Jason James)
    Re: best way to evaluate $1 so it's not read-only? (Eric Bohlman)
    Re: Can anyone help me please? (Tad McClellan)
        file names into an array <x@y.com>
    Re: file names into an array (Garry Williams)
    Re: file names into an array <a.v.a@home.nl>
    Re: file names into an array <juex@my-deja.com>
    Re: file names into an array (Steve)
    Re: file names into an array (Garry Williams)
    Re: file names into an array <x@y.com>
    Re: file names into an array (Garry Williams)
    Re: file names into an array <a.v.a@home.nl>
    Re: Help: using constants from inherited parent class (Sweth Chandramouli)
    Re: Help: using constants from inherited parent class (Anno Siegel)
    Re: HTTP Response suppression <flavell@mail.cern.ch>
    Re: image_button and onClick??? (Steve)
    Re: image_button and onClick??? <flavell@mail.cern.ch>
    Re: Is this ok? <keesh@users.pleaseremovethisbit.sourceforge.net>
    Re: keys to variable names, or variable names to keys? (Eric Bohlman)
        Multiple Functions-Same Script/ <webmaster@eyeonthe.net>
    Re: oh c'mon please, one of you perl/unix gurus!!! (Steve)
    Re: Pronouncing ISA (Randal L. Schwartz)
        regex  <a.v.a@home.nl>
    Re: regex  (Garry Williams)
    Re: regex (Anno Siegel)
    Re: regex (Randal L. Schwartz)
    Re: Taint (Garry Williams)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 19 May 2001 15:05:55 GMT
From: jason@jamesjl.demon.co.uk (Jason James)
Subject: ActiveState PPM Modules
Message-Id: <3b068b33.848940561@news.demon.co.uk>

Please can someone tell me where I
can download the latest modules for
ActiveState's PERL 5.6.1.626.  I have
just downloaded the latest version from
their www site and I need some additional
modules.  The ones from CPAN seem to 
need a C complier to do anything with.

The module I need at the moment is the

Date::Calc module that can be installed
onto my copy of PERL running on a
Window NT 4 server and IIS4.

Some help would sure be useful.

Many thanks,

Jason James


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

Date: 19 May 2001 14:29:29 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: best way to evaluate $1 so it's not read-only?
Message-Id: <9e6009$g2n$4@bob.news.rcn.net>

Kai Henningsen <kaih=81842UO1w-B@khms.westfalen.de> wrote:
> abigail@foad.org (Abigail)  wrote on 19.05.01 in <slrn9gcfpg.sk5.abigail@tsathoggua.rlyeh.net>:
>> But before you are going to profile any code, you should first analyze
>> your algorithm, and see whether you are better off using a faster
>> algorithm.

> Why would you want that, unless the profile tells you there's a problem at  
> that place?

Because changing your algorithm after you've already coded and tested it 
involves a *lot* more work than fine-tuning some code.  If you're building 
a building (cue Weinberg's quote about buildings, programmers, and 
woopeckers) you want to make sure the foundation will support the entire 
weight *before* you pour it.  The choice of algorithms and data structures 
usually dictates the architecture of your entire code; if they turn out to 
be inadequate, you have to tear the whole thing down and start over.



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

Date: Sat, 19 May 2001 08:34:14 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Can anyone help me please?
Message-Id: <slrn9gcq26.ugl.tadmc@tadmc26.august.net>

Robb Meade <Ask@For-It.Com> wrote:

>Subject: Can anyone help me please?


Can you put the subject of your post in the Subject of your post please?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sat, 19 May 2001 23:43:42 +1000
From: "Nicole" <x@y.com>
Subject: file names into an array
Message-Id: <4LuN6.898$Ld4.40904@ozemail.com.au>

I have a number of text files (*.txt) in a directory.

I want to put all the names for those files into an array called @files.

There are too many files to manually populate the array, plus the file list
often changes.

How can I do this?

Here is what I tried without success;

@files = ('dir/*.txt');

@files = ('dir/');

the above two with double quotation marks (").

@files = <*.txt>;

Thanx.




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

Date: Sat, 19 May 2001 13:56:12 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: file names into an array
Message-Id: <slrn9gcurs.1ea.garry@zfw.zvolve.net>

On Sat, 19 May 2001 23:43:42 +1000, Nicole <x@y.com> wrote:
> I have a number of text files (*.txt) in a directory.
> 
> I want to put all the names for those files into an array called @files.

@files = <directory/*.txt>;

> There are too many files to manually populate the array, plus the file list
> often changes.
> 
> How can I do this?
> 
> Here is what I tried without success;
> 
> @files = ('dir/*.txt');

This creates an array with a single element whose value is
'dir/*.txt'.  

> @files = ('dir/');

This creates an array with a single element whose value is 'dir/'.  

> the above two with double quotation marks (").

Same thing as above, since there's nothing to interpolate into double
quoted strings.  

> @files = <*.txt>;

Ah.  You knew the answer already, but forgot to include the directory
name.  

-- 
Garry Williams


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

Date: Sat, 19 May 2001 13:49:31 GMT
From: AvA <a.v.a@home.nl>
Subject: Re: file names into an array
Message-Id: <3B065205.39C15A43@home.nl>

Nicole wrote:

> I have a number of text files (*.txt) in a directory.
>
> I want to put all the names for those files into an array called @files.
>
> There are too many files to manually populate the array, plus the file list
> often changes.
>
> How can I do this?
>
> Here is what I tried without success;
>
> @files = ('dir/*.txt');
>
> @files = ('dir/');
>
> the above two with double quotation marks (").
>
> @files = <*.txt>;
>
> Thanx.

the following worked for me:
perl -e' chdir("/tmp"); print @files = <*.txt>'



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

Date: Sat, 19 May 2001 07:09:43 -0700
From: "Jürgen Exner" <juex@my-deja.com>
Subject: Re: file names into an array
Message-Id: <3b067ea7$1@news.microsoft.com>

"Nicole" <x@y.com> wrote in message
news:4LuN6.898$Ld4.40904@ozemail.com.au...
> I have a number of text files (*.txt) in a directory.
> I want to put all the names for those files into an array called @files.
[...]
> How can I do this?

What's the problem with "opendir" and "readdir" (details see perldoc -f
opendir and perldoc -f readdir)?

> Here is what I tried without success;
> @files = ('dir/*.txt');
> @files = ('dir/');
> the above two with double quotation marks (").
Any of those will assign just the string to the first (and only) element in
the array.

> @files = <*.txt>;
Will read the content of the filehandle *.txt into the array.

jue




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

Date: 19 May 2001 14:20:56 GMT
From: steve@zeropps.uklinux.net (Steve)
Subject: Re: file names into an array
Message-Id: <slrn9gd08i.pkb.steve@zero-pps.localdomain>

On Sat, 19 May 2001 23:43:42 +1000, Nicole wrote:
>I have a number of text files (*.txt) in a directory.
>
>I want to put all the names for those files into an array called @files.
>
>There are too many files to manually populate the array, plus the file list
>often changes.

Presumably you want to go through the files looking for something in particular?
Then use file globbing:

my $filename;
my $Current_Directory = "/home/user/newsfiles/"

chdir("$Current_Directory") || die "Can't open $Current_Directory: $!";

 while(defined($filename = glob("*.txt")))
     {

      ## Open a message file. 
      open(NEWSFILE, "$filename") || die "Can't open $filename: $!";   
      
       while(<NEWSFILE>)    
         {
          do something with the open file.....
         }
     
      close(NEWSFILE)|| die "Can't close $filename: $!";

     }

 ## Only gets out to here after we've been through all the files. 

-- 
Cheers
Steve              email mailto:steve@zeropps.uklinux.net

%HAV-A-NICEDAY Error not enough coffee  0 pps. 

web http://www.zeropps.uklinux.net/

or  http://start.at/zero-pps

  2:53pm  up 106 days, 15:41,  2 users,  load average: 1.06, 1.03, 1.00


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

Date: Sat, 19 May 2001 14:24:31 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: file names into an array
Message-Id: <slrn9gd0gv.1ea.garry@zfw.zvolve.net>

On Sat, 19 May 2001 07:09:43 -0700, Jürgen Exner <juex@my-deja.com> wrote:
> "Nicole" <x@y.com> wrote in message
> news:4LuN6.898$Ld4.40904@ozemail.com.au...

[snip]

>> @files = <*.txt>;
> Will read the content of the filehandle *.txt into the array.
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I wonder what that means.  

The statement fills @files with the names of files that match the glob
`*.txt'.  Indeed, this is what the OP seems to want, but is probably
missing the directory before the `*.txt' bit.  

See perlop for file globs.  

-- 
Garry Williams


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

Date: Sun, 20 May 2001 00:34:43 +1000
From: "Nicole" <x@y.com>
Subject: Re: file names into an array
Message-Id: <6vvN6.921$Ld4.41518@ozemail.com.au>


> Ah.  You knew the answer already, but forgot to include the directory
> name.

Sorry, my typo. I had included that directory name, and it still seems to
return a blank array!

Clearly I am doing the "right" thing but it is not responding with the data.
Any thoughts why???




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

Date: Sat, 19 May 2001 14:37:18 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: file names into an array
Message-Id: <slrn9gd18u.1fq.garry@zfw.zvolve.net>

On Sun, 20 May 2001 00:34:43 +1000, Nicole <x@y.com> wrote:
> 
>> Ah.  You knew the answer already, but forgot to include the directory
>> name.
> 
> Sorry, my typo. I had included that directory name, and it still seems to
> return a blank array!
> 
> Clearly I am doing the "right" thing but it is not responding with the data.
> Any thoughts why???

Show the code.  

-- 
Garry Williams


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

Date: Sat, 19 May 2001 14:30:40 GMT
From: AvA <a.v.a@home.nl>
Subject: Re: file names into an array
Message-Id: <3B065BAB.AA772111@home.nl>

Nicole wrote:

> > Ah.  You knew the answer already, but forgot to include the directory
> > name.
>
> Sorry, my typo. I had included that directory name, and it still seems to
> return a blank array!
>
> Clearly I am doing the "right" thing but it is not responding with the data.
> Any thoughts why???

are you sure that there are any *.txt files in that directory?
otherwise it should work just fine.



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

Date: Sat, 19 May 2001 14:00:01 GMT
From: sweth+perl@gwu.edu (Sweth Chandramouli)
Subject: Re: Help: using constants from inherited parent class
Message-Id: <B%uN6.10487$G5.1758409@news1.rdc1.md.home.com>

In article <3b06667c$1@e-post.inode.at>,
Michael Ströck <michael@stroeck.com> wrote:
>> I've never understood why. I've always learned that use of constants
>> was a good thing, and that duplication of data should be avoided.
>>
>>
>> Doesn't the school of OO agree?
><snip>
>
>I agree with Abigail. Can someone point out some disadvantages to that ?
>And don't say "It's not OOP" ;-)
	Short Answer: It violates encapsulation.
	Long Answer: The theory, I think, is that when you are using
an OO package, what you are conceptually doing is telling your script to
extend its object model according to a certain set of specs; since an 
object model only defines classes, attributes, and methods, then you
can't use it to define "variables".  The trick is that attributes usually
_are_ variables of one sort or another; in OO-world, however, you never
access them directly, but instead use an accessor method.  So rather
than using $ParentClass::Variable, you would instead call 
ParentClass->VariableAccessor, which would return that class attribute
(which was, presumably defined in a closure in the ParentClass package
so that it would persist between calls).  That way, if at some point
the underlying implementation of Variable is changed so that it isn't
really a regular variable (maybe it becomes a dynamically-generated
var where some ugly CORBA gateway is used to pull the value from a
legacy system in Kazakhastan or something), the program that uses the
object class isn't affected.  If you were using $ParentClass::Variable
directly, you'd have to go through your script and change all of those
to calls to the new &ParentClass::CorbaFunkinessSubroutine, and that
would make you less-than-happy.  And OOP aims to make you happy at all
times, whether you want it or not.  :)

	-- Sweth.

-- 
Sweth Chandramouli ; <sweth+perl@gwu.edu>


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

Date: 19 May 2001 14:21:48 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Help: using constants from inherited parent class
Message-Id: <9e5vhs$7fq$2@mamenchi.zrz.TU-Berlin.DE>

According to Michael Ströck <michael@stroeck.com>:
> 
> "Abigail" <abigail@foad.org> schrieb im Newsbeitrag
> news:slrn9gbe3f.anl.abigail@tsathoggua.rlyeh.net...
> > Ren Maddox (ren@tivoli.com) wrote on MMDCCCXVII September MCMXCIII in
> > <URL:news:m37kzefd9f.fsf@dhcp9-172.support.tivoli.com>:
> > ][  On Fri, 18 May 2001, rstands@hotmail.com wrote:
> > ][
> > ][ > This must be fairly common but I can't find an example in my
> > ][ > ActiveState installation nor any reference to it in AS's docs, Camel
> > ][ > or Conway's OOP. I am sub-classing a package. The parent(SUPER)
> > ][ > package allows exporting some constants e.g.:
> > ][
> > ][  It may not be that common as exporting symbols is not very OO.
> >
> > I've never understood why. I've always learned that use of constants
> > was a good thing, and that duplication of data should be avoided.
> >
> >
> > Doesn't the school of OO agree?
> <snip>
> 
> I agree with Abigail. Can someone point out some disadvantages to that ?
> And don't say "It's not OOP" ;-)

Using a constant and exporting its name into the user's name space
are different things.  If you're going OO, a constant DIM in class
Vector is a class method and can be called as such:

    die "Dimension too high\n" if $n > Vector->DIM;

As gOOd intended.

Anno



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

Date: Sat, 19 May 2001 15:28:34 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: HTTP Response suppression
Message-Id: <Pine.LNX.4.30.0105191521201.21301-100000@lxplus003.cern.ch>

On Fri, 18 May 2001, Elmer Fudd wrote:

> How do I suppress the returned HTTP Response from an exec cgi call?

There is no "HTTP" response from a CGI (unless you are talking about a
non-parsed-headers script).

The CGI specification mandates a particular form of response from a
CGI (in other words, CGI headers).  If your script doesn't emit those,
then it isn't a CGI script.  CGI headers bear an intentional
resemblance to HTTP headers, but the distinction is a significant one.

If you were to tell an appropriate comp.infosystems.www.*** group what
it is that you're _really_ trying to achieve, rather than setting a
self-contradictory question, you might rate to get a more informative
answer.

> The setup is my host who uses WIN2000 and Activeperl (I believe). Anytime I
> use 'exec cgi' I get the std HTTP Reponse header (200) and I don't know how
> to suppress it. SSI works fine.

Then maybe you are using a web server which doesn't support the
standard interfaces.  In which case your question might be on-topic
on comp.infosystems.www.servers.ms-windows, or on one of the vendor's
own forums.

It surely isn't a Perl language question.

good luck



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

Date: 19 May 2001 14:20:55 GMT
From: steve@zeropps.uklinux.net (Steve)
Subject: Re: image_button and onClick???
Message-Id: <slrn9gcvli.pkb.steve@zero-pps.localdomain>

On Fri, 18 May 2001 17:16:42 -0700, Bryan Coon wrote:
>For some reason, I cannot get the onclick javascript action to work with
>CGI.pm's image_button.  Here is a sample of code:
>
>--------------------------
>#!/usr/bin/perl -w
>
>use CGI qw(:standard);
>
>print header();
>print start_html();
>print start_form();
>
>my $JS=<<END;
>alert('Delete Selection?');
>END
>
>print image_button(-name    => 'pop',
>                          -src =>
>'http://www.mysql.com/images/navi-logo.gif',
>                          -align   => 'MIDDLE',
>                          -onClick => $JS,
                           "border=0");
                           ^^^^^^^^^^
Shouldn't that be -border=>0);

I gave up with image buttons after wasting some serious time 
trying to get it to work in CGI. 

-- 
Cheers
Steve              email mailto:steve@zeropps.uklinux.net

%HAV-A-NICEDAY Error not enough coffee  0 pps. 

web http://www.zeropps.uklinux.net/

or  http://start.at/zero-pps

  2:53pm  up 106 days, 15:41,  2 users,  load average: 1.06, 1.03, 1.00


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

Date: Sat, 19 May 2001 16:40:49 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: image_button and onClick???
Message-Id: <Pine.LNX.4.30.0105191627590.21301-100000@lxplus003.cern.ch>

On 19 May 2001, Steve wrote:

> I gave up with image buttons after wasting some serious time
> trying to get it to work in CGI.

How to work with image buttons would be on-topic for either
comp.infosystems.www.authoring.html [1] or comp.lang.javascript,
depending on what you want them to do.

Once you know what HTML you want to produce, then how to generate it
from a CGI script (if there's a problem with that, which there
shouldn't be) would be on-topic for comp.infosystems.www.authoring.cgi

Which would also be a good place to discuss how to field the submitted
input, if that's what you want to do.  (But the reference to onClick
suggests otherwise...)

If you're having problems with CGI.pm (a Perl module) then I'd
assume that your question would be at home on comp.lang.perl.modules.

I don't perceive a Perl language question here yet.

f'ups prophylactically set, feel free to pick an appropriate group.

good luck

[1] It's really nice to get the occasional HTML topic on c.i.w.a.html:
most of the time it seems to be used as a trashcan for anything that's
vaguely WWW related.  Rather like c.l.p.misc seems to get used as a
dumping ground for all kinds of question that just happen to be
programmed in Perl.  Sigh.




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

Date: Sat, 19 May 2001 14:21:32 +0100
From: "Ciaran McCreesh" <keesh@users.pleaseremovethisbit.sourceforge.net>
Subject: Re: Is this ok?
Message-Id: <9e5rsc$lq2$1@newsg2.svr.pol.co.uk>

In article <TItN6.6713$ML4.504759@nnrp4.clara.net>, "Jon"
<jon@officedevil.com> wrote:
>> Just how secure do you need? What you suggest is fine for moderate
>> security, but I wouldn't use it for sending any confidential
>> information. If you're selling, this isn't enough...
> 
> This will be used as a login to a free web based email newsletter
> management - like a listbot type service.  Everything is based over my
> secure server.  So we are not talking about protecting credit card
> details in the login area.

So long as you don't use the same username and password combinations for
anything secure, that's OK I suppose.

>> Surely an attacker could simply duplicate this cookie and feed it to
>> your script? Are you reseting the time limit every time a transaction
>> is made, or are you limiting logged in time to 2 hours? If the former,
>> drop the time down to 10 minutes or so.
> 
> Yeah of course, but the cookie is a cripted version of a 20 chacture
> string which is made up from a random load of letters and numbers, in
> both upper case and lower, so they would need to do some guessing first.

Or, if they are able to observe the original transmission, simply copy
the cookie from the message and stick it into the HTTP request they send
out when trying to hack your server...

That's the problem with HTTP without the S. Everything is transmitted in
(near-enough) plaintext (except digest, anyway). Things that you think
are secure aren't... I suppose it depends upon how much security matters.

-- 
Ciaran McCreesh
mail:    keesh@users.sourceforge.net
web:     http://www.opensourcepan.com/


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

Date: 19 May 2001 14:38:48 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: keys to variable names, or variable names to keys?
Message-Id: <9e60ho$g2n$5@bob.news.rcn.net>

Charles K. Clarkson <c_clarkson@hotmail.com> wrote:

>     Is there a reason for not using the MAXLENGTH attribute
> for <INPUT>?

>     I tried it on IE and I was limited to 10 characters of input with:

> <input type="text" name="field_name" size=50 maxlength=10 />

>     I don't play with CGI much, though. Do some browsers ignore
> MAXLENGTH?

A server-side process can *never* rely on anything client-side to impose 
restrictions on what the process retrieves.  It has no way of knowing 
whether the client-side restrictions were even applied.  A sufficiently 
curious person might just save your form to disk, edit it to take out the 
MAXLENGTH, and put in a really long string just to see what happens.  Code 
that assumes that Murphy's Law has been repealed is, by definition, bad 
code.



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

Date: Sat, 19 May 2001 07:48:48 -0700
From: "Webmaster" <webmaster@eyeonthe.net>
Subject: Multiple Functions-Same Script/
Message-Id: <tgd1t15rn04gdd@corp.supernews.com>

Is it possible to have mutiple actions posted within the same script?
i.e.
User enters HTML form info.
Info is sorted and posted to more than one?

Thanks




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

Date: 19 May 2001 13:53:28 GMT
From: steve@zeropps.uklinux.net (Steve)
Subject: Re: oh c'mon please, one of you perl/unix gurus!!!
Message-Id: <slrn9gcuke.pep.steve@zero-pps.localdomain>

On Sat, 19 May 2001 12:57:15 GMT, Franco Luissi wrote:

>put its address in the #! line it still runs from the command line but
>*breaks* as a CGI - i think maybe from the command line its still
>running the old perl5 regardless of the #! actually...it could be that
>my installation of perl5.6 is broken but i just want to find out if that

The webserver can't see 5.6 because it wasn't there when the web server was
built.  Looks like you're snookered. 

To find the web server, assuming it's ip address is 10.201.11.0 do:

[user@somewhere]$ telnet 10.201.11.0 80

you'll see this:
 
Trying 10.201.11.0...
Connected to localhost.localdomain.
Escape character is '^]'.

Then type this:

HEAD / HTML/1.1

Then press enter one more time and you'll see this:

Host: 10.201.11.0

HTTP/1.1 200 OK
Date: Tue, 16 May 2000 15:37:53 GMT
Server: Apache/1.3.6 (Unix)  (Red Hat/Linux)
Last-Modified: Fri, 12 May 2000 17:55:01 GMT
ETag: "7203e-799-391c4575"
Accept-Ranges: bytes
Content-Length: 1945
Connection: close
Content-Type: text/html

Connection closed by foreign host.
[user@somewhere]$ 

Hope some of that helps, but really you need to get the admins to 
rebuild or reconfigure the server. 

-- 
Cheers
Steve              email mailto:steve@zeropps.uklinux.net

%HAV-A-NICEDAY Error not enough coffee  0 pps. 

web http://www.zeropps.uklinux.net/

or  http://start.at/zero-pps

  2:35pm  up 106 days, 15:23,  2 users,  load average: 1.00, 1.03, 1.00


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

Date: 19 May 2001 07:53:56 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Pronouncing ISA
Message-Id: <m1g0e1wfsr.fsf@halfdome.holdit.com>

>>>>> ""Richard" == "Richard Stands" <rstands@hotmail.com> writes:

"Richard> I thought this was funny. In my (ActiveState) Perl documentation it says:
"Richard> "This magical @ISA variable (pronounced ``is a'' not ``ice-uh'')".

"Richard> Uh, OK... what? After all that is it "iz uh" or "iz ay"? I mean
"Richard> really, 'cause I'm not gonna spend one more dime of my company's $$$
"Richard> until I can properly pronounce the magical ISA! ;o) Cheers.

Well, I put that in there because I had someone come up to me in class
one day and started asking about the "ice-uh" variable, kinda like
"ISO standard".  And he didn't grok the meaning until I said that it
was "iz uh", as in "this is a that".  Bing!  His eyes lit up.  So I
added the pronunciation guide in hopes to clarify that for others.
Maybe it'll help 1% of the readers with that "a-ha" feeling.

print "Just another Perl hacker,"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Sat, 19 May 2001 14:37:34 GMT
From: AvA <a.v.a@home.nl>
Subject: regex 
Message-Id: <3B065D48.8D2B01E5@home.nl>

hi,

I am trying to match a 3 character string with : =~ /\w{3,3}/;


this matches any string with 3 or more characters however, even 4.
how do i get it to recognize just 3 characters?



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

Date: Sat, 19 May 2001 14:56:40 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: regex 
Message-Id: <slrn9gd2d8.1g0.garry@zfw.zvolve.net>

On Sat, 19 May 2001 14:37:34 GMT, AvA <a.v.a@home.nl> wrote:
> hi,
> 
> I am trying to match a 3 character string with : =~ /\w{3,3}/;
> 
> 
> this matches any string with 3 or more characters however, even 4.
> how do i get it to recognize just 3 characters?

It's even worse than that: /\w{1}/ matches strings of 500 word
characters!  

You probably want /^\w{3}$/.  

-- 
Garry Williams


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

Date: 19 May 2001 14:54:23 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: regex
Message-Id: <9e61ev$7fq$3@mamenchi.zrz.TU-Berlin.DE>

According to AvA  <a.v.a@home.nl>:
> hi,
> 
> I am trying to match a 3 character string with : =~ /\w{3,3}/;
> 
> this matches any string with 3 or more characters however, even 4.
> how do i get it to recognize just 3 characters?

You anchor it: /^\w{3}$/

Anno


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

Date: 19 May 2001 07:56:25 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: regex
Message-Id: <m18zjtwfom.fsf@halfdome.holdit.com>

>>>>> "AvA" == AvA  <a.v.a@home.nl> writes:

AvA> hi,
AvA> I am trying to match a 3 character string with : =~ /\w{3,3}/;


AvA> this matches any string with 3 or more characters however, even 4.
AvA> how do i get it to recognize just 3 characters?

You're missing the "anchors", formally called "zero-width assertions",
such as

        /^\w{3}$/

although this also matches "foo\n", for which you need to get picky
and type:

        /\A\w{3}\z/

A regex that is not anchored is free to float wherever it needs in
the string.

print "Just another Perl hacker," =~ /([\w\W])/g

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Sat, 19 May 2001 13:15:56 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: Taint
Message-Id: <slrn9gcsgc.1ds.garry@zfw.zvolve.net>

On Thu, 17 May 2001 06:22:28 GMT, Dodger <dodger@necrosoft.net> wrote:
> "Chris Stith" <mischief@velma.motion.net> wrote in message
> news:tg5tm6219h8pa5@corp.supernews.com...
> 
>> If I'm running setuid, you'd better believe I want to know
>> what it is I'm doing with which datum. The higher the
>> program's access to the system, the _more_ you want the
>> protection of tainting data.
>>
>> There are secure ways to untaint data. You don't have to
>> rely on a completely unsafe way to do it in order to use
>> the value of a variable.
> 
> *sigh*
> 
> I have grown rather tired with explaining the exact situation I am
> concerning myself with.
> 
> Here goes one last time.

[snip]

>     However, once the UID is set, the taint still remains. Thus, 'blindly
> untainting' is equivalent to running the script normally under their
> permissions, as if they ran it. setuid is only there to allow authentication
> and to switch to the user's uid after such. Nothing taintable runs or should
> run before switching to the user's uid. However, Taint mode remains, because
> there is no such thing as 'no Taint'.

*sigh*  

exec()

-- 
Garry Williams


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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.

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 V10 Issue 938
**************************************


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