[9392] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2987 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 26 00:08:19 1998

Date: Thu, 25 Jun 98 21:00:29 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 25 Jun 1998     Volume: 8 Number: 2987

Today's topics:
    Re: $size = `du -s $directory' is doubling value when r <admin@bwsd.com>
    Re: autovivification and tie questions <lehman@javanet.com>
    Re: challenge: put search into an array (Abigail)
        Corrupt File Writing To Disk Using & Char - Help! (Ralph Freshour)
    Re: Flames.... (Leslie Mikesell)
    Re: Flames.... <ljz@asfast.com>
    Re: Flames.... <tchrist@mox.perl.com>
    Re: Flames.... (Leslie Mikesell)
    Re: Flames.... <rra@stanford.edu>
    Re: how do I parse a certain structured text? (Patrick Timmins)
        How to write a Find rule??? <warwickf@geocities.com>
    Re: How to write a Find rule??? (Bob Trieger)
    Re: if statement, legal? (Michael Rubenstein)
    Re: if statement, legal? (mikep)
    Re: iterating through files and subdirectories (mikep)
    Re: mastering regular expressions (mikep)
    Re: mastering regular expressions <ajohnson@gpu.srv.ualberta.ca>
        Newbie problem setting up Perl, and ODBC module for NT, <beaugard@interport.net>
    Re: Perl OS Redirection ?? <rra@stanford.edu>
    Re: PerlIS and IIS.40 Setup.. Please help! <defreit@worldnet.fr>
        Recurse functions? <w3master@infosys.ru>
    Re: Remove blank  too much lines from a text file (nobody)
    Re: RTF parsing (nobody)
    Re: Searching through a file <hurban@snet.net>
    Re: Strange ommission from perl function list (brian d foy)
        string replace in files within subdirectories omid@rocketmail.com
    Re: string replace in files within subdirectories <rra@stanford.edu>
    Re: string replace in files within subdirectories <tchrist@mox.perl.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 25 Jun 1998 22:18:54 -0500
From: Beck Web Servers & Design <admin@bwsd.com>
Subject: Re: $size = `du -s $directory' is doubling value when running from the web
Message-Id: <3593131E.1C846EA8@bwsd.com>

Hi:

You put me on the right track...thanks...a combination of your
information and viewing the man pages on "du" got me the answer.  The
environment variable BLOCKSIZE can be set, and obviously, in this
problem, the blocksize must have been 512 instead of 1024 on the web run
of the script.  So I put this at the top of the script, and it works.

$ENV{BLOCKSIZE} = "1024";

Thanks Jonathan.


Jonathan Feinberg wrote:
> 
> Beck Web Servers & Design <admin@bwsd.com> writes:
> 
> > The output when run from the web is:
> > 24062   /usr/local/etc/httpd/htdocs/dir
> >
> > The outup when run from the shell is:
> > 12031   /usr/local/etc/httpd/htdocs/dir
> 
> I'd guess that your PATH variable has a du on it that gives its
> results in kilobytes, whereas the PATH available to processes spawned
> by the web server has a du that gives sizes in blocks.  Try setting
> $ENV{PATH} explicity at the top of the script, or giving the complete
> path the the desired du.
> 
> --
> Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
> http://pobox.com/~jdf/

-- 
Eric Beck, BWSD
http://web-design.net/index.shtml
mailto:erbeck@web-design.net
Phone: 905 436 6814   Fax:  905 725 4023
============================================================
Internet Call Manager - Get Your Calls While Online!
http://internetcallmanager/agents/bwsd
============================================================
BECK WEB SERVERS & DESIGN - WHERE SUPPORT AND SERVICE ARE #1
============================================================


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

Date: Fri, 26 Jun 1998 01:51:54 GMT
From: Todd Lehman <lehman@javanet.com>
Subject: Re: autovivification and tie questions
Message-Id: <35930E68.EADFAE45@javanet.com>

