[11824] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5424 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 20 02:07:26 1999

Date: Mon, 19 Apr 99 23:00:20 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 19 Apr 1999     Volume: 8 Number: 5424

Today's topics:
    Re: accepting input with space (Tad McClellan)
    Re: Another bug in Perl? <uri@home.sysarch.com>
    Re: Another bug in Perl? (Abigail)
    Re: Any source of writing chat room on homepage? (Abigail)
    Re: blank form fields (Ronald J Kimball)
    Re: CGI programmer wanted (Abigail)
    Re: CGI/Telnet?? (Abigail)
        DBM and Perl jas237@superlink.net
    Re: Eliminate to another array <uri@home.sysarch.com>
    Re: Eliminate to another array (Larry Rosler)
    Re: Eliminate to another array (Larry Rosler)
    Re: for (my $i;;) doesn't work like I think it should <uri@home.sysarch.com>
    Re: for (my $i;;) doesn't work like I think it should (Ronald J Kimball)
        Fork() and defunct state problem <dumar@mailexcite.com>
    Re: Interpolating Variables for 'use' <uri@home.sysarch.com>
    Re: Making grep insensitive (Greg Bacon)
    Re: Making grep insensitive <uri@home.sysarch.com>
    Re: Making grep insensitive <slanicky@students.uiuc.edu>
    Re: Making grep insensitive <paladin@uvic.ca>
    Re: need help bad (Abigail)
    Re: Need info on Perl vs. VB for manager persuasion <metcher@spider.herston.uq.edu.au>
    Re: New FAQ: How can I read in an entire file all at on (Abigail)
    Re: New FAQ: How can I read in an entire file all at on <uri@home.sysarch.com>
    Re: New FAQ: How can I read in an entire file all at on <dgris@moiraine.dimensional.com>
        open programs from cgi <fortyoz@home.com>
    Re: Wanna post, need programmer help (Abigail)
    Re: Wanna post, need programmer help <wyzelli@yahoo.com>
    Re: Wanted: some help for a perl script (Abigail)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Mon, 19 Apr 1999 19:26:42 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: accepting input with space
Message-Id: <i3egf7.n53.ln@magna.metronet.com>

seemas@my-dejanews.com wrote:

: I'm a newbie to perl/cgi programming. How can I accept a firstname+lastname
: set with a space in the middle and pass it on as one quoted value.


   The same way that you would accept input without a space.

   Spaces in the input do not matter.


   What is your real problem?


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 20 Apr 1999 00:01:04 -0400
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: Another bug in Perl?
Message-Id: <x7676skkjj.fsf@home.sysarch.com>

>>>>> "AH" == Andrew Haveland-Robinson <andy@-nospam-haveland.com> writes:

  AH> However, it still doesn't explain why my fix worked by
  AH> successfully translating the newline without the s option!

i don't have your working code handy but IIR you were doing a split //
on the string. that splits all chars regardless if they are \n so your
hex escape works just fine.

  >>> $msgdec =~ s/(.)/uc sprintf("%02x",ord($1))/eg;

and by using %02X you don't need the uc op!!

also there is a pack format for hex and modules which support various forms
of escape for you.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 20 Apr 1999 04:08:25 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Another bug in Perl?
Message-Id: <7fgujp$hvg$3@client2.news.psi.net>

Andrew Haveland-Robinson (andy@-nospam-haveland.com) wrote on MMLVII
September MCMXCIII in <URL:news:37289465.287663906@news.demon.co.uk>:
~~ 
~~ You would think this works OK...
~~ 
~~ sub encode_string() {
~~ 	my $msgdec = shift;
~~ 	$msgdec =~ s/(.)/uc sprintf("%02x",ord($1))/eg;
~~ 	return $msgdec;
~~ 	} 
~~ 
~~ Well, 99.61% of the time it does... until $msgdec contains an LF
~~ The LFs in the string are returned untouched.

As it is supposed to be. Study regexes again, and see what `.'
stands for. Especially, take notice of what it *doesn't* stand
for. Now, after you've done that, look up the flags and see which
flag to use to have `.' stand for where it doesn't stand for 
without the flag.



Abigail
-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"


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

Date: 20 Apr 1999 04:10:39 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Any source of writing chat room on homepage?
Message-Id: <7fgunv$hvg$4@client2.news.psi.net>

