[17245] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4667 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 19 18:15:42 2000

Date: Thu, 19 Oct 2000 15:15:26 -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: <971993725-v9-i4667@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 19 Oct 2000     Volume: 9 Number: 4667

Today's topics:
    Re: Search, pad, replace (Jerome O'Neil)
    Re: Search, pad, replace <james@NOSPAM.demon.co.uk>
    Re: Search, pad, replace <iltzu@sci.invalid>
    Re: Search, pad, replace <godzilla@stomp.stomp.tokyo>
        Seeking the DATA handle. <adamf@box43.gnet.pl>
        spawning (system, exec and `prog`) calls (P&C)
        Using a command line variable <stanton@spec.com>
    Re: Using a command line variable <pbarker@ntlworld.com>
    Re: what is 'Subroutine NULL'? <tim@ipac.caltech.edu>
    Re: what is 'Subroutine NULL'? bing-du@tamu.edu
        y's woes <kmetcalf@lighthousemarketing.com>
    Re: y's woes <jeff@vpservices.com>
    Re: y's woes <stephenk@cc.gatech.edu>
    Re: y's woes <kmetcalf@lighthousebiz.com>
    Re: y's woes <godzilla@stomp.stomp.tokyo>
    Re: y's woes <jeff@vpservices.com>
    Re: y's woes <ren.maddox@tivoli.com>
    Re: y's woes <godzilla@stomp.stomp.tokyo>
    Re: y's woes <lr@hpl.hp.com>
    Re: y's woes <jeff@vpservices.com>
    Re: y's woes <godzilla@stomp.stomp.tokyo>
    Re: y's woes <godzilla@stomp.stomp.tokyo>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 19 Oct 2000 18:05:04 GMT
From: jerome@activeindexing.com (Jerome O'Neil)
Subject: Re: Search, pad, replace
Message-Id: <kJGH5.535$pb.140706@news.uswest.net>

ollie_spencer@my-deja.com elucidates:

> I was beset by replies - Godzilla among them - seemingly intent on
> demonstrating their superior intelligence and my inferiority as a
> member of the human race.

No matter how new you are, it would be impossible for the Troll
to demonstrate inellegence superior to anyone's.  

Fret not about that.

> Admittedly I compounded the problem by overlooking several valid
> solutions - fixation on my part, perhaps due to the tone of the replies
> - but there were more nit-pickers than those who wanted to help. 

Well, there you go.  You asked a question and recieved an answer.  If you
let the tone of a message interfere with the content of the message, you're
going to loose a lot of good gouge.

Assholes are everywhere.  Nothing you can do about that.


-- 
"Civilization rests on two things: the discovery that fermentation 
produces alcohol, and the voluntary ability to inhibit defecation.  
And I put it to you, where would this splendid civilization be without 
both?" --Robertson Davies "The Rebel Angels" 


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

Date: Thu, 19 Oct 2000 19:41:59 +0100
From: James Taylor <james@NOSPAM.demon.co.uk>
Subject: Re: Search, pad, replace
Message-Id: <ant191859c72fNdQ@oakseed.demon.co.uk>

In article <8snc89$ar4$1@nnrp1.deja.com>,
<URL:mailto:ollie_spencer@my-deja.com> wrote:
> 
> Must intelligence imply arrogance?

No it's the other way around:
Arrogance implies lack of intelligence.

> Believe it or not, lack of knowledge about perl doesn't
> imply inferiority.

Indeed not. Nobody should be ashamed of being ignorant,
just of being unwilling to learn.

> No one is forced to reply to a posting.

You might think that, but some people are forced to reply
aggressively or negatively by their own inner turmoil, and
you should pity them for that, not get upset by it.

-- 
James Taylor <james (at) oakseed demon co uk>
PGP key available ID: 3FBE1BF9
Fingerprint: F19D803624ED6FE8 370045159F66FD02



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

Date: 19 Oct 2000 21:09:26 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Search, pad, replace
Message-Id: <971987866.16557@itz.pp.sci.fi>

In article <8snc89$ar4$1@nnrp1.deja.com>, ollie_spencer@my-deja.com wrote:
>
>I was beset by replies - Godzilla among them - seemingly intent on
>demonstrating their superior intelligence and my inferiority as a
>member of the human race.

More likely, as far as I remember that thread, they[0] didn't really
intentionally try to make you feel inferior, they just didn't bother
to intentionally stroke your ego either to soften the impact.

You see, the problem here is that, regardless of other areas of life,
when it comes to Perl skills the gap between the newbies and the
experts is so incredibly wide that the newbies _will_ feel inferior.

That is, after all, the correct perception of the facts.  Some know
this and accept it.  Others, perhaps confusing experience in one
particular narrow field with general life experience, stubbornly
refuse to accept that someone else could know so much more about
something than they do, and thus believe any superior attitude they
see to be an intentional put-on designed to insult and humiliate.


I've been here long enough and read enough of the manuals that these
days I can argue about Perl syntax and behavior with the experts and
have a non-zero chance of being right.  Of course, this has, in the
eyes of the newbies, made me a part of the perceived condescending
clique of experts.

But it must be understood that this only applies to the particular
subject of this newsgroup, and even then only to a subset of it; I may
sometimes, say, disagree with Ilya Zakharevich's opinions, but if he
says something about perl internals I will accept that as the truth
because I know not only that no mortal could be more authoritative on
the matter, but also that even if there were one who knew better, it
wouldn't be me.


The first step to learning is to know that one does not know yet.


[0] Excluding the resident troll here and in general.  Last time I
    checked she was still posting, but I don't notice her much.

-- 
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla  | "By promoting postconditions to
and its pseudonyms -    |  preconditions, algorithms become
do not feed the troll.  |  remarkably simple."  -- Abigail



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

Date: Thu, 19 Oct 2000 14:36:31 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Search, pad, replace
Message-Id: <39EF695F.9DE234AE@stomp.stomp.tokyo>

Ilmari Karonen wrote:

> ollie_spencer wrote:

(snipped)

> [0] Excluding the resident troll here and in general.  Last time I
>     checked she was still posting, but I don't notice her much.

> Ilmari Karonen - http://www.sci.fi/~iltzu/
> Please ignore Godzilla  | "By promoting postconditions to
> and its pseudonyms -    |  preconditions, algorithms become
> do not feed the troll.  |  remarkably simple."  -- Abigail




I am challenged to lend credibility to a
self-announced, publically proclaimed,
misogynist.

Kira


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

Date: Thu, 19 Oct 2000 22:58:42 +0200
From: Adam <adamf@box43.gnet.pl>
Subject: Seeking the DATA handle.
Message-Id: <39EF6082.56C2@box43.gnet.pl>

Can anyone tell if there is a method to reset the standard DATA handle.
As I expected seek(DATA, 0, 0) does not work.

Thanks in advance.
Adam.


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

Date: Thu, 19 Oct 2000 20:17:44 GMT
From: mailloop@localhost.com (P&C)
Subject: spawning (system, exec and `prog`) calls
Message-Id: <39ef55fc.1381244564@netnews.voicenet.com>

I'm using Activestate perl build 616 on W2K Adv Server.

I have a child process called dbimport which takes a string as a
parameter as in:

dbimport userid,password,Firstname Lastname,stuff,stuff,TRUE

This works fine from the command line or from a .cmd file.  However
from within my perl script this process does not appear to ever get
executed.  I've tried:

`dbimport \"userid,password,Firstname Lastname,stuff,stuff,TRUE\"`;

and 

system "dbimport \"userid,password,Firstname
Lastname,stuff,stuff,TRUE\"`;

printing $! after this system call shows nothing.

How can I track what's wrong or determine how/why this is failing?

Thanks!

Phil
p c   a t   n t a d m i n   d o t   c o m


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

Date: Thu, 19 Oct 2000 11:22:51 -0700
From: JStanton <stanton@spec.com>
Subject: Using a command line variable
Message-Id: <3C1003FCBC2A786E.7688D3EF811A1FA1.A1DA16F53D5AEC69@lp.airnews.net>

I've looked for some info on a seemingly simple command, but no luck.
How can I take a command line variable and use it as a variable in
Perl? 

Thanks in advance.


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

Date: Thu, 19 Oct 2000 20:17:19 +0100
From: "Paul Barker" <pbarker@ntlworld.com>
Subject: Re: Using a command line variable
Message-Id: <9LHH5.14639$NQ4.336745@news2-win.server.ntlworld.com>

Commnad options are put in an array call @ARGV so you can use $ARGV[n] to
retrieve the n'th option :

my $option_a = $ARGV[0];
my $option_b = $ARGV[1];

REMEMBER (as if you could forget !) that array subscripts start at zero not
one ;-)

PaulB

PS, I like the Getopt module myself. See the man page (or hypertext page if
you speak win32!)


"JStanton" <stanton@spec.com> wrote in message
news:3C1003FCBC2A786E.7688D3EF811A1FA1.A1DA16F53D5AEC69@lp.airnews.net...
> I've looked for some info on a seemingly simple command, but no luck.
> How can I take a command line variable and use it as a variable in
> Perl?
>
> Thanks in advance.




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

Date: Thu, 19 Oct 2000 12:50:50 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: what is 'Subroutine NULL'?
Message-Id: <39EF509A.A0686838@ipac.caltech.edu>

bing-du@tamu.edu wrote:
> 
> My script gives:
> 
> Prototype mismatch: sub main::NULL vs () at (eval 63) line 1.
> Subroutine NULL redefined at (eval 63) line 1.
> 
[snip]
>
> But I'm still not clear why the compilation complained about subroutine
> NULL in my case.  What is subroutine NULL? 
> Another thing, in the error
> message provided, what does 'eval 63' refer to?

The 63rd invocation of an eval statement.
 
I can reproduce your error this way:

% perl -we 'eval 1 for(1..62); eval q/sub NULL ($$) { } sub NULL ($$$) {};/'
Prototype mismatch: sub main::NULL ($$) vs ($$$) at (eval 63) line 1.
Subroutine NULL redefined at (eval 63) line 1.

But I assume you don't think you have a subroutine named NULL. Are you sure?
None of the modules you use or libraries you require have such a subroutine?

If perl invents a sub named NULL for some other reason, I don't know how or why.
This didn't do it:

% perl -we 'sub y1 ($$) {} sub y2 ($$$) {} my $y=""; *$y = \&y1; *$y = \&y2'
Subroutine  redefined at -e line 1.
Prototype mismatch: sub main:: ($$) vs ($$$) at -e line 1.

If you don't find a sub named NULL anywhere, can you post some code to reproduce
the error?

--

-- Tim Conrow         tim@ipac.caltech.edu                           |


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

Date: Thu, 19 Oct 2000 21:10:40 GMT
From: bing-du@tamu.edu
Subject: Re: what is 'Subroutine NULL'?
Message-Id: <8sno0a$ls6$1@nnrp1.deja.com>

In article <39EF509A.A0686838@ipac.caltech.edu>,
  tim@ipac.caltech.edu wrote:
> bing-du@tamu.edu wrote:
> >
> > My script gives:
> >
> > Prototype mismatch: sub main::NULL vs () at (eval 63) line 1.
> > Subroutine NULL redefined at (eval 63) line 1.
> >
> [snip]
> >
> > But I'm still not clear why the compilation complained about
subroutine
> > NULL in my case.  What is subroutine NULL?
> > Another thing, in the error
> > message provided, what does 'eval 63' refer to?
>
> The 63rd invocation of an eval statement.
>

But there is no eval statement in my script.  If it's in other modules
that used by my script, that would make troubleshooting very difficult.

> I can reproduce your error this way:
>
> % perl -we 'eval 1 for(1..62); eval q/sub NULL ($$) { } sub NULL ($$$)
{};/'
> Prototype mismatch: sub main::NULL ($$) vs ($$$) at (eval 63) line 1.
> Subroutine NULL redefined at (eval 63) line 1.
>
> But I assume you don't think you have a subroutine named NULL. Are you
sure?

I'm 100% sure :).

> None of the modules you use or libraries you require have such a
subroutine?
>

Not sure.  I'll grep NULL from those *.pm files corresponding to the
modules that used by the script to see which module has subroutine NULL.
*sigh*

> If perl invents a sub named NULL for some other reason, I don't know
how or why.
> This didn't do it:
>
> % perl -we 'sub y1 ($$) {} sub y2 ($$$) {} my $y=""; *$y = \&y1; *$y =
\&y2'
> Subroutine  redefined at -e line 1.
> Prototype mismatch: sub main:: ($$) vs ($$$) at -e line 1.
>
> If you don't find a sub named NULL anywhere, can you post some code to
reproduce
> the error?
>

The script has 1250 lines.  Since am not clear which part may cause this
error, do not know which part should be posted here.  But the error says
'sub main::NULL...', so I just posted 'main' part here.  Other parts are
'sub' definitions.

===================
#!/usr/freeware/bin/perl64

use lib qw(/usr/freeware/lib/perl5/site_perl/5.005/irix-64
/usr/freeware/lib/perl5/5.00503
/usr/local/md/libdata/httpd/htdocs/app
/usr/local/md/libdata/httpd/htdocs/app/search-3.0
/usr/local/md/libdata/httpd/htdocs/app/Mail-IMAPClient-1.15/);

use strict;
use POSIX;
use Net::LDAP qw(LDAP_SUCCESS);
use SDBM_File;
use Fcntl;

use DBI qw(:sql_types);
use DBD::Oracle;

use CGI_LIB;
use SendMail;
use Perlfect::Template;
use IMAPClient;
use Benchmark;

my $ContentTypePrinted = 0;

&print_headers;

print "<title>new app</title>";

my $basedir = <omitted>;
my $url_base = <omitted>;

my $tmp = <omitted>;


# ldap config

[snip]

# oracle config

[snip]

$ENV{'ORACLE_HOME'} = "/usr/local/oracle";

my $dbh;
my @view_student_info =
('tamuofficialname','major','classification','uid','home phone');

my %specific_session;
my %general_session;

my $cgiObj = new CGI_LIB;

&authenticate if $cgiObj->{'authsubmit'};

my $uid = $cgiObj->{'uid'};

&display_student_info if ($cgiObj->{'select'} || $cgiObj->{'sortby'}) ||
$cgiObj->{'email_all'};
&process_selected if $cgiObj->{'email_selected'};

&attachment if $cgiObj->{'attachsubmit'};
&AttachToMessage if $cgiObj->{'attachtomessage'};
&RemoveAttachment if $cgiObj->{'removeattachment'};
&toppage_more if $cgiObj->{'doneattachment'};

&recipient_emails if $cgiObj->{'detaillist'};
&summary if $cgiObj->{'topsubmit'};
&send_mail if $cgiObj->{'summary'};
&choose_class if ($cgiObj->{'samesubmit'} ||
$cgiObj->{'differentsubmit'});
&logout if $cgiObj->{'logout'};

&authpage;
exit;

next are 'sub' definitions...

sub ... {
}

sub ... {
}
 ...

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

More info:
IRIX64 switch 6.5 10181058 IP27
Perl version 5.005_03 built for irix-64

Thanks,

Bing

> --
>
> -- Tim Conrow         tim@ipac.caltech.edu                           |
>


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


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

Date: 19 Oct 2000 19:41:52 GMT
From: kevin metcalf <kmetcalf@lighthousemarketing.com>
Subject: y's woes
Message-Id: <39EF4EDC.85D0642F@notlighthousenotbiznot.com>

Hi everybody (in best Dr Nick voice...),

I assume there is an easier way to do this, so I'm going to ask.  (Yes I
DID check perldoc perlfunc and couldn't find anything that looked like
it would work.  I tried using tr (that's y for you unix gurus) and it
didn't work the way
I wished it would.

I'm trying to itterate through a series of logfiles and see if they
contain the string: 'thisisthefileiwant.pl' anywhere in them.  I tried
using something like:
$valid='false';
if (tr/thisisthefileiwant.pl/thisisthefileiwant.pl/) {
  $valid = 'TRUE';
  }

but it would come up with the count of ever
t,h,i,s,i,s,t,h,e,f,i,l,e,i,w,a,n and t in the file.  I tried putting
the whole dad blamed thing in single quotes, but that did not appear to
solve my problem.  I come from the old school where it is not looked
upon as good coding stlye to check every substring from zero to (length(
$_ )-21) for an occurance of the string 'thisisthefileiwant.pl'.

I know there is a better way to do this so, thanks in advance to the
gurus who help.

Kevin Metcalf
--
To email, untie the nots ;)



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

Date: Thu, 19 Oct 2000 12:58:18 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: y's woes
Message-Id: <39EF525A.9D45481A@vpservices.com>

kevin metcalf wrote:
> 
> I'm trying to itterate through a series of logfiles and see if they
> contain the string: 'thisisthefileiwant.pl' anywhere in them.  I tried
> using something like:
> $valid='false';
> if (tr/thisisthefileiwant.pl/thisisthefileiwant.pl/) {
>   $valid = 'TRUE';
>   }

From "perldoc perlop":

 s/PATTERN/REPLACEMENT/egimosx
         Searches a string for a pattern

 tr/SEARCHLIST/REPLACEMENTLIST/cdsUC
         Transliterates all occurrences of the characters found in the
         search list with the corresponding character in the replacement
         list.

Notice that tr// is for individual *characters* and s/// is for
*patterns* of characters such as strings, file names, etc.

-- 
Jeff


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

Date: Thu, 19 Oct 2000 16:05:00 -0400
From: Stephen Kloder <stephenk@cc.gatech.edu>
Subject: Re: y's woes
Message-Id: <39EF53EC.32508889@cc.gatech.edu>

kevin metcalf wrote:

> Hi everybody (in best Dr Nick voice...),
>
> I'm trying to itterate through a series of logfiles and see if they
> contain the string: 'thisisthefileiwant.pl' anywhere in them.  I tried
> using something like:
> $valid='false';
> if (tr/thisisthefileiwant.pl/thisisthefileiwant.pl/) {
>   $valid = 'TRUE';
>   }
>
> but it would come up with the count of ever
> t,h,i,s,i,s,t,h,e,f,i,l,e,i,w,a,n and t in the file.  I tried putting
> the whole dad blamed thing in single quotes, but that did not appear to
> solve my problem.  I come from the old school where it is not looked
> upon as good coding stlye to check every substring from zero to (length(
> $_ )-21) for an occurance of the string 'thisisthefileiwant.pl'.
>
> I know there is a better way to do this so, thanks in advance to the
> gurus who help.
>

You should be using s/// to match strings.

perldoc perlop

--
Stephen Kloder               |   "I say what it occurs to me to say.
stephenk@cc.gatech.edu       |      More I cannot say."
Phone 404-874-6584           |   -- The Man in the Shack
ICQ #65153895                |            be :- think.




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

Date: 19 Oct 2000 20:18:00 GMT
From: kevin metcalf <kmetcalf@lighthousebiz.com>
Subject: Re: y's woes
Message-Id: <39EF5754.4B5CB548@lighthousebiz.com>

Much obliged.  The problem was that s looked like a substitution deal only,
so I didn't delve deep enough.  Sorry for the 'newbie' style post.
(Sufficiently humble head hanging shamefully initiated.)

Kevin Metcalf

Jeff Zucker wrote:

> kevin metcalf wrote:
> >
> > I'm trying to itterate through a series of logfiles and see if they
> > contain the string: 'thisisthefileiwant.pl' anywhere in them.  I tried
> > using something like:
> > $valid='false';
> > if (tr/thisisthefileiwant.pl/thisisthefileiwant.pl/) {
> >   $valid = 'TRUE';
> >   }
>
> From "perldoc perlop":
>
>  s/PATTERN/REPLACEMENT/egimosx
>          Searches a string for a pattern
>
>  tr/SEARCHLIST/REPLACEMENTLIST/cdsUC
>          Transliterates all occurrences of the characters found in the
>          search list with the corresponding character in the replacement
>          list.
>
> Notice that tr// is for individual *characters* and s/// is for
> *patterns* of characters such as strings, file names, etc.
>
> --
> Jeff



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

Date: Thu, 19 Oct 2000 13:18:48 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: y's woes
Message-Id: <39EF5728.29843762@stomp.stomp.tokyo>

kevin metcalf wrote:

(snipped)

> I'm trying to itterate through a series of logfiles and see if they
> contain the string: 'thisisthefileiwant.pl' anywhere in them.  I tried
> using something like:



Something like or exactly as shown? When you ask a
question and state parameters, do so precisely and
exactly lest someone or myself get on your case for
being vague. This is a computer language group which
inherently requires absolute givens. This is not
Senator Hiyahowrya's Slippery Semantics class of 
UC Berkeley, circa Summer Of Love.


$found = "nope";
if (index ($data, "thisisthefileiwant.pl") > -1)
 { $found = "yep"; }
print $found;

**

$counter = 0;
foreach $element (@Array_Data)
 {
  if (index ($element, "thisisthefileiwant.pl") > -1)
   { print "found at element $counter\n"; }
  $counter++;
 }
print "\n\n  Search Finished.";

**

$counter = 1;
while (<DATA>)
 {
  if (index ($_, "thisisthefileiwant.pl") > -1)
   { print "found at line $counter\n"; }
  $counter++;
 }
print "\n\n   All Done Boss.";

**

$counter = 1;
while (<DATA>)
 {
  if (index ($_, "thisisthefileiwant.pl") > -1)
   { print "found at line $counter - program terminated."; exit; }
  $counter++;
 }



Godzilla!


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

Date: Thu, 19 Oct 2000 13:22:39 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: y's woes
Message-Id: <39EF580F.C853FBAD@vpservices.com>

kevin metcalf wrote:
> 
> Kevin Metcalf
> 
> Jeff Zucker wrote:
> 
> > kevin metcalf wrote:
> > >
> > > I'm trying to itterate through a series of logfiles and see if they
> > > contain the string: 'thisisthefileiwant.pl' anywhere in them.  I tried
> > > using something like:
> > > $valid='false';
> > > if (tr/thisisthefileiwant.pl/thisisthefileiwant.pl/) {
> > >   $valid = 'TRUE';
> > >   }
> >
> > Notice that tr// is for individual *characters* and s/// is for
> > *patterns* of characters such as strings, file names, etc.

Oh, I forgot to mention that actually if you are just testing for
existence of the pattern, rather than doing a replacement, as you are,
you don't want either tr/// or s///, you want the matching operator m//;

-- 
Jeff


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

Date: 19 Oct 2000 15:19:08 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: y's woes
Message-Id: <m3vguofutf.fsf@dhcp11-177.support.tivoli.com>

kevin metcalf <kmetcalf@lighthousebiz.com> writes:

> Much obliged.  The problem was that s looked like a substitution deal only,
> so I didn't delve deep enough.  Sorry for the 'newbie' style post.

Just in case you missed it.  The m// operator is what you are really
looking for here.  It is the non-substitution counterpart to s///.

-- 
Ren Maddox
ren@tivoli.com


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

Date: Thu, 19 Oct 2000 13:43:57 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: y's woes
Message-Id: <39EF5D0D.59888BCA@stomp.stomp.tokyo>

"Godzilla!" wrote:
 
> kevin metcalf wrote:

Sorry, add this line to my last example
as shown in closing. This is to cover
for your search producing no results.

print "\n\n  Nothing Found Boss.";
 

 
$counter = 1;
while (<DATA>)
 {
  if (index ($_, "thisisthefileiwant.pl") > -1)
   { print "found at line $counter - program terminated."; exit; }
  $counter++;
 }
print "\n\n  Nothing Found Boss.";  <--- ADD HERE



Godzilla!
-- 
Dr. Kiralynne Schilitubi ¦ Cooling Fan Specialist
UofD: University of Duh! ¦ ENIAC Hard Wiring Pro
BumScrew, South of Egypt ¦ HTML Programming Class


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

Date: Thu, 19 Oct 2000 13:55:09 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: y's woes
Message-Id: <MPG.1458ff85e9640ba698ae4c@nntp.hpl.hp.com>

I[Rearranged to maintain the logical flow of the discussion.  Please 
post that way in the future.]

n article <39EF5754.4B5CB548@lighthousebiz.com> on 19 Oct 2000 20:18:00 
GMT, kevin metcalf <kmetcalf@lighthousebiz.com> says...
> Jeff Zucker wrote:
> > kevin metcalf wrote:
> > > I'm trying to itterate through a series of logfiles and see if they
> > > contain the string: 'thisisthefileiwant.pl' anywhere in them.  I tried
> > > using something like:
> > > $valid='false';
> > > if (tr/thisisthefileiwant.pl/thisisthefileiwant.pl/) {
> > >   $valid = 'TRUE';
> > >   }
> >
> > From "perldoc perlop":
> >
> >  s/PATTERN/REPLACEMENT/egimosx
> >          Searches a string for a pattern

 ...

> Much obliged.  The problem was that s looked like a substitution deal only,
> so I didn't delve deep enough.  Sorry for the 'newbie' style post.
> (Sufficiently humble head hanging shamefully initiated.)

But I can't imagine why Jeff aimed you at the 's' operator, when you 
want to find something, not substitute for it.  Look in the same section 
of perlop for the 'm' operator.  And don't forget to backslash the '.' 
in your pattern.

Though in reality, the solution posted by Godzilla!, using the index() 
function, is clearly the most suitable for this problem -- faster than 
using a regex match, and no concern about possible metacharacters in the 
pattern.

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


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

Date: Thu, 19 Oct 2000 14:20:28 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: y's woes
Message-Id: <39EF659C.DAEFF4C2@vpservices.com>

Larry Rosler wrote:
>  
> But I can't imagine why Jeff aimed you at the 's' operator, when you
> want to find something, not substitute for it.  Look in the same section
> of perlop for the 'm' operator.  

A mistake I corrected moments after hitting the send button (and before
either you or Ren also caught the same mistake).  I was paying more
attention to the Y than to the X.

> Though in reality, the solution posted by Godzilla!, using the index()
> function, is clearly the most suitable for this problem -- faster than
> using a regex match, and no concern about possible metacharacters in the
> pattern.

Oh man, putting Godzilla above me!  (Though deservedly so in this
case).  I take back what I said about you being "duh man" in another
thread.  :-)