Matt Sisk wrote:
> [...]
> 3) I suspect that the answer is just to make sure and pre-allocate the
> hash references in this case, knowing that the tied hash probably can't
> deal with it.  Unless there's something I'm missing in how this all
> works.


I wrestled with something very similar and nearly gave up.  Nested tied
hash objects are tricky enough already, and handling autovivification
correctly makes it even trickier -- almost to the point where you may wonder
if it's even possible at all.  I got my stuff to work but I'm still puzzled.

If you return undef from FETCH, then STORE will be called right away with
an anonymous hash -- as it should be, naturally -- but exactly what you do
with that anonymous hash seems to be terrifically important.

I was taking the value passed to STORE and stuffing it happily away if it
was a scalar, or converting it happily to one of my nested tied objects if
it was a hash.  After all, it needs to be converted to a nested tied object
so that it can control anything that might go inside it.

The thing that perl didn't seem to like was my allocating a fresh new object
and copying values from the one it passed me into the new object.  This
approach made sense to me, because I don't want to assume that I may modify
the original value, but it caused 5.004 to die in a really weird way -- the
next FETCH failed when it shouldn't have.  I never figured out whether this
was a bug in 5.004 or just something beyond my level of understanding, but it
really freaked me out for a long time.

What made autovivification "work" was directly tying the hash passed to
STORE rather than creating a new an anonymous hash via a canonical
constructor.  I'm not 100% comfortable with this approach because it
effectively ruins the original value if STORE is passed a populated hash
as opposed to an empty hash.  That is, I might not always want what I'm
storing to be converted from a plain hash into a fancy tied-hash object.