Carfield Yim (carfield@polyu.hknet.com) wrote on MMLVI September MCMXCIII
in <URL:news:3719EB68.B1965A8C@polyu.hknet.com>:
-- As title, Can I write the ICQ chat room like thing and play it at
-- browser?


Perhaps. Since you have to ask, I estimate the probability that
you can is less than 25%.


Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


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

Date: Tue, 20 Apr 1999 01:10:09 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: blank form fields
Message-Id: <1dqj9wz.y1zvdxj7lyv6N@[207.60.170.94]>

David Cassell <cassell@mail.cor.epa.gov> wrote:

> mikej wrote:
> > 
> > I need a way of telling if someone left a form text field blank. I tried
> > this:
> > 
> > if (defined $survey_form{'comments_need_for_solutions_brochures'}) {
> >         $solbro_comments = $solbro_comments + 1;
> > }
> > 
> > but even when I leave that text field blank and submit the form, the
> > script will see the
> > defined statement as true and increment the $solbro_comments variable
> > when its not
> > supposed to. I only want it to increment $solbro_comments if the text
> > field had
> > something entered into it. Any tips?
> 
> Yes.  defined() doesn't work like this on hashes and arrays.

Irrelevant and misleading.


> On a 
> hash element, it only tells you whether the value is defined.  NOT
> whether the key has an entry in the hash table.
> 
> If you had read the perlfunc section, it would have told you this,
> and even told you what the answer is.  Try using exists() instead.

If

  defined($hash{'key'})

evaluates to true, then you can be pretty certain that

  exists($hash{'key'})

will also be true.  It's rather hard for a value to be defined for a key
that doesn't exist...


> Another tip: overuse of defined() leads to embarrassing glitches.
> Did you know that the number 0 and the zero-length string "" are
> both defined values?  False, but defined.

Now you're getting somewhere...  Presumably, the value in the hash
is "", or " ", or "\n", or some other 'blank' string.  Something like

  defined($hash{'key'}) && $hash{'key'} =~ /\S/

would be a more useful expression.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 20 Apr 1999 04:20:44 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: CGI programmer wanted
Message-Id: <7fgvas$hvg$6@client2.news.psi.net>

Diablo Killuminati (diablo@livenet.net) wrote on MMLVII September
MCMXCIII in <URL:news:371a91da.11269790@news.erols.com>:
== I opperate a couple of new adult sites

Oh, a site full with new adults!

==                                            I am in need of a good CGI
== programmer.  

Yes? And?  Your posting is a simple statement, with no Perl
content. Are you sure you have posted your entire article?



Abigail
-- 
perl -wlpe '}$_=$.;{' file  # Count the number of lines.


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

Date: 20 Apr 1999 04:18:46 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: CGI/Telnet??
Message-Id: <7fgv76$hvg$5@client2.news.psi.net>

Z Trexler (ztrexler@heehaw.com) wrote on MMLVIII September MCMXCIII in
<URL:news:7fgiqj$d1j$1@nnrp1.dejanews.com>:
{} I own a WebTV, but I am also an intermediate web developer at a university. 

Goodie. An intermediate web developer. I guess we get a well phrased, to
the point question, and not a "I wanna do this, and I've no clue where to
start". After all, you are intermediate. And you own a WebTV.

{} I want to find a way to write a CGI script that allows me to telnet from my
{} WebTV. Keep in mind that WebTV has no java capabilities, and obviously no
{} built-in telnet program.

I suggest you start with studying the telnet protocol, and while you are
doing that, figure out which of the languages supported by WebTV you want
to write your telnet client in.

What do you say? WebTV doesn't have support for any language? Well.....
then maybe it's impossible.

{} Apparently someone actually has created one before, at hypermart.com, but it
{} was removed because of heavy traffic.  I never saw it, and have only heard
{} about it.

Uhm, yeah. Sure. Did you write hypermart.com about it?


Now, what was your Perl question again?


Abigail
-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"


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

Date: Tue, 20 Apr 1999 04:34:35 GMT
From: jas237@superlink.net
Subject: DBM and Perl
Message-Id: <7fh04r$odu$1@nnrp1.dejanews.com>

