[17033] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4445 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 27 14:05:33 2000

Date: Wed, 27 Sep 2000 11:05:14 -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: <970077914-v9-i4445@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 27 Sep 2000     Volume: 9 Number: 4445

Today's topics:
        Any Win32 registry ACL setting examples? ndwinton@my-deja.com
        Automatic Posting on Forms <zommick@yahoo.com>
    Re: Automatic Posting on Forms <jeff@vpservices.com>
    Re: Automatic Posting on Forms <dsimonis@fiderus.com>
    Re: Automatic Posting on Forms <vf1@smarts.com>
    Re: Candidate for the top ten perl mistakes list (Anno Siegel)
    Re: Candidate for the top ten perl mistakes list <ren.maddox@tivoli.com>
        database <jtjohnston@courrier.usherb.ca>
    Re: database <jeff@vpservices.com>
    Re: database <godzilla@stomp.stomp.tokyo>
    Re: File::Find problem noodle42@my-deja.com
    Re: foreach two elements at a time? <bart.lateur@skynet.be>
    Re: Help with Date <Avi.Mintz@nsc.com>
        Help with Unix processes. (Urgent!) <Torsten.Schindler@ccc.uni-erlangen.de>
    Re: How can I combine regular expressions? (Craig Berry)
        how to share vars at runtime from a safe compartement? lalakaka@my-deja.com
    Re: interpreter optimizations <juex@deja.com>
        Is there some free perl script packget for download? i0519@my-deja.com
    Re: lowercase and UPPERCASE <jeffp@crusoe.net>
    Re: lowercase and UPPERCASE (Craig Berry)
    Re: MySQL vs. mSQL (Mark-Jason Dominus)
        Non Blocking I/O wsprague@my-deja.com
    Re: Non Blocking I/O <anders@wall.alweb.dk>
    Re: Perl and SNMP (Konstantinos Agouros)
        Problem "no such file or directory"when executing Perls <paul.vandevelde@mcd.alcatel.be>
    Re: Problem "no such file or directory"when executing P <pap@sotonians.org.uk>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 27 Sep 2000 15:25:08 GMT
From: ndwinton@my-deja.com
Subject: Any Win32 registry ACL setting examples?
Message-Id: <8qt3ga$1e0$1@nnrp1.deja.com>

Hi,

Does anyone have any examples of manipulating Win32 registry security
attributes using the Win32API Reg[GS]etKeySecurity call? I'd settle for
similar file ACL manipulations if you've got them.

    Thanks,
         Neil


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 27 Sep 2000 08:45:00 -0700
From: "Jordan Zommick" <zommick@yahoo.com>
Subject: Automatic Posting on Forms
Message-Id: <st45dg1cqug96d@corp.supernews.com>