But perl seems to be happy only that way -- it seems to *require* that
the value passed to STORE is actually the value that gets stored.  >%^(

If this conclusion is correct, then perl's implementation of tied hashes
is broken.  After any autovivification call o->STORE(k,v), what it should be
doing is v' = o->FETCH(k) to see if v was what was really stored.

Did I say that right?  If I have the code...

   my $foo = Foo::NestedTiedHash->new();
   $foo{a}{b} = 7;

 ...then is there some broken part of the perl interpreter [effectively]
doing something like this?...

   $a = $foo->FETCH('a');
   if (!$a)
   {
      $a = {};
      $foo->STORE('b', $a);
   }
   $a->STORE('b', 7);

 ...when it should really be doing this instead?...

   $a = $foo->FETCH('a');
   if (!$a)
   {
      $a = {};
      $foo->STORE('b', $a);
      $a = $foo->FETCH('b');
   }
   $a->STORE('b', 7);

 ...or, [hopefully] better yet...

   $a = $foo->FETCH('a');
   if (!$a)
   {
      $a = {};
      $a = $foo->STORE('b', $a);
   }
   $a->STORE('b', 7);


Puzzled,
--Todd


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

Date: 26 Jun 1998 01:12:20 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: challenge: put search into an array
Message-Id: <6mushk$bql$1@client3.news.psi.net>

Patrick Timmins (ptimmins@netserv.unmc.edu) wrote on MDCCLIX September
MCMXCIII in <URL: news:6mu42l$npp$1@nnrp1.dejanews.com>:
++ In article <6mto3p$6fa$1@nnrp1.dejanews.com>,
++   spostma@my-dejanews.com wrote:
++ >
++ > I am an experienced programmer and I'm trying to search a string for "name="
++ > using this code.
++ >
++ > $temp =~ s/.*name=(.*)/$1/;
++ >
++ > It works just fine.  But when I have more than one occurrence of the "name=",
++ > I need to put the results into an array.  I have tried creating a loop that
++ > puts $1 into an array, but it won't return any values.
++ >
++ > Any thoughts??


@values = $temp =~ /name=((?:(?!name=).)*)/g;




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


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

Date: Fri, 26 Jun 1998 03:02:57 GMT
From: ralph@primemail.com (Ralph Freshour)
Subject: Corrupt File Writing To Disk Using & Char - Help!
Message-Id: <35930ddd.7362901@news.earthlink.net>

I'm trying to write a text file to a unix fiel server in perl5 - this
code has been working fine until I tried to include a string with an &
in it - then I found for reasons I don't understand, the file writing
stopped right there and the rest of the data does not get written.

Here's my code:

     for ($i=0; $i < @filterBuffer; $i++)
         {
           print FILE $filterBuffer[$i] . "\n";
         }

I have been trying to add one line above the print statement:

     for ($i=0; $i < @filterBuffer; $i++)
         {
           $filterBuffer[$i] =~ s/\&/x/;
           print FILE $filterBuffer[$i] . "\n";
         }

But it is still not completly writing the file to disk.

If I have the string "Stone C&M Automotive", the last line in the file
is "Stone C"

and the rest of the data after this line is not there.

Thanks for any help on this problem - I need to & character in the
string, I just don't know why it messes up the file writing method.

Ralph Freshour



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

Date: 25 Jun 1998 21:58:41 -0500
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: Flames....
Message-Id: <6mv2p1$odo$1@Venus.mcs.net>

In article <6mh1g6$asp$2@csnews.cs.colorado.edu>,
Tom Christiansen  <tchrist@mox.perl.com> wrote:
> [courtesy cc of this posting sent to cited author via email]
>
>In comp.lang.perl.misc, 
>    "Michael D. Schleif" <mike.schleif@aquila.com> writes:
>:the documentation can be both tedious
>:and enlightening.  
>
>grep and ye shall find.

How do you grep the documentation for all the CPAN modules without
downloading and building everything first?

  Les Mikesell
    les@mcs.com


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

Date: 25 Jun 1998 23:08:48 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: Flames....
Message-Id: <lthg18amgv.fsf@asfast.com>

rjk@coos.dartmouth.edu (Ronald J Kimball) writes:

> [posted and mailed]
> 
> Lloyd Zusman <ljz@asfast.com> wrote:
> 
> > [ ... ]  At
> > any rate, here's the message reference.  You should be able to find it
> > in Deja News:
> > 
> >   Message-ID: <1db1r58.j940urt9g6bhN@bay1-172.quincy.ziplink.net>
> 
> And, once again:
> 
> I rephrased the statement to read "public meeting area" instead of
> "home".
> 
> [ ... etc. ... ]

The message whose ID I posted contains quotes of all the things you
are describing so accurately here ... anyone who reads it will see the
truth of what you're saying.  I'm not accusing you of anything.

-- 
 Lloyd Zusman   ljz@asfast.com
 perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
 $t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
 $x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'


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

Date: 26 Jun 1998 03:22:55 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Flames....
Message-Id: <6mv46f$chb$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, les@MCS.COM (Leslie Mikesell) writes:
:How do you grep the documentation for all the CPAN modules without
:downloading and building everything first?

This is a wonderful question, and one which I have been 
thikning upon for some time.  

But I'm not convinced that it's that critical that the
CPAN modules be greppable like that.

--tom
-- 
clueless> $SOCK_STREAM = 2  
    Huh?  use Socket or die!
	    --Tom Christiansen <tchrist@mox.perl.com>


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

Date: 25 Jun 1998 22:35:09 -0500
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: Flames....
Message-Id: <6mv4td$opn$1@Venus.mcs.net>

In article <6muett$evq$1@cyprus.atlantic.net>,
Chip Salzenberg <chip@mail.atlantic.net> wrote:

>>>O'Reilly isn't a bunch of volunteers discussing their work/play amongst
>>>themselves.  They're a profit-making entity, albeit one with a slightly
>>>broader mind and longer view than most.  So there is no real comparison.
>>
>>It's odd that there is such a remarkable similarity in the names
>>of these O'Reilly shills and the regular people on c.l.p.m. then.
>
>Leaving aside the term "shill", which is pejorative and false:
>
>Why do you think it odd?  Tim O. recruits the real experts.

In my earlier post I questioned why CGI related topics were often
roasted as inappropriate for c.l.p.m, yet they are clearly going
to be a large part of the perl conference.  I took your response
to imply that these were different people, a different perl,  or
some kind of imposters.  I know better of course, but that
interpretation seemed 'less prejoritive' than pursuing the idea
that the same people were being a bit two-faced about what is and
isn't a miscellaneous perl topic.  What did you mean about being
a profit-making entity?  Should experts change their opinions
for money?

  Les Mikesell
   les@mcs.com


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

Date: 25 Jun 1998 20:42:52 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Flames....
Message-Id: <m3vhpode0z.fsf@windlord.Stanford.EDU>

Leslie Mikesell <les@MCS.COM> writes:

> In my earlier post I questioned why CGI related topics were often
> roasted as inappropriate for c.l.p.m, yet they are clearly going to be a
> large part of the perl conference.

CGI-related topics are not appropriate on this newsgroup because there is
a more appropriate newsgroup for CGI programming, even if that programming
is being done in Perl.

A conference has a completely different categorization and topicality
schema than a newsgroup.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Fri, 26 Jun 1998 01:30:25 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: how do I parse a certain structured text?
Message-Id: <6mutjh$81$1@nnrp1.dejanews.com>

In article <6muae3$1if$1@news.ml.com>,
  mwang@tech.cicg.ml.com (Michael Wang) wrote:
>
> Suppose I want to get
> SID_NAME and ORACLE_HOME
> from the following construct, how should I do it. Please note
> the text can be arranged differently.
>
> SID_LIST_CICGPROD-DS2-P_LISTENER =
>   (SID_LIST =
>     (SID_DESC =
>       (SID_NAME = CICGNYP1)
>       (ORACLE_HOME = /ds2-export/apps/oracle/product/7.3.4)
>     )
>     (SID_DESC =
>       (SID_NAME = CICGNYP2)
>       (ORACLE_HOME = /ds2-export/apps/oracle/product/7.3.4)
>     )
>   )
>

Use a regular expression (a "regex") to "pull" the desired info out. Based on
the sample data you've given, and assuming that the values will always appear
"linked" with the key by being in parentheses with no new lines from beginning
to end of match, something like:

$sidname = $1 if (/\(SID_NAME = ([^)]*?)\)/);
$oraclehome = $1 if (/\(ORACLE_HOME = ([^)]*?)\)/);