This is my first attempt writing perl code.  I am trying write a Perl script
that will read a record from a DBM file, increment one of the values, delete
the orginal record, and then write the updated record back to the DBM file. 
The script that I wrote reads the file, increments the value, deletes the
orginal record, but does not write the updated record back to the DBM file. 
Below is what I have written.  Can anyone advise me on what I am doing wrong
or is there an easier way to change a value within a record.

Thanks
Jim

#! /usr/local/bin/perl
use DB_File;
use Fcntl;
require("cgi-lib.pl");

&ReadParse(*input);

print &PrintHeader;
$file="items";

$database=tie(%db, 'DB_File', $file, O_RDWR|O_CREAT, 0770) || die "can't";

print <<"HTML";
<html>
<head>
<title></title>
</head>

<body bgcolor="#FFFFFF">
<img src="../auction/images/logo_small.jpg" width="211" height="90">
<br>
HTML

 while (($key,$value)= each(%db))
 {
   @part = split(/:/,$value);
   if ($key =~ /$input{'number'}/i)
   {
     delete $db{$key};
	 $part[8]++;

	 print "Test";
   }

 }

$db{$key}=join(":",$part[0],$part[1],$part[2],$part[3],$part[4],$part[5],$part[6
],$part[7],$part[8]);

untie(%db);
undef($database);

print <<"HTML";
<table width="75%" border="0" align="center" bgcolor="#FF0033">
  <tr>
    <td>&nbsp; </td>
  </tr>
</table>
<center>
<a href=""></a>
</center>
</body>
</html>
HTML

exit;

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 20 Apr 1999 00:26:39 -0400
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: Eliminate to another array
Message-Id: <x7r9pfkjcw.fsf@home.sysarch.com>

>>>>> "T" == Tong  <555034897s@acadiau.ca> writes:

  T> Suppose  the  array @a0 has two kinds of entries, the ones that begin
  T> with  'aaa' and the ones do not. How I can pick out the array entries
  T> that  begin  with  'aaa' into another array, while left those entries
  T> that  don't begin with 'aaa' in @a0?

  T> But can I do it with one function call, say using a map or sth? i.e.

perl -le '@a =qw( a1 b a4 c a45 r);
	  @b=grep {push(@c, $_) && 0  unless /^a/} @a;
	  print "@b | @c"'

a1 a4 a45 | b c r

hth,

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Mon, 19 Apr 1999 22:09:29 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Eliminate to another array
Message-Id: <MPG.1185abd93965e5fe9898e6@nntp.hpl.hp.com>

In article <371BE3E5.5DF6@acadiau.ca> on Mon, 19 Apr 1999 23:18:14 -
0300, Tong <555034897s@acadiau.ca> says...
+ Suppose  the  array @a0 has two kinds of entries, the ones that begin
+ with  'aaa' and the ones do not. How I can pick out the array entries
+ that  begin  with  'aaa' into another array, while left those entries
+ that  don't begin with 'aaa' in @a0?
+ 
+ I know I can do it in three line of codes:
+ 
+ @a1=grep(/^aaa/, @a0)
+ @a2=grep(!/^aaa/, @a0)
+ @a0=@a2;
+ 
+ But can I do it with one function call, say using a map or sth? i.e.
+ 
+ @a1=pick_out_then_remove(/^aaa/, @a0)

I can name that tune in one line of code:

@a0 = map { /^aaa/ ? do { push @a1, $_; () } : $_ } @a0;

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Mon, 19 Apr 1999 22:40:47 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Eliminate to another array
Message-Id: <MPG.1185b33d883cfbd39898e7@nntp.hpl.hp.com>

In article <MPG.1185abd93965e5fe9898e6@nntp.hpl.hp.com> on Mon, 19 Apr 
1999 22:09:29 -0700, Larry Rosler <lr@hpl.hp.com> says...
 ... 
> @a0 = map { /^aaa/ ? do { push @a1, $_; () } : $_ } @a0;

I like Uri's grep much better (but somewhat simplified, IMO):

  @a0 = grep !/^aaa/ || (push(@a1, $_), 0), @a0;

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 20 Apr 1999 00:12:37 -0400
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: for (my $i;;) doesn't work like I think it should
Message-Id: <x7yajoj5fu.fsf@home.sysarch.com>