I've got an interesting problem that I need help with. I have an
internal web page form that has a single text box and then the
text is submitted by the user clicking on the submit button.
Problem is that I've got to do this manually about 10000 times
(I've got to enter 10000 names). Does anyone have an idea how I
can do this automatically via javascript, perl, etc?.. I've been
told that I can't change the cgi scripts that are called when
the form is submitted; however, I can change the html page
itself and add my own scripts.

This would save a bunch of time. Any help would be appreciated
greatly! Thanks.






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

Date: Wed, 27 Sep 2000 08:56:05 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Automatic Posting on Forms
Message-Id: <39D21895.2AB5417A@vpservices.com>

Jordan Zommick wrote:
> 
> I've got an interesting problem that I need help with. I have an
> internal web page form that has a single text box and then the
> text is submitted by the user clicking on the submit button.
> Problem is that I've got to do this manually about 10000 times
> (I've got to enter 10000 names). Does anyone have an idea how I
> can do this automatically via javascript, perl, etc?.. I've been
> told that I can't change the cgi scripts that are called when
> the form is submitted; however, I can change the html page
> itself and add my own scripts.

Well, you could get the LWP module to submit the forms for you, but that
seems awfully round-about.  Doesn't the script just put the results in a
database or file and therefore can't you just write a script to add
directly to that database or file?  If not, and you can't change the
script, then copy the script to a new name, modify it to do 10000
inserts from file data rather than once from form data.

-- 
Jeff


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

Date: Wed, 27 Sep 2000 12:01:27 -0400
From: Drew Simonis <dsimonis@fiderus.com>
Subject: Re: Automatic Posting on Forms
Message-Id: <39D219D7.F9A8A776@fiderus.com>

Jordan Zommick wrote:
> 
> I've got an interesting problem that I need help with. I have an
> internal web page form that has a single text box and then the
> text is submitted by the user clicking on the submit button.
> Problem is that I've got to do this manually about 10000 times
> (I've got to enter 10000 names). Does anyone have an idea how I
> can do this automatically via javascript, perl, etc?.. I've been
> told that I can't change the cgi scripts that are called when
> the form is submitted; however, I can change the html page
> itself and add my own scripts.


Perl ne HTML.  Neither Javascript.  Please post in the 
appropriate NG.  In this case, it is likely that you w
would find a better answer in 

	comp.infosystems.www.authoring.html


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

Date: Wed, 27 Sep 2000 12:05:05 -0400
From: "Victor Felix" <vf1@smarts.com>
Subject: Re: Automatic Posting on Forms
Message-Id: <8qt5rh$kv$1@versa.smarts.com>

Jordan,

I ran into something similar recently... I had a cgi script that took web
submissions and put them into a mSQL database. The problem was that many
people wanted to have a way that would automate submissions for them at the
end of every week. What I did was to copy the cgi script (it was perl) and
modify the copy by taking out all the cgi stuff. At the end it was just a
regular perl script with the information they wanted submitted already
inside it. Then I just simply used cron to have the perl script run every
week. I guess for you, what you could do is copy the cgi script and modify
it to read all the names from a file and have this new script do the
processing that the cgi script would have done...

Just a suggestion, and I'm sure there are other and probably better ways of
accomplishing the same goal...

-Victor

"Jordan Zommick" <zommick@yahoo.com> wrote in message
news:st45dg1cqug96d@corp.supernews.com...
> I've got an interesting problem that I need help with. I have an
> internal web page form that has a single text box and then the
> text is submitted by the user clicking on the submit button.
> Problem is that I've got to do this manually about 10000 times
> (I've got to enter 10000 names). Does anyone have an idea how I
> can do this automatically via javascript, perl, etc?.. I've been
> told that I can't change the cgi scripts that are called when
> the form is submitted; however, I can change the html page
> itself and add my own scripts.
>
> This would save a bunch of time. Any help would be appreciated
> greatly! Thanks.
>
>
>
>




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

Date: 27 Sep 2000 15:59:37 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <8qt5h9$u0e$1@lublin.zrz.tu-berlin.de>

Logan Shaw <logan@cs.utexas.edu> wrote in comp.lang.perl.misc:

[...]

>Now, if someone can come up with a plausible mnemonic for the
>operands to splice(), I'll be impressed.  Also, I might start
>using splice(), which I don't right now because I never can
>remember how it works.

splice() works very much like substr().  Just identify everything
from the fourth argument of splice with the fourth argument of
substr.

A significant difference is that splice() isn't an l-value and the
corresponding forms are missing.  Insignificantly, substr() doesn't
have a one-argument form.

Anno


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

Date: 27 Sep 2000 11:25:09 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <m3k8bxree2.fsf@dhcp11-177.support.tivoli.com>

anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) writes:

> Logan Shaw <logan@cs.utexas.edu> wrote in comp.lang.perl.misc:
> 
> A significant difference is that splice() isn't an l-value and the
> corresponding forms are missing.  Insignificantly, substr() doesn't
> have a one-argument form.

Why is that, exactly?  It seems that splice() should be an l-value.

-- 
Ren Maddox
ren@tivoli.com


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

Date: Wed, 27 Sep 2000 02:24:58 -0400
From: jtjohnston <jtjohnston@courrier.usherb.ca>
Subject: database
Message-Id: <39D192BA.2BAB@courrier.usherb.ca>

I have a database that I want to run a student number and password check
through. I can programme for one password, but how can I run through
300?

I access "usr/bin/mail/password.db"

It would use field[1] & field[2] only. field[0], the user's real name, I
use elsewhere.

realname:username:password:
------ snip -------
john:elss001:abcd:
mary:elss002:acbd:
dave:elss003:acdb:
 ...
------ snip -------

I would do something like this, but I need to run a match check on
field[1] and then see if field[2] is correct. How can I do this?

	unless ($in{'Password'} eq $Password)
	{# Username Password is incorrect
	 print "Content-type: text/html\n\n";
	 print "<HTML>\n";
	 print "<HEAD><TITLE>Incorrect Password</TITLE></HEAD>\n";
	 print "<BODY BGCOLOR=GREEN TEXT=YELLOW>\n";
	 print "<B>Your username or password is incorrect!</B>\n";
	 print "</BODY>\n";
	 print "</HTML>\n";
	 exit;
	}else{
	#logon passes and does other things ...
	{

Thanks,

John


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

Date: Wed, 27 Sep 2000 10:00:45 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: database
Message-Id: <39D227BD.506ABD9E@vpservices.com>

jtjohnston wrote:
> 
> I have a database that I want to run a student number and password check
> through. I can programme for one password, but how can I run through
> 300?
> 
> I access "usr/bin/mail/password.db"
> 
> It would use field[1] & field[2] only. field[0], the user's real name, I
> use elsewhere.
> 
> realname:username:password:
> ------ snip -------
> john:elss001:abcd:
> mary:elss002:acbd:
> dave:elss003:acdb:
> ...
> ------ snip -------
> 
> I would do something like this, but I need to run a match check on
> field[1] and then see if field[2] is correct. How can I do this?

Here's one way to do it:

use DBI;
my $dbh=DBI->connect('dbi:RAM:f_dir=/usr/bin/mail',,,{RaiseError=>1})
        or die $DBI::errstr;
$dbh->func({
    file_source => 'password.db'
    table_name  => 'users',
    col_names   => 'realname,username,password',
    sep_char    => ':',
},'import');
my($password) = $dbh->selectrow_array(qq/
    SELECT password FROM users WHERE username = '$in{username}'
/);
if( $password eq $in{password} ) ...

-- 
Jeff


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

Date: Wed, 27 Sep 2000 10:56:33 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: database
Message-Id: <39D234D1.DC17AA31@stomp.stomp.tokyo>

jtjohnston wrote:

(snippage)

> I have a database that I want to run a student number 
> and password check through. I can programme for one 
> password, but how can I run through 300?
 
> It would use field[1] & field[2] only. field[0], 
> the user's real name, I use elsewhere.

> realname:username:password:

> john:elss001:abcd:
> mary:elss002:acbd:
> dave:elss003:acdb:

> I would do something like this, but I need to run a match check on
> field[1] and then see if field[2] is correct. How can I do this?


Some thoughts on this for you. Be sure you understand
this type of system will only protect your cgi script.
No other directories nor files will be protected. This
is not a substitute for .htaccess style protection.

I have removed your last colon from your data base
example. Unless you have another variable or more 
variables following this last colon, it serves no 
purpose and will increase the size of your data 
base needlessly and increase memory usage by
your script, also needlessly.

$data_base represents your data base file open.
$logon and $password represent user input.

My script is split into two subroutines to exemplify
how you may run a security check and run your print
out, each individually. This usually makes programming
a little easier with being able to modify your visitor 
print out without messing with your security routine.

In Nail_Em you will note use of " last; " shown as:

     { $ok = "bugs_bunny"; last; }

This last; will terminate your looping if successful
matches are found, thus saving on processing by moving
on rather than continuing to check remaining data.

My Print_HTML is where you will include html or whatever,
for your print. Notice this format:

print "some words and stuff",
      "more words and junk";

You can leave out multiple print calls by terminating
each print line with a comma rather than a semi-colon
except for your very last line to print. This saves
a bit on your effort, perl core and provides a nice
neat looking document source.

Another method is this:

print "some words and stuff
       more words and junk";

This works fine except your document source
will be messy. It is plain text and will show
the first line at the left margin and, show
the second line indented seven spaces.

I want to be sure by being pedantic, you understand
this style only protects your script; nothing else.


Godzilla!
-- 
Androids And More
  http://la.znet.com/~callgirl/android.html



TEST SCRIPT:
____________


#!/usr/local/bin/perl

print "Content-type: text/plain\n\n";

$data_base = "john:elss001:abcd
mary:elss002:acbd
dave:elss003:acdb";


print "Correct Entries:\n\n";

$logon = "elss002";
$password = "acbd";

&Nail_Em;
&Print_HTML;


print "\n\nIncorrect Entries:\n\n";

$logon = "elmerfudd";
$password = "wasklywabbit";

&Nail_Em;
&Print_HTML;


sub Nail_Em
 {
  @Array = split (/\n/, $data_base);
  $ok = "elmer_fudd";
  foreach $line (@Array)
   {
    ($name, $log, $pass) = split (/:/, $line);
    if (($logon eq $log) & ($password eq $pass))
     { $ok = "bugs_bunny"; last; }
   }
 }

sub Print_HTML
 {
  if ($ok eq "elmer_fudd")
   {
    print "  Yo Bozo! Wrong logon and password!\n",
          "  Your computer monitor will now blow up in your face.";
   }
  elsif ($ok eq "bugs_bunny")
   { print "  Welcome to my collection of personal pornography."; }
 }

exit;



PRINTED RESULTS:
________________


Correct Entries:

  Welcome to my collection of personal pornography.

Incorrect Entries:

  Yo Bozo! Wrong logon and password!
  Your computer monitor will now blow up in your face.


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

Date: Wed, 27 Sep 2000 15:28:01 GMT
From: noodle42@my-deja.com
Subject: Re: File::Find problem
Message-Id: <8qt3lm$1ha$1@nnrp1.deja.com>

In article <u966ni9ipl.fsf@wcl-l.bham.ac.uk>,
  nobull@mail.com wrote:

> > That is, suddenly I don't get any notification of the files in the
> > directories (or subdirectories for that matter).
>
> Try setting $File::Find::dont_use_nlink

That solved it - thank you very much. What's the explanation for that
behaviour (and the solution)?


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 27 Sep 2000 16:58:33 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: foreach two elements at a time?
Message-Id: <dp94tso8rbjcn5llp96s4f27klccqkatuo@4ax.com>

Abigail wrote:

>%% In particular $a and $b. These seem to shout "sort sub!" at me.
>
>Since the code in question is neither a sub, nor does it involve
>sort, that would be a pretty strange reaction.

Well... if you have file-scoped lexicals $a and $b, that will pretty
much mess up any sort subs you may ever want to have in the script.

    my($a, $b);
    print join "\n", sort { $a <=> $b } map { int rand 100 } 1 .. 20;
-->
    Can't use "my $a" in sort comparison at test.pl line 4.

-- 
	Bart.


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

Date: Wed, 27 Sep 2000 19:51:37 +0300
From: Avi Mintz <Avi.Mintz@nsc.com>
Subject: Re: Help with Date
Message-Id: <39D22599.CE6566B1@nsc.com>

did you notice the title to your e-mail ?

you need help getting a date ?

let me guess, are you a computer programmer ?


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

Date: Wed, 27 Sep 2000 17:45:37 +0200
From: Torsten Schindler <Torsten.Schindler@ccc.uni-erlangen.de>
Subject: Help with Unix processes. (Urgent!)
Message-Id: <39D21621.5CF3F279@ccc.uni-erlangen.de>

Hello Perl-Gurus (or can we say Perlians),

Today I have written the script below to handle my molecule calculation
jobs on a machine
with two processors.

My aim is: To start two processes on the machine and if one is finished
then
feed the empty processor with a new job. [I want to use the code snipped
below together with an genetic
algorithm (also in Perl) to optimize the semiempirical parameters of an
atom.]

My questions are:
(1) How can I rewrite the script as a sub, so that I can call it from
other routines multiple times with
  different arrays of molecules and functions to handle the molecules.
(2) It should be possible to do the whole thing in an object orientated
fashion.
   But, I don't now how to set it up.
   Any good suggestions how I - because want to learn it - can do that?
(Basic knowlegde about OO stuff is given)
(3) Is it the right way to use closures???
(4) Is the last while loop OK???
(5) How to deal with closures in objects???

-------------------------------------------
#!/usr/local/bin/perl -w
use strict;
$| = 1;

# Array with molecule names
my @molecule = qw(test_md2 test_md1 test_md3 test_md4  test_md5);

# Number of tasks I want to start
my $ntasks = 2;

# User defined function
my $func = sub {
  my $element = shift;
  # Call my program to calculate a molecule
  exec("vamprun -i $element");
};

# Array for checking if the subprocesses are ready
my @pids;

# Closure to start my job
my $job = sub {
   my $func = shift;
   my $a_ref = shift;
   return &start_new_job($func,$a_ref);
};

sub start_job {
  my $waitedpid = wait();

  # Remove the old pid
  for (my $l = 0; $l <= $#pids; $l++) {
    if ($pids[$l] == $waitedpid) {
      splice(@pids,$l,1);
      last;
    }
  }

#  print "pid $waitedpid ended\n";
  if (scalar(@molecule) > 0) {
    # Start new process
    &$job($func,\@molecule);
  }
}

sub start_new_job {
  my $func  = shift;
  my $a_ref = shift;

  my $element = shift(@{$a_ref});
  my $pid;

  unless (defined ($pid = fork)) {
    die "fork of process failed: $!";
  }
  else {
    # Jooh, I get the new child => Store the pid
    push(@pids,$pid);
  }

  unless ($pid) {
#    print "CHILD pid $$\n";
#    print "element = $element\n";
    # Compute a job
    &$func($element);
    exit;
  }
}

# If child is ready, then start a new job
$SIG{'CHLD'} = \&start_job;

print "The whole story begins:\n";

# Now start my tasks
for (my $j = 0; $j < $ntasks; $j++) {
  if (scalar(@molecule) > 0) {
#    print " Task $j started ! \n";
    &$job($func,\@molecule);
  }
}

# print "pids = ",join(" : ",@pids), "\n";

# Check if all processes are finished
while (@pids) {
  print "WHILE\n";
  foreach my $k (@pids) {
#    print "Wait for $k\n";
    waitpid($k,0);
  }
}
# print "Remaining pids = ",join(" : ",@pids), "\n";

print "Other stuff\n";

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

This was my first real contact with Unix process handling and I would be
glad about detailed answers.

Please apologize my bad english and many thankx for your help,

Torsten Schindler

(Only a chemist)




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

Date: Wed, 27 Sep 2000 17:37:24 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: How can I combine regular expressions?
Message-Id: <st4c2k6r7a8k13@corp.supernews.com>

Philip Lees (pjlees@ics.forthcomingevents.gr) wrote:
: >$line =~ s/\b([A-Z])([A-Z])(?=[a-z]|\W)/$1\l$2/g;
: >
: >Then you don't need the list of possibilities.
: 
: That's brilliant - I was in the proverbial wood of vision-obstructing
: trees.

The trouble is that you'll nuke other adjacent capitals besdies those
encoding Greek letters.  "When I was in CA last weekend, I watched an XX
movie."  You don't want the CA and XX to become Ca and Xx. 

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Quidquid latine dictum sit, altum viditur."
   |


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

Date: Wed, 27 Sep 2000 15:58:19 GMT
From: lalakaka@my-deja.com
Subject: how to share vars at runtime from a safe compartement?
Message-Id: <8qt5el$36l$1@nnrp1.deja.com>




Hi...

I have a tricky problem with the safe-module. I want to share a
variable, which name I get only at runtime. Here is a little test
script:


 use Safe;

 $safe=new Safe; $root=$safe->root();
 $safe->share('test');

 $code='&test("var"); print "var=$var";';

 $safe->reval($code);
 print $@ if $@;


 sub test
 {
         my $name=shift;

         $$name="blah";

         $safe->share("\$var");
 }


I define a subroutine outside the safe code, which means that there are
any commands or variables allowed. The code inside the safe compartement
calls the subroutine and turns over the name of a variable. This
variable gets a value inside the subroutine and then should be shared
with the safe code - but it doesn't work!

The test script above does just nothing, but in my normal program where
I need this stuff (ran under Apache_mod_perl) I get a little bit strange
error:

 Package "Apache::ROOTsafetest::cgi_2dbin::safetest_2epl" does not exist
at
 d:/htdocs/safetest/cgi-bin/safetest.pl line 1979


I found a "workaround" with placing the variable directly in the safe
scope, looks like that:

 ${"$$root\::$name"}=$$name;

But this is not really a solution, because the variable now exists two
times: Inside the safe compartement and outside - but I need a real
_sharing_


Can anybody help?


Bye,

Christoph Bergmann


PS: Excuse my bad english. ;-)



Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 27 Sep 2000 10:34:49 -0700
From: "Jürgen Exner" <juex@deja.com>
Subject: Re: interpreter optimizations
Message-Id: <39d22f75$1@news.microsoft.com>

"Abigail" <abigail@foad.org> wrote in message
news:slrn8t2g6i.lo9.abigail@alexandra.foad.org...
> Michael P. Soulier (msoulier@nortelnetworks.com) wrote on MMDLXXXIII
> September MCMXCIII in <URL:news:8qrd2j$e96$1@bmerhc5e.ca.nortel.com>:
> -- In article <slrn8t2bq9.lo9.abigail@alexandra.foad.org>, Abigail wrote:
> -- >What is passed by value in:
> -- >
> -- >    @list1 = @list2;
> --
> --     Well now, that would be my question, now wouldn't it?
> What part of "you cannot pass arrays by value" was unclear to you?

Sorry Abigail, this time you are mistaken. Michael and you are comparing
apples and oranges.
While you are argueing about concepts of the Perl programming language (and
your statement is quite correct of course) Michael is asking about how those
abstract concepts have been realized in the actual interpreter.
And you as a user would not be able to distinguish between a lazy copy (aka
copy-on-write) or an immediate copy (except for the difference in
performance). Both would be possible implementations of "you cannot pass
arrays by value".

jue




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

Date: Wed, 27 Sep 2000 15:51:14 GMT
From: i0519@my-deja.com
Subject: Is there some free perl script packget for download?
Message-Id: <8qt51f$2os$1@nnrp1.deja.com>

Something like transfer a DOC file into a html, or upload some user
file.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 27 Sep 2000 11:42:33 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: lowercase and UPPERCASE
Message-Id: <Pine.GSO.4.21.0009271141340.5957-100000@crusoe.crusoe.net>

On Sep 27, Anders Lund said:

>Abigail wrote:
>
>> Anders Lund (anders@wall.alweb.dk) wrote on MMDLXXXIV September MCMXCIII
>> in <URL:news:%cnA5.1$Qu1.122@news000.worldonline.dk>:
>> }}
>> }} Our amazons are not particular helpful...
>> }}
>> }}     /^$name$/i
>> }}
>> }} is equivalent to
>> }}
>> }}     lc($name) eq lc
>> }}
>> 
>> 
>> Not if $name contains regex metacharacters.
>> 
>> 
>> Abigail
>
>You got a point there.