You must learn regex's. Read the perldoc perlre documentation that came with
your Perl. Buy Jeffrey Friedl's "Mastering Regular Expressions" from O'Reilly
and Assoc ... you won't ever have to ask a question like this again, it's that
good.

Hope that helps,

Patrick Timmins
U. Nebraska Medical Center

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Fri, 26 Jun 1998 11:45:01 +1000
From: Warwick Foster <warwickf@geocities.com>
Subject: How to write a Find rule???
Message-Id: <3592FD1C.6D2E7D2D@geocities.com>

Hi

I'm new to perl and I want to do the following things.
    process a fileZ
        find string N01
            Priocess string N01
            Output string N01b to FileX
        find string N02
            Priocess string N02
            Output string N01b to FileX
        find string N03
            Priocess string N03
            Output string N01b to FileX
    ...
    and so on

anyone have any ideas.

Examples of similar programs would be great

thanks

Warwick Foster



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

Date: Fri, 26 Jun 1998 02:06:15 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: How to write a Find rule???
Message-Id: <6muvqd$oau$1@ligarius.ultra.net>

[ posted and mailed ]

Warwick Foster <warwickf@geocities.com> wrote:
-> Hi
-> 
-> I'm new to perl and I want to do the following things.
->     process a fileZ
->         find string N01
->             Priocess string N01
->             Output string N01b to FileX
->         find string N02
->             Priocess string N02
->             Output string N01b to FileX
->         find string N03
->             Priocess string N03
->             Output string N01b to FileX
->     ...
->     and so on