>>>>> "r" == raylutz  <raylutz@adaptra.com> writes:
>>>>> "r" == raylutz  <raylutz@adaptra.com> writes:

  r>     # pass one
  r>     my $i; my $j = 0;
  r>     for ($i = 0; $i < 8; $i++) {
  r>         print "pass 1: \$i=$i\n";
  r>         $j++;
  r>         }

  r>     print "Pass 1 End: \$j = $j;\n\n";

  r>     # pass two
  r>     my $j = 0;
  r>     for (my $i = 0; $i < 8; $i++) {
  r>         print "pass 2: \$i=$i\n";
  r>         $j++;
  r>         }

  r>     print "Pass 2 End: \$j = $j;\n\n";

  r> pass 1: $i=0
  r> pass 1: $i=1
<snip>
  r> pass 1: $i=7
  r> Pass 1 End: $j = 8;

  r> Pass 2 End: $j = 0;

works fine for me. perl 5.004_04. what version are you running? that is
the oldest one that is know to be stable. in fact most should use
5.005_0[23].

uri


-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Tue, 20 Apr 1999 01:10:12 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: for (my $i;;) doesn't work like I think it should
Message-Id: <1dqjbf5.14rhts96le1juN@[207.60.170.94]>

<raylutz@adaptra.com> wrote:

> The only difference between pass one and two is the 'my' in the for().
> According to the perl docs I've read, these SHOULD do the same thing.

Works for me with perl5.004_04.  What version of perl are you using?


pass 1: $i=0
pass 1: $i=1
pass 1: $i=2
pass 1: $i=3
pass 1: $i=4
pass 1: $i=5
pass 1: $i=6
pass 1: $i=7
Pass 1 End: $j = 8;

pass 2: $i=0
pass 2: $i=1
pass 2: $i=2
pass 2: $i=3
pass 2: $i=4
pass 2: $i=5
pass 2: $i=6
pass 2: $i=7
Pass 2 End: $j = 8;

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Tue, 20 Apr 1999 05:10:00 GMT
From: Dumar <dumar@mailexcite.com>
Subject: Fork() and defunct state problem
Message-Id: <371C0C23.52933F5B@mailexcite.com>

Hi;

I am trying to write a perl script which forks a process and waits for
sometime for that process to complete (with sleep) and if it is not
finished, it is trying to kill the process. If the process finishes its
job on time, it simply exits with exit(1) and forks another.

Everything seems fine, the problem is, when you kill the child process
(that was created by fork()) or the child process terminates itself by
exit(1), you see that process in the <defunct> state and after sometime,
a lot of <defunct> processes exist around.

How am I supposed to get rid of these <defunct> processes ? I can't kill
them unless I kill the parent process, but parent process has to live in
an infinite loop so that the program accompishes its objectives.

Thanks ...



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

Date: 20 Apr 1999 00:07:33 -0400
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: Interpolating Variables for 'use'
Message-Id: <x71zhgkk8q.fsf@home.sysarch.com>

>>>>> "KK" == Kubla Khan <kubla_khan@rocketmail.com> writes:

  KK> Since the variable that holds the module name is assigned after
  KK> the BEGIN block, assigning there won't work.  If I try:

  KK> ...  $module = "CGI::Carp"; use $module; ...

  KK> I get a syntax error in the 'use' statement at the '$'.

  KK> I don't want to use 'require' because that will execute my code,
  KK> right?  I only want to execute the subs in the module that are
  KK> relevent to the specific context in which the object was
  KK> instantiated.

both require and use execute all the bare code in a module and all BEGIN
blocks. all the subs are just defined. you need to learn more about the
difference between loading a module (via either technique) and calling
the code in that module.

  KK> What I am trying to do is 'use' a module that I wrote, instantiate
  KK> a new instance of it using its' 'new' constructor, and then
  KK> execute some (not all) of the methods in the module by specific
  KK> calls.  I don't know what the module name is until portions of the
  KK> program have executed.  Is there a way to instantiate new module
  KK> objects without using the 'use' method first?  Or, is there a way
  KK> to make the 'use' statement interpolate the variable as the module
  KK> name string that it is?

do a require at runtime and them an import if needed. use doesn't
instantiate anything, it only loads and executes a module. so does
require. see my comments above about loading code.

if you require a variable, just make sure it has the correct file name
with the right suffix, etc.

uri