Or in this case:

  $this = "bar\n";
  $that = "BAR";
  print 1 if $this =~ /^$that$/i;
  print 2 if lc($this) eq lc($that);

Remember, $ matches /\n?\z/

-- 
Jeff "japhy" Pinyan     japhy@pobox.com     http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine            http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc.    http://www.perlarchive.com/
CPAN - #1 Perl Resource  (my id:  PINYAN)        http://search.cpan.org/





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

Date: Wed, 27 Sep 2000 17:48:02 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: lowercase and UPPERCASE
Message-Id: <st4cmik0bavs15@corp.supernews.com>

Anders Lund (anders@wall.alweb.dk) wrote:
:     /^$name$/i
: 
: is equivalent to
:     
:     lc($name) eq lc

Oh yeah?  Try it on:

  $name = 'foo';
  $_    = "foo\n";

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Quidquid latine dictum sit, altum viditur."
   |


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

Date: Wed, 27 Sep 2000 15:10:54 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: MySQL vs. mSQL
Message-Id: <39d23340.61f4$2ea@news.op.net>

In article <vel3tss8mrnigj46lp8vcq8ob2asmklkem@4ax.com>,
Bart Lateur  <bart.lateur@skynet.be> wrote:
>PostGreSQL has transactions. MySQL does not. If it's important that your
>data remains integer while being updated by more than just a few people
>simultaniously, that probably will matter. 