There are examples all over the net that you can disect. Start at 
http://www.yahoo.com if that is the route you want to take.

The correct thing to do for beginners is to start at the beginning with a 
simple `hello world' script and move on from there. The easiest way to do this 
is to buy `Learning Perl', read it cover to cover, and completing all of the 
exercises.

Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-286-0591
  and let the jerk that answers know that his
  toll free number was sent as spam. "


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

Date: Fri, 26 Jun 1998 01:04:57 GMT
From: miker3@ix.netcom.com (Michael Rubenstein)
Subject: Re: if statement, legal?
Message-Id: <3594f311.94467817@nntp.ix.netcom.com>

On Thu, 25 Jun 1998 20:22:26 -0500, alecler@cam.org (Andre L.) wrote:

>In article <3592B1D6.64495ACD@acuityinc.com>, markf@acuityinc.com wrote:
>
>> if ($a > 0 or $b > 0 ) {}
>> 
>> It's the 'or' that I'm asking about.  Is it legal, possible, or am I
>> using the wrong syntax?
>> 
>> -Mark
>
>
>Because of the low precedence of "or", the statement is perfectly correct
>and works as you would expect.
>
>If you used ||, you would have to enclose each comparison in parentheses,
>however.
>
>   if (($a > 2) || ($b > 5)) { }
>
>That's why I prefer to use "or" and "and" most of the time.

No you wouldn't have to enclose the comparisons in parentheses.  ||
has lower precedence than >.
--
Michael M Rubenstein


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

Date: 26 Jun 1998 00:18:17 GMT
From: mikep@rt66.com (mikep)
Subject: Re: if statement, legal?
Message-Id: <6mupc9$eu2$1@news.rt66.com>

In article <3592B5FD.30B9FC1@herc.com>
"H. Wade Minter" <hminter@herc.com> writes:

> > if ($a > 0 or $b > 0 ) {}
> 
> Try
> if (($a > 0) || ($b > 0))
> {
> }

Yep.

In fact, in true C/C++ fashion, you should be able to get away with:

if ($a > 0 || $b < 0)
{
}

===========================
Mike Powell
mikep@rt66.com
http://www.rt66.com/~mikep/


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

Date: 26 Jun 1998 00:22:22 GMT
From: mikep@rt66.com (mikep)
Subject: Re: iterating through files and subdirectories
Message-Id: <6mupju$eu2$3@news.rt66.com>

In article <6mudm5$9nm@cocoa.brown.edu>
aks@cs.brown.edu (Amanda Silver) writes:

> there has got to be a command that iterates through all the files in a
> directory and then all the files in all subdirectories...what would this
> command be though?

You might look at some of the builtin functions for directories and
files. If you don't care to fiddle with modules, this is perhaps the
easiest way to go.

===========================
Mike Powell
mikep@rt66.com
http://www.rt66.com/~mikep/


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

Date: 26 Jun 1998 00:20:51 GMT
From: mikep@rt66.com (mikep)
Subject: Re: mastering regular expressions
Message-Id: <6muph3$eu2$2@news.rt66.com>

In article <6muge1$bho@cocoa.brown.edu>
aks@cs.brown.edu (Amanda Silver) writes:

> i also was wondering if the Mastering Regular Expressions book by o'reilly 
> really is the best book and if it will help me alot, can anyone here
> provide a review?

My experience with any O'Reilly book (well, just the Java In a
Nutshell) has been that they are fairly good. Not the best, but certain
better than most books you'll find on the topic. You might also try
looking at online references for regular expressions, that's done the
trick for me so far.

===========================
Mike Powell
mikep@rt66.com
http://www.rt66.com/~mikep/


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