-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 20 Apr 1999 04:12:30 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Making grep insensitive
Message-Id: <7fgure$473$2@info2.uah.edu>

In article <Pine.SOL.3.96.990419214801.15929A-100000@ux13.cso.uiuc.edu>,
	Kevin Slanicky <slanicky@students.uiuc.edu> writes:
: How can I make this line case-insensitive?  I've tried many different
: combinations of -i and i and none will compile (server error)  Any
: suggestions?
: 
: @results = grep (/$multiple/, @results);

Did you bother searching the fine perlre manpage for insensitive?

Greg
-- 
Chef: But just remember what I taught you. That football is like making love
      to a really beautiful woman. You can't always score, but when you do, it
      makes all the trying worthwhile.


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

Date: 20 Apr 1999 00:15:08 -0400
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: Making grep insensitive
Message-Id: <x7vhesj5bn.fsf@home.sysarch.com>

>>>>> "KS" == Kevin Slanicky <slanicky@students.uiuc.edu> writes:

  KS> How can I make this line case-insensitive?  I've tried many different
  KS> combinations of -i and i and none will compile (server error)  Any
  KS> suggestions?

  KS> @results = grep (/$multiple/, @results);

hint: it is not a grep problem. grep doesn't care what the expression
is. so what op are you using there? check out its options.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Mon, 19 Apr 1999 23:17:10 -0500
From: Kevin Slanicky <slanicky@students.uiuc.edu>
To: Greg Bacon <gbacon@cs.uah.edu>
Subject: Re: Making grep insensitive
Message-Id: <Pine.SOL.3.96.990419231646.29887A-100000@ux13.cso.uiuc.edu>

Sure did, but didn't come up with anything.  Did I miss something?

On 20 Apr 1999, Greg Bacon wrote:

> Date: 20 Apr 1999 04:12:30 GMT
> From: Greg Bacon <gbacon@itsc.uah.edu>
> Reply-To: Greg Bacon <gbacon@cs.uah.edu>
> Newsgroups: comp.lang.perl.misc
> Subject: Re: Making grep insensitive
> 
> In article <Pine.SOL.3.96.990419214801.15929A-100000@ux13.cso.uiuc.edu>,
> 	Kevin Slanicky <slanicky@students.uiuc.edu> writes:
> : How can I make this line case-insensitive?  I've tried many different
> : combinations of -i and i and none will compile (server error)  Any
> : suggestions?
> : 
> : @results = grep (/$multiple/, @results);
> 
> Did you bother searching the fine perlre manpage for insensitive?
> 
> Greg
> -- 
> Chef: But just remember what I taught you. That football is like making love
>       to a really beautiful woman. You can't always score, but when you do, it
>       makes all the trying worthwhile.
> 
> 



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

Date: Mon, 19 Apr 1999 21:35:40 -0700
From: Draco Paladin <paladin@uvic.ca>
Subject: Re: Making grep insensitive
Message-Id: <Pine.A41.4.05.9904192132160.87152-100000@unix4.UVic.CA>

On Mon, 19 Apr 1999, Kevin Slanicky wrote:

> Sure did, but didn't come up with anything.  Did I miss something?

Are you sure?

=head1 NAME

perlre - Perl regular expressions

=head1 DESCRIPTION

This page describes the syntax of regular expressions in Perl.  For a
description of how to I<use> regular expressions in matching
operations, plus various examples of the same, see discussion
of C<m//>, C<s///>, C<qr//> and C<??> in L<perlop/"Regexp Quote-Like
Operators">.

The matching operations can have various modifiers.  The modifiers
that relate to the interpretation of the regular expression inside
are listed below.  For the modifiers that alter the way a regular
expression
is used by Perl, see L<perlop/"Regexp Quote-Like Operators"> and 
L<perlop/"Gory details of parsing quoted constructs">.

=item i

Do case-insensitive pattern matching.
        ^^^^^^^^^^^
If C<use locale> is in effect, the case map is taken from the current
locale.  See L<perllocale>.


-- 
Mother is the name for GOD on the lips and
hearts of all children.  - Eric Draven



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

Date: 20 Apr 1999 04:25:07 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: need help bad
Message-Id: <7fgvj3$hvg$7@client2.news.psi.net>