No, that's untrue.  You are correct that MySQL has no transactions.
But it doesn't need them because it does not have concurrent updates
of the database; only one query executes at a time.

This brings with it many other disadvantages, but data corruption is
not one of them.






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

Date: Wed, 27 Sep 2000 16:33:42 GMT
From: wsprague@my-deja.com
Subject: Non Blocking I/O
Message-Id: <8qt7h6$51p$1@nnrp1.deja.com>

Is there a way to non-blocking I/O without using syswrite etc?  I am
trying to keep a log file and rotate it with logrotate, but my perl
program goes to sleep when logrotate deletes the logfile for a few
seconds.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 27 Sep 2000 18:46:47 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: Non Blocking I/O
Message-Id: <2xpA5.49$tA.5014@news010.worldonline.dk>

wsprague@my-deja.com wrote:

> Is there a way to non-blocking I/O without using syswrite etc?  I am
> trying to keep a log file and rotate it with logrotate, but my perl
> program goes to sleep when logrotate deletes the logfile for a few
> seconds.
> 
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.

Each time you wanat to add a line to the log, open it, then write, then 
close it.

-anders

-- 
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]


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

Date: 26 Sep 2000 22:14:59 +0200
From: elwood@news.agouros.de (Konstantinos Agouros)
Subject: Re: Perl and SNMP
Message-Id: <elwood.969999239@news.agouros.de>

