Re: search and replace

2002-01-19 Thread Jonathan E. Paton
--- Rene Verharen <[EMAIL PROTECTED]> wrote: > Hi, > > In one of my scripts I do a search and replace like this > : > > $text =~ s/$search/$replace/; > > This works fine, but if $search or $replace contains > one or more words between round brackets () it doesn't > what I had in mind : >

Re: Curtis Poe Script/Lesson Questions

2002-01-07 Thread Jonathan E. Paton
> 1. Why doesn't "use strict" complain about the $1 not > being declared? $1, $2 etc are locally scoped variables which come from the regex. A regex like: m/(..)(.*)/ will place the first two characters into $1, and the rest into $2 - according to the parathesis. > 2. How can I filter ALL of

Re: my stupit script...

2001-12-17 Thread Jonathan E. Paton
> I made a script that show /var/log/messages* when you > press submit. But!!! It doesn't come out to the last > when the file size is upper than the few MB. > > ... [SNIP] ... > > if ( $q->param( "show" ) ) { > open( LOG, $q->param( "check" ) ); > @log = ; > close( LOG ); > }

Re: map

2001-12-12 Thread Jonathan E. Paton
> I' d like to know if it' s possible to print the number > of occurences of letter "o" inside a variable string, > using perl function map. $qty = $string =~ tr/o/o/; Shortest and seemingly the fastest solution. Jonathan Paton __ Do You Yaho

Re: 'SafePerl'?

2001-12-04 Thread Jonathan E. Paton
> Our web server enables us to use 'SafePerl' for > CGI scripts. I can find little information relating > to this, and what subset of Perl commands are > enabled (or correctly, which commands are disabled). > Can anyone point me in the right direction? You are probably looking for the "Safe" modu