Nathan Nakao (rusty7@cchono.com) wrote on MMLVI September MCMXCIII in
<URL:news:7fdlvh$g16$1@eskinews.eskimo.com>:
:: I don't know.  I guess I'm just not gettting it. I have a quick question.
:: 
:: I'm trying to run a formmail.pl script but everytime I execute it from a
:: html form I get a "Method not implemented" error.  what' am I doing wrong?


There's an error in line 17.

Note that 'Method not implemented' isn't a Perl error, so your problem
doesn't look like a Perl problem to me. 


Abigail
-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"


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

Date: Tue, 20 Apr 1999 14:37:14 +1000
From: Jaime Metcher <metcher@spider.herston.uq.edu.au>
Subject: Re: Need info on Perl vs. VB for manager persuasion
Message-Id: <371C047A.21987547@spider.herston.uq.edu.au>

Hmmm...

 . VB support is somewhere on a continuum from "non-existent" to "poor
value for money", depending on how much you pay out. Perl support is
excellent.
 . VB's string handling is atrocious to unusable.
 . VB is less reliable.
 . VB is published by a company that has a demonstrated commitment to
planned obsolescence (i.e. you've got a choice between the upgrade
treadmill and being orphaned).

But you know all this.  How to convince your manager?  Well, nobody's
going to offer you a peer-reviewed controlled trial.  In the absence of
such data, a good manager calls in the expert (you) and relies on that
expert's judgement.  A manager doesn't have know programming - she just
has to know programmers, so as not to hire a schmuck.  Having not hired
a schmuck, she should listen to what her non-schmuck says.  Otherwise
she's a schmuck for hiring someone she can't trust.

Apart from that, I wish there was some way of measuring the emotional
tone of a newsgroup.  Reading a Microsoft ng is like wandering through
the lost souls in the underworld.  clp* are much more like bars where
you'd like to drink.  I know a pilot's favourite plane isn't necessarily
going to be the most suitable for the passengers, but there must be
something in it.

-- 
Jaime Metcher

Keith Phillips wrote:
> 
> The IT manager at my company wants me to come up with a Perl-
> vs-VB point sheet.  I checked the FAQs, but came up empty.  Is
> there already a document somewhere that compares Perl to VB?
> 
> [ ... or do I need to write one and post it for all to use? :-) ]
> 
> ---------------------------------------------------------------
> | Keith Phillips         User: "Um, I can't find my files..." |
> | kdp@hom.net           Admin: "Files?  What files?"          |
> ---------------------------------------------------------------


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

Date: 20 Apr 1999 04:33:01 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: New FAQ: How can I read in an entire file all at once?
Message-Id: <7fh01t$hvg$8@client2.news.psi.net>

Uri Guttman (uri@home.sysarch.com) wrote on MMLV September MCMXCIII in
<URL:news:x7yajrkmz1.fsf@home.sysarch.com>:
<> >>>>> "DG" == Daniel Grisinger <dgris@moiraine.dimensional.com> writes:
<> 
<> select doesn't work on regular files, only on sockets, pipes and
<> tty's. regular files are effectively always ready for i/o so they
<> wouldn't block on select.

Eh? In Unix, everything is a file. sockets, pipes, ttys, files, there's
no basic difference. You *can* do a select() on a filehandle.



Abigail
-- 
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))


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

Date: 20 Apr 1999 00:56:16 -0400
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: New FAQ: How can I read in an entire file all at once?
Message-Id: <x7ogkjkhzj.fsf@home.sysarch.com>

>>>>> "A" == Abigail  <abigail@fnx.com> writes:

  A> Uri Guttman (uri@home.sysarch.com) wrote on MMLV September MCMXCIII in
  A> <URL:news:x7yajrkmz1.fsf@home.sysarch.com>:
  A> <> >>>>> "DG" == Daniel Grisinger <dgris@moiraine.dimensional.com> writes:
  A> <> 
  A> <> select doesn't work on regular files, only on sockets, pipes and
  A> <> tty's. regular files are effectively always ready for i/o so they
  A> <> wouldn't block on select.

  A> Eh? In Unix, everything is a file. sockets, pipes, ttys, files, there's
  A> no basic difference. You *can* do a select() on a filehandle.