In <39CF8B7F.BEDE4CEA@progress.com> peredina <peredina@progress.com> writes:

>Anyone point me to some good starter docs re: Perl and SNMP.

>Ive looked in a few places, and there's not much out there.
Well I am using it quite extensively at the moment. You might want to have a
look the ucd-snmpd. It comes with an SNMP-Perl-Module that allows to retrieve 
and set values using SNMP.

Hope that helps,

Konstantin


>Thanks,

>Curt
-- 
Dipl-Inf. Konstantin Agouros aka Elwood Blues. Internet: elwood@agouros.de
Otkerstr. 28, 81547 Muenchen, Germany. Tel +49 89 69370185
----------------------------------------------------------------------------
"Captain, this ship will not sustain the forming of the cosmos." B'Elana Torres


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

Date: Wed, 27 Sep 2000 18:58:08 +0200
From: Paul Vandevelde <paul.vandevelde@mcd.alcatel.be>
Subject: Problem "no such file or directory"when executing Perlscript
Message-Id: <39D22720.A729F195@mcd.alcatel.be>

This is a multi-part message in MIME format.
--------------FD198F93B66BA4E09EB5F13C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

hello

We have the following problem :in Unix.
When making Perl-scripts, it sometimes happens that, when you execute it
in the directory where the script resides, it
gives the message "no such file or directory",. Reason is mostly that
the current directory (.) is not in the PATH
because Perl will not look in your current directory.
So, we changed the path-statement, but got the same result.
We tried to find out by comparing other perlscripts, and found 1
difference. The perlscript I am talking about was developped
using Active Perl on Nt. When it was finished it was put back in IBM. We
looked at the contents of the file
and saw after each line a <CR>, also on the first line where in fact we
give !#....perl to tell to the system where perl is.
I had the impression, that BASH is looking at the first line, to see
where perl is, but this time its perl<cr>,  can this be
the reason of the message?