Date: Thu, 25 Jun 1998 20:38:31 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: mastering regular expressions
Message-Id: <3592FB97.10DD33C9@gpu.srv.ualberta.ca>

Amanda Silver wrote:
!
! i also was wondering if the Mastering Regular Expressions book by
! o'reilly really is the best book and if it will help me alot, can
! anyone here provide a review?

It is a very well written book...surprisingly readable without
loss of technical information --- One can learn a great deal about
regular expressions with this book and a little time.

regards
andrew


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

Date: Thu, 25 Jun 1998 22:09:12 -0400
From: Ed Beaugard <beaugard@interport.net>
Subject: Newbie problem setting up Perl, and ODBC module for NT, W95
Message-Id: <359302C8.1E302BB7@interport.net>

Can anyone help me with this?
I downloaded Activestate's Perl 5, build 310 for Windows NT so I could
use Roth's ODBC module on NT to do some ODBC stuff. Does anyone know the
correct file to download from Roth's ODBC site? If anyone can suggest a
combination of Perl for Win32 from Activestate and Roth's ODBC module
please let me know. My email address is:

beaugard@interport.net

Thanks in advance,
Ed Beaugard



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

Date: 25 Jun 1998 20:40:58 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Perl OS Redirection ??
Message-Id: <m3yaukde45.fsf@windlord.Stanford.EDU>

Russ Allbery <rra@stanford.edu> writes:

> I'm afraid that HTTP_USER_AGENT is the most you have to work from, and
> that agents can lie about their browser type (and often do for various
> reasons).  To answer the Perl content of your question, you would use an
> if statement probably based on a regex matching the environment variable,
> something like:

>         if ($ENV{HTTP_USER_AGENT} =~ /Windows 95/) {
>             print "Redirect: URL\012\015";
>         } elsif ($ENV{HTTP_USER_AGENT} =~ /Windows 3\.1/) {
>             print "Redirect: URL\012\015";
>         } else {
>             ...
>         }

Um, no.  That should be \015\012, of course.  Sorry.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Fri, 26 Jun 1998 03:06:17 +0200
From: "Ludovic DE FREITAS" <defreit@worldnet.fr>
Subject: Re: PerlIS and IIS.40 Setup.. Please help!
Message-Id: <6mus51$f2e$1@news3.isdnet.net>


Hello, i have the same probleme.
Help, please...

Brian Smith a icrit dans le message <35925db1.0@206.103.97.91>...
>This question has already been posted by another, but the response (if any)
>was sent directly to his email.  Please forgive me for asking it again...
>
>I am just beginning to break into the world of Perl.  I have an NT server
>with IIS 4.0, and have downloaded the Perl32 and PerlIS stuff from
>Activeware, installing it to what I believe is the proper specs




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

Date: 26 Jun 98 02:23:59 GMT
From: "Administrator" <w3master@infosys.ru>
Subject: Recurse functions?
Message-Id: <01bda0b2$22724960$e16c54c2@serverg1>

Hi, All!
Know anybody how i can create recurse functions in Perl 5.00.003 ?
If it's really, answer me please (with code sample) at w3master@infosys.ru



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

Date: 26 Jun 1998 03:24:12 GMT
From: ac1@fspc.netsys.itg.telecom.com.au (nobody)
Subject: Re: Remove blank  too much lines from a text file
Message-Id: <6mv48s$7e5@newsserver.trl.OZ.AU>

Brent Michalski (perlguy@inlink.com) wrote:
: You could easily do something like:

: open(INFILE,"$filename");
: open(OUTFILE,">$filename.out");

: while(<INFILE>){
:  print $_ OUTFILE if($_ ne "");
hmmmm. ...ne "\n"); ?
: }

: close;

: HTH,

: Brent


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

Date: 26 Jun 1998 03:16:51 GMT
From: ac1@fspc.netsys.itg.telecom.com.au (nobody)
Subject: Re: RTF parsing
Message-Id: <6mv3r3$7e5@newsserver.trl.OZ.AU>

