[13243] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 653 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 26 14:07:18 1999

Date: Thu, 26 Aug 1999 11:05:16 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 26 Aug 1999     Volume: 9 Number: 653

Today's topics:
    Re: [Question]perl-DBM file.. Can visitors open a DBM f <cassell@mail.cor.epa.gov>
    Re: Accounts and CPAN module (Abigail)
        CGI scan multiple web pages for info? <fred@hotmail.com>
    Re: CGI scan multiple web pages for info? <makkulka@cisco.com>
        compiler for Perl? <baal@c2i.net>
    Re: compiler for Perl? <phil@proteacher.com>
    Re: email address verification (Randal L. Schwartz)
    Re: Excel file from Perl <l463520@lmtas.lmco.com>
    Re: extract text <cassell@mail.cor.epa.gov>
    Re: extract text <cassell@mail.cor.epa.gov>
    Re: grab random image --> post into browser <phil@proteacher.com>
        Help! Syntax error that I can't find! <rlester@columbus.rr.com>
    Re: Help! Syntax error that I can't find! (Gary O'Keefe)
    Re: Help: Perl replace special char from multiple form  <makkulka@cisco.com>
    Re: Help: Perl replace special char from multiple form  <jb_1099@hotmail.com>
    Re: How to Detect that a Process is running already <phil@proteacher.com>
    Re: how to setuid? (M.J.T. Guy)
    Re: Images <phil@proteacher.com>
        Implementing a Perl Script on NT <iwebmaster@email.com>
    Re: Jenda's gender [was: newbi: Registry Help under NT] <cassell@mail.cor.epa.gov>
    Re: Jenda's gender [was: newbi: Registry Help under NT] <cassell@mail.cor.epa.gov>
        Locate a substring?! <phil@proteacher.com>
    Re: Locate a substring?! (Marcel Grunauer)
    Re: loop through a hash of arrays based on array elemen <dont_ever.spam_pvoris@earthlink.net>
        Pattern Matching <anmolnar@videon.wave.ca>
    Re: Pattern Matching <ed.summerfield@lexis-nexix.com>
    Re: Perl a Black Sheep? <rkoehler@osmre.gov>
    Re: perl in bash functions <callen@boxcar.driver8.org>
    Re: print dollar format? <phil@proteacher.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Thu, 26 Aug 1999 11:03:57 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: [Question]perl-DBM file.. Can visitors open a DBM file at the same time.?
Message-Id: <37C5818D.23A09FB7@mail.cor.epa.gov>

shl wrote:
> 
> Hi.
> 
> I use perl DBM file.
> 
> ex>
> 
>     dbmopen(%TEST,"data1",0666);
>     ...
>     ...
>     ...
>     ...
>     dbmclose(%TEST);
> 
> Can many visitor open and update above data1.db DBM file at the same time?
> if many visitor open or update above data1.db DBM file at the same time,
> then the file break?
> 
> please help me..... (U.U)

If you you're opening the file for writing or read-write, then
this is a potential problem.  You'll want to read about file
locking.  Start with this command:

perldoc -f flock

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 26 Aug 1999 11:05:34 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Accounts and CPAN module
Message-Id: <slrn7sapg2.n0r.abigail@alexandra.delanet.com>

Lars Thegler (lars@thegler.dk) wrote on MMCLXXXVI September MCMXCIII in
<URL:news:37C55974.4F0F0DBA@thegler.dk>:
%% Bob Kline wrote:
%% > 
%% > The general advice I have seen on building the CPAN modules on UNIX
%% > systems is to run all steps except the last (the 'make install')
%% > using an account other than root, and only su to root for the
%% > 'make install' step, since the standard UNIX perl installation
%% > needs it.  How does one do this using the CPAN shell?
%% 
%% The central point is that the 'make install' must be run as root. It
%% doesn't matter what user you run the preceeding steps as. I usually run
%% 'perl -MCPAN -e shell' as root anyway.


And you blindly trust the entire Internet population that can put 
whatever they want there?