Regards Paul

--------------FD198F93B66BA4E09EB5F13C
Content-Type: text/x-vcard; charset=us-ascii;
 name="paul.vandevelde.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Paul Vandevelde
Content-Disposition: attachment;
 filename="paul.vandevelde.vcf"

begin:vcard 
n:Vandevelde;Paul
tel;work:Methods and Tools
x-mozilla-html:FALSE
org:RCD;VG24
adr:;;F.wellesplein 1;Antwerp;;3120;Belgium
version:2.1
email;internet:paul.vandevelde@mcd.alcatel.be
title:Methods and Tools engineer
fn:Paul Vandevelde
end:vcard

--------------FD198F93B66BA4E09EB5F13C--



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

Date: Wed, 27 Sep 2000 18:23:23 +0000
From: "Paul Taylor" <pap@sotonians.org.uk>
Subject: Re: Problem "no such file or directory"when executing Perlscript
Message-Id: <a6qA5.2068$j4.88946@nnrp3.clara.net>

In article <39D22720.A729F195@mcd.alcatel.be>, Paul Vandevelde
<paul.vandevelde@mcd.alcatel.be> wrote:
> 
> We have the following problem :in Unix. 

So it's a Unix problem?  Don't worry - I haven't quite slit my wrists yet.

<snippity-snip-snip-snip>
> give !#....perl to tell to the system where perl is. I had the
> impression, that BASH is looking at the first line, to see where perl
> is, but this time its perl<cr>,  can this be the reason of the message?

A shebang ( or hash-bang, depending on which side you bat for ) 
is generally of the form :-

#!/usr/bin/perl -w

You seem to have the hash and the exclamation mark the wrong
way round - although that might be a typo in your post.

Do yourself a favour and post the source in any query.
Helps people out.

Cheers,

Pap.

Send 


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

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

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 4445
**************************************


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