both poll and select support regular files but they make little sense in
that context. regular files don't block on i/o in the same way as the
others. the file system buffers are in the way and so regular files are
almost always writable and only readable when the next block is in the
cache. you have no control over the cache so you don't know how the
poll/select will behave. it is better to use the async I/O facility or a
forked process which can block for you. i have done many poll/select
based servers and never used those calls for regular file I/O.

for example, if you seek to a place in a file to read it, and then poll
that fd, does that force a read of the next block into the cache? it is
just not a good idea to use those calls with regular files.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 19 Apr 1999 23:47:09 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: New FAQ: How can I read in an entire file all at once?
Message-Id: <m3676ru9lu.fsf@moiraine.dimensional.com>

Uri Guttman <uri@home.sysarch.com> writes:

<snip don't use select on regular files>

> is is just not a good idea to use those calls with regular files.

I don't write many apps that bother to distinguish between
local and remote resources.  Genericity, abstraction, and
all that.

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: Tue, 20 Apr 1999 05:06:28 GMT
From: David Raufeisen <fortyoz@home.com>
Subject: open programs from cgi
Message-Id: <371CB421.7F71BA5A@home.com>

In my cgi i'm trying to do the following

open MAIL,"|/bin/mail -s \"subject\" fortyoz\@home.com";
print MAIL "This is an email message";
close(MAIL);

the script runs.. and this works perfectly as a stand alone perl
program.. but when run as a perl cgi script ,it gets to that point in
the cgi the script and just exits.. any idea how i can fix this?

also i'd like this cgi script to run as the user named feedback .. i
tried chown feedback script.cgi ; chmod +s script.cgi

is that how to do it?

thanks for your help.


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

Date: 20 Apr 1999 05:13:20 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Wanna post, need programmer help
Message-Id: <7fh2dg$j97$1@client2.news.psi.net>

jeanb (jean_barry@my-dejanews.com) wrote on MMLVII September MCMXCIII in
<URL:news:7fg92b$4eo$1@nnrp1.dejanews.com>:
\\
\\ Can someone tell me what's going on.

Well, Tammy-Lee and Johnny got married; forced by their parents because
Tammy-Lee is pregnant. Fred, Johnny's little brother ran away from home,
and has been missing for nine days now, missing the wedding. Elmer,
Tammy-Lee's nephew acted as a stand-in ring bearer. The wedding features
17 female relatives and friends, and 2 males ones with tears.

In the mean while, the Torkinstons have reopened their hardware store,
less than 6 weeks after the fire; the fire in which Andy Barnes died.
Or didn't he? His body was never recovered. Marion Barnes has hired a
Francisco, a lawyer to collect the life insurance money of Andy; but
Mr Hayes of the insurance company is unwilling to pay as there is no
proof Andy died in the fire. The tall, brown eyed Francisco does more
for Marion than going after the money; he comforts Marion with her loss
till late in the night, and has his own toothbrush in Marions bathroom.

Tammy-Lee's father, Jake Norton is in deep financial problems, but he
manages it to hide it for everyone, except his loyal secretary, Ellen-Sue.
It is very likely that Reina, Jake's ex-wife and mother of Tammy-Lee,
who ran away from the family when Tammy-Lee was 6 months old, is behind
Gold Pine, Inc, the new lumber company to which most of Jakes customers
have switched to, even though Gold Pine has much higher prices. The loss
of customers is the root of the financial problems of Jake.

Danny Norton, Jake's half-brother and father of Elmer has decided to run
for sheriff, now that old Hughes has decided to retire in two months.
Danny's decision only increased the tention between him and Barbara,
his wife. Barbara has taken revenge by sleeping with Francisco. Danny
knows, but with his history of being unfaithful, he keeps his mouth shut.
However, Lady Hazel, the neighbour of Barbara and Danny knows too, and 
Lady Hazel and Marion are good friends. 

Furthermore, the sister Anna and Michelle von Bierhausen and Rachel
Johnson plot together to participate in next weeks "Miss Swimsuit
Springfield", while they know their parents would never allow that. They
are unware of the plans of their class mates, Ralph, Gus, Scott and
Raymond to sneak off and go to Springfield to watch the "Miss Swimsuit"
contest.

The popular geography teacher Mr. Drake gets a blackmail letter that
says that the sender of the letter has proof that Mr. Drake is gay,
but that the secret is safe with him, as long as a certain student gets
A grades. To this point, it is not clear which student that is.