-- 
Jeff


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

Date: Thu, 19 Oct 2000 14:31:29 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: y's woes
Message-Id: <39EF6831.8C3FD40F@stomp.stomp.tokyo>

Larry Rosler wrote:

> kevin metcalf wrote:
> > Jeff Zucker wrote:
> > > kevin metcalf wrote:

(snipped)

> Though in reality, the solution posted by Godzilla!, using the index()
> function, is clearly the most suitable for this problem -- faster than
> using a regex match, and no concern about possible metacharacters in the
> pattern.


My method works fine Mr. Rosler, until a search
term spans more than one line. However, this is
a can of worms best used as an excuse for,

"Gone Fishing."


Godzilla!


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

Date: Thu, 19 Oct 2000 14:48:49 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: y's woes
Message-Id: <39EF6C41.E928B04C@stomp.stomp.tokyo>

Jeff Zucker wrote:
 
> Larry Rosler wrote:

(snipped)

> Oh man, putting Godzilla above me!  (Though deservedly so in this
> case).  I take back what I said about you being "duh man" in another
> thread.  :-)


I am always above you boys. Afterall, I am
significantly taller than The Fifty Foot Woman
over in Las Vegas, although she does glow in
a darkened bedroom. Not only that, I can easily
enunciated a single syllable word, in movies,
without flapping my jaws fifty times.

Godzilla!
--
* Boycott The New Godzilla Movie - That Ain't Me *


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

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


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