Andy Wardley (abw@cre.canon.co.uk) wrote:
: Michele Beltrame <mick@io.com> wrote:
: >I need a Perl module or function to parse RTF (Rich Text Format) or on
: >second choice MS WinWord DOC files. 

: You and the rest of the world!  

: RTF is a mind-blowingly hideous format and writing a parser is no mean feat.
: To my knowledge, the only fully-compliant RTF parser is Microsoft's own.
: Considering how often the format changes (and different versions are often 
: incompatible with each other), this isn't too surprising.

: I've written a very basic RTF tokeniser which splits an RTF input stream 
: into component parts.  It's raw, but it works.  You will probably need to
: do some work on it to get it to do anything serious.  

: I'll package it up and upload it to CPAN later today.  Look for RTF::Parser.

We wrote an RTF parser to turn our Word-based docs in to man pages and
found that Microsloth don't even follow their own standards.

AC.

: A


: --
: Andy Wardley <abw@kfs.org>   Signature regenerating.  Please remain seated.
:      <abw@cre.canon.co.uk>   For a good time: http://www.kfs.org/~abw/


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

Date: Thu, 25 Jun 1998 21:37:46 -0400
From: HU <hurban@snet.net>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Searching through a file
Message-Id: <3592FB6A.60EC1F24@snet.net>

I regret leaving the chomp in.  It was there to clean up the output for
debugging.  I think I can clarify the question though.  Is there a way
to NOT read a line at a time and still use pattern matching?  I really
want to look for a potentially multi line pattern and write this out to
a file with a semi colon at the end (c header file).  All the examples I
see are line oriented.

Howard



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

Date: Thu, 25 Jun 1998 21:34:46 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Strange ommission from perl function list
Message-Id: <comdog-ya02408000R2506982134460001@news.panix.com>
Keywords: from just another new york perl hacker

In article <m3wwa5gfzn.fsf@windlord.Stanford.EDU>, Russ Allbery <rra@stanford.edu> posted:

>Martin Gregory <mgregory@asc.sps.mot.com> writes:
>
>> Have I missed it somewhere, or are there no 'maximum' & 'minimum'
>> functions in the standard perl distribution?
>
>There aren't. 

one might try the builtin.pm module, available from CPAN, though :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers T-shirts! <URL:http://www.pm.org/tshirts.html>


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

Date: Fri, 26 Jun 1998 01:12:53 GMT
From: omid@rocketmail.com
Subject: string replace in files within subdirectories
Message-Id: <6musil$trt$1@nnrp1.dejanews.com>




Hello ;

I learned just how to replace a string using:
perl -p -i -e "s/foo/bar/g" filename

I want to do it in all directories below current recursively.
could you help me?


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 25 Jun 1998 18:38:09 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: string replace in files within subdirectories
Message-Id: <m3ra0deyda.fsf@windlord.Stanford.EDU>

omid <omid@rocketmail.com> writes:

> I learned just how to replace a string using:
> perl -p -i -e "s/foo/bar/g" filename

> I want to do it in all directories below current recursively.  could you
> help me?

Unless there's an *overriding* reason why you would *have* to have a pure
Perl solution (such as being on a platform without a functional find
command), you'll save yourself a lot of time by just doing it in the
standard Unix way.

        find . -print | xargs perl -i -pe 's/foo/bar/g'

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 26 Jun 1998 01:52:48 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: string replace in files within subdirectories
Message-Id: <6muutg$41g$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Russ Allbery <rra@stanford.edu> writes:
:        find . -print | xargs perl -i -pe 's/foo/bar/g'

Someone will probably point out the -print0 issues.
Meanwhile, there's always find2perl for the tool-challenged.

--tom
-- 
s = (unsigned char*)(SvPVX(sv));    /* deeper magic */
    --Larry Wall, from util.c in the v5.0 perl distribution


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 2987
**************************************

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