Mr White, the 85 year old with no family has finally had the courage
to ask Mrs Belvedere out for dinner. She said yes, and they agreed on
next Friday.


End of this weeks summary of comp.perl.lang.misc. 

Next week, same perlchannel, same perltime.


Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


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

Date: Tue, 20 Apr 1999 15:17:13 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Wanna post, need programmer help
Message-Id: <AxUS2.53$my2.5486@vic.nntp.telstra.net>

You got too much time on your hands Abigail!!

lol
Wyzelli
Abigail wrote in message <7fh2dg$j97$1@client2.news.psi.net>...
>jeanb (jean_barry@my-dejanews.com) wrote on MMLVII September MCMXCIII in
><URL:news:7fg92b$4eo$1@nnrp1.dejanews.com>:
>\\
>\\ Can someone tell me what's going on.
>
>Well, Tammy-Lee and Johnny got married; forced by their parents because
>Tammy-Lee is pregnant. Fred, Johnny's little brother ran away from home,
>and has been missing for nine days now, missing the wedding. Elmer,
>Tammy-Lee's nephew acted as a stand-in ring bearer. The wedding features
>17 female relatives and friends, and 2 males ones with tears.
>
>In the mean while, the Torkinstons have reopened their hardware store,
>less than 6 weeks after the fire; the fire in which Andy Barnes died.
>Or didn't he? His body was never recovered. Marion Barnes has hired a
>Francisco, a lawyer to collect the life insurance money of Andy; but
>Mr Hayes of the insurance company is unwilling to pay as there is no
>proof Andy died in the fire. The tall, brown eyed Francisco does more
>for Marion than going after the money; he comforts Marion with her loss
>till late in the night, and has his own toothbrush in Marions bathroom.
>
>Tammy-Lee's father, Jake Norton is in deep financial problems, but he
>manages it to hide it for everyone, except his loyal secretary, Ellen-Sue.
>It is very likely that Reina, Jake's ex-wife and mother of Tammy-Lee,
>who ran away from the family when Tammy-Lee was 6 months old, is behind
>Gold Pine, Inc, the new lumber company to which most of Jakes customers
>have switched to, even though Gold Pine has much higher prices. The loss
>of customers is the root of the financial problems of Jake.
>
>Danny Norton, Jake's half-brother and father of Elmer has decided to run
>for sheriff, now that old Hughes has decided to retire in two months.
>Danny's decision only increased the tention between him and Barbara,
>his wife. Barbara has taken revenge by sleeping with Francisco. Danny
>knows, but with his history of being unfaithful, he keeps his mouth shut.
>However, Lady Hazel, the neighbour of Barbara and Danny knows too, and
>Lady Hazel and Marion are good friends.
>
>Furthermore, the sister Anna and Michelle von Bierhausen and Rachel
>Johnson plot together to participate in next weeks "Miss Swimsuit
>Springfield", while they know their parents would never allow that. They
>are unware of the plans of their class mates, Ralph, Gus, Scott and
>Raymond to sneak off and go to Springfield to watch the "Miss Swimsuit"
>contest.
>
>The popular geography teacher Mr. Drake gets a blackmail letter that
>says that the sender of the letter has proof that Mr. Drake is gay,
>but that the secret is safe with him, as long as a certain student gets
>A grades. To this point, it is not clear which student that is.
>
>Mr White, the 85 year old with no family has finally had the courage
>to ask Mrs Belvedere out for dinner. She said yes, and they agreed on
>next Friday.
>
>
>End of this weeks summary of comp.perl.lang.misc.
>
>Next week, same perlchannel, same perltime.
>
>
>Abigail
>--
>%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)
((.)
>(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of
Hanoi




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

Date: 20 Apr 1999 05:15:56 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Wanted: some help for a perl script
Message-Id: <7fh2ic$j97$2@client2.news.psi.net>

Marc Herms (marc@mercator.net) wrote on MMLV September MCMXCIII in
<URL:news:37189bfb.24315004@news.tiscalinet.it>:
 .. I have just bought a perl script for site-news and would like to make
 .. some changes. Because I don`t want to bother the company where I
 .. bougth the script, I`d like to have some help from one of you.


Oh, you don't want to bother the company where you bougth the script,
but you have no qualms in bothering the community that does it for
free? That ticks me off. If you buy programs, go to that company for help.



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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