Abigail
-- 
sub J::FETCH{Just   }$_.='print+"@{[map';sub J::TIESCALAR{bless\my$J,J}
sub A::FETCH{Another}$_.='{tie my($x),$';sub A::TIESCALAR{bless\my$A,A}
sub P::FETCH{Perl   }$_.='_;$x}qw/J A P';sub P::TIESCALAR{bless\my$P,P}
sub H::FETCH{Hacker }$_.=' H/]}\n"';eval;sub H::TIESCALAR{bless\my$H,H}


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Thu, 26 Aug 1999 18:41:09 +0100
From: "Tim Wilson" <fred@hotmail.com>
Subject: CGI scan multiple web pages for info?
Message-Id: <7q3u0b$1eum$1@quince.news.easynet.net>

Hi,

I want a script or any method to automatically view a url, search and
extract some data from
a page and write it out to a file. I have a text file with about 50 URL's in
it, and I want to avoid
the process of manually cutting and pasting each page into Word or similar
just to get at the data.

Any thoughts as I've looked for hours on the web and cannot find anything!

Thanks in advance,

Mark.





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

Date: Thu, 26 Aug 1999 10:44:10 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: CGI scan multiple web pages for info?
Message-Id: <37C57CEA.1CA68ADF@cisco.com>

[ Tim Wilson wrote:

> I want a script or any method to automatically view a url, search and
> extract some data from
> a page and write it out to a file. I have a text file with about 50 URL's in
> it, and I want to avoid
> the process of manually cutting and pasting each page into Word or similar
> just to get at the data.

You can use LWP::Simple or LWP::UserAgent.

--



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

Date: Thu, 26 Aug 1999 16:15:26 GMT
From: "[L] Vicious!" <baal@c2i.net>
Subject: compiler for Perl?
Message-Id: <yKdx3.97$rb6.10864@juliett.dax.net>

Could anyone point me in a direction where I can find a compiler for Perl. I
am running Win98 and I'm using Tk + Win32 modules. It only has to make and
EXE-file of my PL-file. I need a FREE one, not a
half-working-demo-error-message-producing compiler. I have already tried
perl2exe, perlapp and djgpp, but none fit my OS or my program.






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

Date: Thu, 26 Aug 1999 10:36:47 -0700
From: "Phil Schaechter" <phil@proteacher.com>
Subject: Re: compiler for Perl?
Message-Id: <LXex3.4$UK.255@chrome.eng.netapp.com>

There is no such thing as a perl compiler.  Perl is an interpreted language.

Phil Schaechter

[L] Vicious! wrote in message ...
>Could anyone point me in a direction where I can find a compiler for Perl.
I
>am running Win98 and I'm using Tk + Win32 modules. It only has to make and
>EXE-file of my PL-file. I need a FREE one, not a
>half-working-demo-error-message-producing compiler. I have already tried
>perl2exe, perlapp and djgpp, but none fit my OS or my program.
>
>
>
>




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

Date: 26 Aug 1999 10:22:13 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: email address verification
Message-Id: <m1ogfu78ze.fsf@halfdome.holdit.com>

>>>>> "Jon" == Jon Hollcraft <webmaster@mendonet.com> writes:

Jon> David, I do appreciate your comments and understand what you are
Jon> expressing.  I would like to humbly point out that I labeled the sub
Jon> *validate* and not *verify* , both in the sub name and in the find it
Jon> line in my code.

Uh, what is that point?  I miss it entirely.  In either case, you are
neither verifying the semantics of the address (in that it corresponds
to something that won't bounce or /dev/null), nor verifying the syntax
(in that it corresponds to something that can be used in an RFC822
header).

So, your routine, whether it was named verify or validate, does
NEITHER successfully.

You *could* use that routine as a _HINT_.  As in, if you are
interactive with a user, and they give something that doesn't fit
that, make a suggestion that they change it, but *still* accept
whatever they say the second time.

However, to use that routine as a draconian "all addresses shall
conform to this" sounds...so... Microsoftian. :)

Jon> My criteria is speed and security.  For my purposses with this
Jon> program, the trade off is allowing 200 million addresses in
Jon> quickly with out any funny business characters, while disallowing
Jon> 10K or whaterever there might be, of addresses which the filter
Jon> disallows.

Even if one of those 10K characters is a CTO that wants to buy $500K
of services from you next year and happens to be in a funny gateway
environment?

Why do you have the arrogance to tell him that his perfectly legal
email address is illegal?

Jon> So that's my excuse, and I'm stickin' to it ;-)  Jon

I will make sure to never hire you or anyone you work for, then.  I
work with people that believe in and support interoperability and
standards.

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: Thu, 26 Aug 1999 11:36:33 -0500
From: Michael Hill <l463520@lmtas.lmco.com>
Subject: Re: Excel file from Perl
Message-Id: <37C56D10.B91DF304@lmtas.lmco.com>

Jeff / Mak,

Thanks, I think this is the best approach. I can't expect the user to have
perl installed on his pc.

Mike

Jeff Zucker wrote:

> You can use DBI with DBD::Oracle to get the data and DBD::CSV to create
> comma-separated-values files.  Excel can read the CSV files directly.
>
> --
> Jeff
>
> Michael Hill wrote:
> >
> > I have some perl scripts that create HTML tables from and Oracle DB.
> > However some users want me to send then and excel file. Anyone have any
> > exemples of this?
> >
> > Mike





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

Date: Thu, 26 Aug 1999 10:44:17 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: extract text
Message-Id: <37C57CF1.EAF9312@mail.cor.epa.gov>

Jonathan Stowe wrote:
> 
> On Wed, 25 Aug 1999 17:15:53 GMT Gary O'Keefe wrote:
> > A keyboard was whacked upside Abigail's head and out came:
> >
> >>michael hagberg (mzh@cntw.com) wrote on MMCLXXXV September MCMXCIII in
> >><URL:news:7q0l57$4ln$1@news3.global-ip.net>:
> >
> > What? Michael wrote this message on 2185th September 1993? Cool...
> >
> 
> I think that this should be a FAQ by now ;-}

Perhaps not in the FAQ...
Hmm, mjd already has the IAQ...
How about in the Not-Quite-So-Frequently-Asked-Questions ??

The NQSFAQ could have questions like:

[1] uhh.. how come Abigail's always posting in September?
[2] uhh.. how come that Abigail chick was so mean to me?
[3] uhh.. that Abigail b**** was really nasty to me.  Can I
    get a date with her?
[4] uhh.. how come *you* get to write OT junk and I don't?
 .
 .
 .

But this list could get painfully long.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 26 Aug 1999 10:46:32 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: extract text
Message-Id: <37C57D78.C6D7FD87@mail.cor.epa.gov>

Gary O'Keefe wrote:
> 
> A keyboard was whacked upside David Cassell's head and out came:
> 
> >Gary O'Keefe wrote:
> >>
> >> A keyboard was whacked upside Abigail's head and out came:
> >>
> >> >michael hagberg (mzh@cntw.com) wrote on MMCLXXXV September MCMXCIII in
> >> ><URL:news:7q0l57$4ln$1@news3.global-ip.net>:
> >>
> >> What? Michael wrote this message on 2185th September 1993? Cool...
> >
> >Yep.  All of Abigail's posts use Roman numerals and September
> >1993.  You've heard the saying "Now it's September all the
> >time on Usenet" haven't you?  If not, search deja.com for
> >discussions in this ng on the subject.
> 
> Educated guess before looking up deja.com: September is when colleges
> and universities start their semesters. New courses mean new
> assignments, which take time, getting in the way of their drinking
> floor polish, smoking joss sticks, date rape, and listening to their
> crazy rock-and-roll music. Loads of dumbass questions hit the
> newsgroup looking for someone gullible enough to do their assignment.
> 
> But now that everyone (that matters) gets usenet (even those in
> otherwise gainful employment), the dumbasses are posting all the time.
> 
> Close?

Bingo!  But September 1993 was when AOL let chat-roomers loose
on Usenet without any indication that perhaps this was a 
different culture, with different rules.

BTW, use a softer keyboard.  My head still hurts where you
hit me with that keyboard the last time.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 26 Aug 1999 10:50:55 -0700
From: "Phil Schaechter" <phil@proteacher.com>
Subject: Re: grab random image --> post into browser
Message-Id: <%8fx3.6$UK.212@chrome.eng.netapp.com>

I ran in to this same problem.  Use a bit a javascript and tack on a random
number to the end of your perl cgi image call

So, if your loading http://www.yoursite.com/cgi-bin/randomimage.cgi as the
image, make it

http://www.yoursite.com/cgi-bin/randomimage.cgi?43523098

This way, each time you reload, the browser thinks its a different image,
and reloads it from the server.  This is how I solved your problem on my
site.

Phil Schaechter

David Ford wrote in message ...
>Hello,
>
>I am totally new at this, and am hoping to find the answer here.
>
>I need a CGI script that will grab a random image from a directory and
>post it into a preset location on a WWW page.  I need for the image to
>refresh and randomize upon every page reload.  The trick is that it has to
>work the same in Netscape and Explorer.  A friend of mine came up with
>what we thought would be a working script until we ran into the following
>problem:
>
>When the "reload" button is hit in Explorer, the entire contents of the
>page reload (along with the image file).  This is what we want.  By
>contrast, however, Netscape only "reloads" the cached version of the page
>(in other words, neither the page or the image are RE-loaded at all --
>only the cache contents are "reloaded").  This is not acceptable.  I need
>for Netscape to perform a full reload of the page (and to obtain a
>fresh/random image) upon hitting the "reload" button.  What is the
>solution here?
>
>I have heard that due to Netscape's tendency to "see" this CGI script as
>an image (and thus load it into cache), my best solution for this problem
>is Javascript instead of a CGI script.  Supposedly (in this case),
>Javascript would "force" a reload in every browser.  Is this true?
>
>Thank you for any help which you could offer.
>
>David Ford
>Costa Mesa, California




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

Date: Thu, 26 Aug 1999 12:10:10 -0400
From: Ron Lester <rlester@columbus.rr.com>
Subject: Help! Syntax error that I can't find!
Message-Id: <37C566E2.B52DD49C@columbus.rr.com>

(I'm sorry if I post this message twice...  It doesn't look like the
message I sent last night posted, so I'm sending it again.)

Hi everyone,

I'm a Perl(5) newbie, and I've had some success writing and executing
simple scripts.  I'm writing the script for an online store right now,
and I
have some syntax errors with the following subroutine.  No matter how
hard I
try, I can't find the errors... which is why I decided to post here.
The
idea of this subroutine is simple: It is given a string of keywords and
checks
them against two fields (the 4th and 6th) in each line of a database.
If
there is a match, then the item (the 0th entry) is added to an array of
products and a product object is created.  They are returned in order of
fewest
to greatest number of appearances.

If anyone can help me debug this code, I would *greatly* appreciate it.
I haven't been able to find the errors, but maybe I'm just overlooking
something...

Thanks in advance,
Natalie


#####################################
#   getKW
#####################################

sub getKW
{

my $keywordstring = @_;
my @products_kw;
my @keywords;

$keywordstring =~ s/[\W]/[\s];
@keywords = split(/[\s]/,$keywordstring);

open(DATAFILE,$PRODUCT_DB) || $self->error($DB_ERROR);

$i=0;
my @db_row;
my @products_kw_temp;
my %product_tally;
my $i;


# @products_kw_temp will be filled with all items that match
# at least one kw. if an item matches two keywords, it will
# appear twice. the hash %product_tally will keep track of how
# many times each product appears in @products_kw_temp. then
# @products_kw will be filled so that the products with the most
# appearances will be LAST so that they will appear FIRST in the
# products array that will be generated by newstore.cgi


while ($line=<DATAFILE>) {
  @db_row = split(/\|/,$line);
  foreach $i @keywords {
   if (($db_row[4] =~ /$i/i) || ($db_row[6] =~ /$i/i)) {
    my $newproduct = new Product($db_row[0]);
    push(@products_kw_temp, $newproduct);
   }
  }
}

foreach $i @products_kw_temp {
  ++$product_tally{i};
}

# a safe upper limit for the number of appearances is 20
my $index = 20;

foreach $i keys(%product_tally) {
  if $product_tally{$i} > 20 {
   push(@products_kw,$i)
  }
}

foreach $i keys(%product_tally) {
  while $index > 0 {
   if $product_tally{$i} = $index {
    push(@products_kw,$i);
    --$index;
   }
  }
}

close (DATAFILE);

return @products_kw;
}










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

Date: Thu, 26 Aug 1999 16:57:05 GMT
From: gary@onegoodidea.com (Gary O'Keefe)
Subject: Re: Help! Syntax error that I can't find!
Message-Id: <37c56d68.28974222@news.hydro.co.uk>

A keyboard was whacked upside Ron
Lester's^H^H^H^H^H^H^H^H^H^H^H^HNatalie's head and out came:

>Thanks in advance,
>Natalie
>
> [...]

OK, starting from the start you are starting the script with perl -w
and 'use strict;' aren't you?

>$i=0;
>...
>my $i;

You can't make an assignment to a variable before you define it!
Also:

>foreach $i keys(%product_tally) {
>  if $product_tally{$i} > 20 {
>   push(@products_kw,$i)
>  }
>}
>
>foreach $i keys(%product_tally) {
>  while $index > 0 {
>   if $product_tally{$i} = $index {
>    push(@products_kw,$i);
>    --$index;
>   }
>  }
>}

should be

foreach $i keys(%product_tally) {
  if ($product_tally{$i} > 20) {	<-- here
   push(@products_kw,$i)
  }
}

foreach $i keys(%product_tally) {
  while ($index > 0) {			<-- here
    if ($product_tally{$i} == $index) {	<-- here
      push(@products_kw,$i);
      --$index;
    }
  }
}

could it? Watch the parentheses on the flow control conditions. And
the difference between '=' and '=='. I didn't bother analysing the
logic of the sub, these are the most obvious errors I can spot,
though. Anybody spot more?

Gary
--
Gary O'Keefe
gary@onegoodidea.com

You know the score - my current employer has nothing to do with what I post


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

Date: Thu, 26 Aug 1999 10:50:49 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: Help: Perl replace special char from multiple form field (was Select    Multiple Form Field via Perl into Oracle error)
Message-Id: <37C57E79.49B2F2F5@cisco.com>

[ JB wrote:

> ....can't seem to find any reference to what it can be anywhere
> strangely.

This is mentioned in the CGI.pm documentation. Look for where
the Vars() method is explained.

Anyway, if you use CGI.pm then multiple params are taken care
of automatically.

--Makarand



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

Date: Thu, 26 Aug 1999 17:23:39 +0100
From: "JB" <jb_1099@hotmail.com>
Subject: Re: Help: Perl replace special char from multiple form field (was Select Multiple Form Field via Perl into Oracle error)
Message-Id: <jTdx3.27$2B2.6256@news.enterprise.net>

Jon - you've instantly become my hero - works like a dream - thanks :-)

Ian

Jon Peterson <jpeterson@office.colt.net> wrote in message
6udx3.18$RY.383@news.colt.net...
>JB <jb_1099@hotmail.com> wrote:
>> Hi,
>
>> Just found that selecting more than one item in a "select multiple" form
>> field adds an odd character between each item selected. Any idea, using
>> PERL, how to find out what it is so i can strip it out in my script?
Tried
>
>It's a null character, represented in Perl by \0 where 0 is a zero. So,
>you can make an array of the selected options like this:
>




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

Date: Thu, 26 Aug 1999 10:52:32 -0700
From: "Phil Schaechter" <phil@proteacher.com>
Subject: Re: How to Detect that a Process is running already
Message-Id: <wafx3.7$UK.255@chrome.eng.netapp.com>

Perhaps you could just do a process list on the machine, and see if thats
already running?

Redirect ps -aux to a file, and parse through it looking for your script?
This isn't the most secure way, but it works.

Phil Schaechter

John Nolt wrote in message <37C48CA0.C05CB617@mindspring.net>...
>Hi,
>
>I'm hoping that this is a simple question.
>
>I want to create a CGI that runs a perl script. However, if that perl
>script is already running, I want to pop up a message that says
>something to the effect of "I'm sorry, the script is already running.
>Try again later."
>
>So, I need to detect if the perl script is running. How do I do that?
>The camel book chapter on IPC didn't really clue me in as to detecting
>instances of scripts.
>
>I realize that I may be jumping the gun since I haven't done much
>development on this little application, but I would like to get an idea
>in my head for this piece of the puzzle if possible.
>
>Thanks for any help,
>
>John
>




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

Date: 26 Aug 1999 17:17:38 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: how to setuid?
Message-Id: <7q3sri$b69$1@pegasus.csx.cam.ac.uk>

In article <37c32e6b@news1.jps.net>, Edward Villalovoz <edwardv@jps.net> wrote:
>Hi,
>  Can anyone show me how to do a simple setuid in a perl script?  I've read
>the perlsec but I'm not sure how to code it.  I just need to change the
>setuid from 0,(root), to say user "X" uid 2000.   Thanks for the help.

See the $< and $> variables in perlvar.


Mike Guy


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

Date: Thu, 26 Aug 1999 10:38:42 -0700
From: "Phil Schaechter" <phil@proteacher.com>
Subject: Re: Images
Message-Id: <yZex3.5$UK.97@chrome.eng.netapp.com>

Or you could make it easy on yourself, and have it print out smaller height
and width tags, the browser will then resize the picture for you


Phil Schaechter

Jimmy Humphrey wrote in message <37C5554A.65BBA9C5@blackhole-designs.com>...
>I was wondering where I might find information on editing images in perl
>so I can make thumbnails. I can't install any special program because
>I'm on a virtual host.  Also, is there anyway (via command line) to see
>if a perl module exist on the system or not?
>
>Jimmy
>
>
>




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

Date: Thu, 26 Aug 1999 22:46:45 +0530
From: "Julie Tuck" <iwebmaster@email.com>
Subject: Implementing a Perl Script on NT
Message-Id: <7q51h7$mm1$1@news.vsnl.net.in>

Hi,
I have made a perl script that works perfectly well on a Unix server,, but
now  I require to Execute it on an NT server, could you please tell what
chanes  should make in the script to make it work on an NT server.

Many Thankx
Julie




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

Date: Thu, 26 Aug 1999 10:50:05 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Jenda's gender [was: newbi: Registry Help under NT]
Message-Id: <37C57E4D.550DFB5F@mail.cor.epa.gov>

elephant wrote:
[snip of my garbage]

> only problem is that I'm not American .. neither am I female (another

It was *you*?  Sorry.  I know you're not 'Murrkun.  After all,
your header info says your org is 
    'Telstra Big Pond Cable - Sydney Site 1'
and even we know where Sydney is.  

Well, some of us do.

Okay, a small percentage of us do, but we're too weak at math
to quantify it accurately.

> common reason for assuming someone else is female in my experience)
> 
> I'm Australian .. I just guessed at Jenda's gender .. it's not the first
> time - and I'm sure it will not be the last - that those Czech (s?)
> names screw me up .. my culturally-inept apologies Jenda
> 
> ( I guess I'll have to go back to dreaming about Abigail *8^)

To quote Randal: "heh".

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 26 Aug 1999 10:56:28 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Jenda's gender [was: newbi: Registry Help under NT]
Message-Id: <37C57FCC.4A065224@mail.cor.epa.gov>

Jenda Krynicky wrote:
> 
> On Thu, 26 Aug 1999 13:05:33 +1000, elephant@squirrelgroup.com (elephant) wrote:
> > David Cassell writes ..
> > >Jenda Krynicky wrote:
> > >[snip of gender error]
> > >> HIS site!
> > >>
> > >> Oh well. I guess I should put a picture of me online or at least
> > >> specify my sex on my site.
> > >>
> > >> Never mind :-)
> > >
> > >Just keep repeating these three words:
> > >   Americans.. are.. stupid.
> > >
> > >David, proud to be stupid^WAmerican
> 
> I don't think this has anything to do with stupidity.

Agreed.  I was just being a smart@$$ as usual.

>                                                        Sometimes you simply have to guess.
> And if the other person comes from a different language territory you have
> about 50% chance to be right.

And if the other person uses the monicker 'Abigail' you are
likely to be wrong.  :-)
 
> In case you ever need it:
> Do not look at the first name (you'd have to remember all names), but at the last name.
> It differs between males and females in Czech. (Same for Slovak)

And several other related languages.

[snip]
> In US it's, I guess, safer to assume female by default.
[snip]

Except here in Oregon, where too many young people have names
bestowed upon them in the 60's and 70's and 80's.  How do
you determine the sex of an unknown individual named Zinnia
or Maple?

Don't even mention Picabo Street [promounced 'peek-a-boo'].

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 26 Aug 1999 10:33:33 -0700
From: "Phil Schaechter" <phil@proteacher.com>
Subject: Locate a substring?!
Message-Id: <JUex3.2$UK.240@chrome.eng.netapp.com>

Pardon me if I'm off topic or in the wrong group...

Does anyone know how to locate a substring within a string in perl?  Is
there a simple function for this (something like strstr() in C?)

Thanks for any help

Phil Schaechter




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

Date: Thu, 26 Aug 1999 17:59:10 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: Locate a substring?!
Message-Id: <37c88e81.4348653@news>

On Thu, 26 Aug 1999 10:33:33 -0700, "Phil Schaechter"
<phil@proteacher.com> wrote:

> Does anyone know how to locate a substring within a string in perl?  Is
> there a simple function for this (something like strstr() in C?)

perldoc -f index


Marcel
Perl Padawan
-- 
sub AUTOLOAD{($_=$AUTOLOAD)=~s,^.*::,,;y,_, ,;print} Just_Another_Perl_Hacker();


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

Date: Thu, 26 Aug 1999 09:55:16 -0700
From: Joe Schmoe <dont_ever.spam_pvoris@earthlink.net>
Subject: Re: loop through a hash of arrays based on array element?
Message-Id: <37C57174.D3C8C37E@earthlink.net>

Oops. My bad.  I shoiuld have defined a more in-depth sort routine to
compare numerically rather than sciibetically.  My apologies.

p



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

Date: Thu, 26 Aug 1999 16:54:37 GMT
From: Andy Molnar <anmolnar@videon.wave.ca>
Subject: Pattern Matching
Message-Id: <37C57128.58820052@videon.wave.ca>

How do use pattern matching to check only the last character of a
string?  I'm passing a value with a period at the end, which seems to
screw up at the destination.  (Such as "Washington D.C.").  I can tack
on another character before sending to "buffer" the period (such as
"Washington D.C.*", which I'll later encode to "Washington%20D.C.%2A"),
but I don't know how to check for that "*" character after passing it,
except for splitting each character, and going through a loop to reach
the last.

On another note:
I don't know ANYTHING about pattern matching.  And I won't be going to
any classes until the spring.  Are there any good Perl resources with
pattern matching and a pedagogical approach on the net?

Thanks,
Andy




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

Date: Thu, 26 Aug 1999 13:03:48 -0400
From: Edward Sumerfield <ed.summerfield@lexis-nexix.com>
Subject: Re: Pattern Matching
Message-Id: <37C57374.5FEB6C78@lexis-nexix.com>

if m/.*?\*$/ { print "this is untested but it looks right" }

the trailing $ indicates end of line.

Andy Molnar wrote:

> How do use pattern matching to check only the last character of a
> string?  I'm passing a value with a period at the end, which seems to
> screw up at the destination.  (Such as "Washington D.C.").  I can tack
> on another character before sending to "buffer" the period (such as
> "Washington D.C.*", which I'll later encode to "Washington%20D.C.%2A"),
> but I don't know how to check for that "*" character after passing it,
> except for splitting each character, and going through a loop to reach
> the last.
>
> On another note:
> I don't know ANYTHING about pattern matching.  And I won't be going to
> any classes until the spring.  Are there any good Perl resources with
> pattern matching and a pedagogical approach on the net?
>
> Thanks,
> Andy



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

Date: Thu, 26 Aug 1999 16:10:50 GMT
From: "Rick K" <rkoehler@osmre.gov>
Subject: Re: Perl a Black Sheep?
Message-Id: <FH2y7v.M4o@igsrsparc2.er.usgs.gov>

joeyandsherry@mindspring.com wrote:
>[snipski ...]
>I told him of my learning of Perl and of how I used it, etc. As soon as I
>mentioned Perl and the UNIX server I use, he snarled. It was if I was
>speaking of a plague...He commented that Perl was not a "real" programming
>language, it is a scripting language and offered his dissertation on
>programming and Unix and other such things.
>
>
>Why is Perl treated with such disdain? I've found many occasions where Perl
>programmers say "Perl can do that...", which doesn't seem to reinforce what
>I experienced today.


Just goes to show that one shouldn't throw Perl before swine.

The gent may have been coming from any of a number of "viewpoints", some laughable,
some unbelieveable, some possibly understandable given certain factors.  He might have
been woefully ill-informed about Perl, might be a Microsoft zealot, might be set in his
ways which were learned long ago, might be semi-delusional or catatonic.  Run away.

No sense wasting your time arguing with him, just as there is little to gain in pondering
the babblings of fools (but wait, what if 1000 chimps were clicking away on Windows NT
boxes running VB, for 1000 years?  Maybe one of them could come up with some
elegant code by sheer randomness? =8^)   ).   <---- humorous intent

Countless threads have passed thru c.l.p.misc & .mod concerning "Is it a complied language
or is it a interpreted language", "Is it just a scripting language", "Tastes Great/Less Filling",
"CandyMint / BreathMint", "Which is better UNIX/NT/whatever" ... a thousand religious wars,
and the dead and defeated rise up again to fight another day.

Enjoy your time spent a'perling, learn, converse with kindred souls, and if you are looking
for potential employment, seek out more enlightened locales.  Good luck.





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

Date: 26 Aug 1999 17:26:08 GMT
From: Christopher Allen <callen@boxcar.driver8.org>
Subject: Re: perl in bash functions
Message-Id: <7q3tbg$1rac$1@news1.spacestar.net>

Eric Smith <eric@fruitcom.com> spake:
> Hi

> May one use perl code in a bash function and pass the command line args of
> the function to the perl "script"?

Yes, but do you mean command line arguments or arguments passed to the function

imagine:


#!/bin/sh

for i in c9*
do
/usr/bin/perl makeit.pl $i
                        ^^ 

done

---comp.unix.shell would be a better place to address this Q.

-out







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

Date: Thu, 26 Aug 1999 10:55:18 -0700
From: "Phil Schaechter" <phil@proteacher.com>
Subject: Re: print dollar format?
Message-Id: <5dfx3.8$UK.246@chrome.eng.netapp.com>

Count the number of digits.  The rest is easy.

print strlen % 3 digits, then a comma, then three digits, then comma until
you hit .   - then print remaining digits..

Phil Schaechter

b chung wrote in message <37C455BF.5BECAA04@ci.south-el-monte.ca.us>...
>Hi, all
>
>In Perl  How do I print the  22343.87  like this  $22,232.87
>
>Any Ideas?
>Thanks
>Betty Chung
>
>
>
>




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

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

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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


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