Re: [MacPerl-AnyPerl] Filter a url

2004-10-31 Thread Ronald J Kimball
On Sun, Oct 31, 2004 at 01:48:10PM +0100, Eelco Alosery wrote: > Hello, > > I want to filter a url from $ENV{'HTTP_REFERER'} > If the url is http://www.testdomein.nl/test.html > I only want a result testdomein.nl > > I have been testing whit this script > $url =~ s/.*?\.(.+?)\/.*?/$1/is; > > It

Re: [MacPerl-AnyPerl] pestering diags

2004-04-14 Thread Ronald J Kimball
On Tue, Apr 13, 2004 at 10:54:55PM +0200, Louis Pouzin wrote: > I'm puzzled. Why is gore interfering at all, and what's wrong with the > squeaking statements ? What's wrong with the statements is exactly what the warnings are telling you! Value of construct can be "0"; test with defined() at ql

Re: [MacPerl-AnyPerl] negative lookahead xhtml tag

2002-09-17 Thread Ronald J. Kimball
On Tue, Sep 17, 2002 at 12:00:45PM +0200, allan juul wrote: > hi > > we need to replace tags like: > > > > to: > > > > > it seems so simple but i am on the verge of giving up understanding the > negative lookahead logic. > > this is how far i have come (obviously not working) > > my $s

Re: [MacPerl-AnyPerl] verifing a string

2002-07-31 Thread Ronald J Kimball
On Wed, Jul 31, 2002 at 07:21:04PM +0200, Eelco Alosery wrote: > I read whit LWP::Simple a url, and from that string i need the keywords. > > I use this script: > > > if ( $srting =~ s//$1/ig ) If you use .* inside the quotes then you may end up matching too much. Try this instead: s/]*>/$1/i

Re: [MacPerl-AnyPerl] "our" declaration

2002-07-02 Thread Ronald J Kimball
On Tue, Jul 02, 2002 at 03:59:08PM +0900, Joel Rees wrote: > Get this warning, and I know why, but it mentions an "our declaration": > > --- > Name "URI::URL::ABS_REMOTE_LEADING_DOTS" used only once: possible typo > at > autohits.pl line 282

Re: [MacPerl-AnyPerl] Pattern matching question

2001-12-18 Thread Ronald J Kimball
On Tue, Dec 18, 2001 at 02:53:24PM +, Adam Witney wrote: > > Basically I want to strip out the contents of the first [], but this seems > to be matching from the outside in. Is there a way to make it look for the > first ] after the [ ? Use a negated character class. m/\[(EC:[^\]]+)\]/ Ron

Re: [MacPerl-AnyPerl] hash of hashes -> sorting

2001-10-29 Thread Ronald J Kimball
On Mon, Oct 29, 2001 at 07:37:43PM +0100, allan wrote: > thanks ronald > for the suggestion which looks better but is just as ineffecient as mine > original. i timed both versions twice traversing 878 files in 1006 > directories of total size 839.441066 MB. both taking 280 secs each time > around

Re: [MacPerl-AnyPerl] hash of hashes -> sorting

2001-10-29 Thread Ronald J Kimball
On Mon, Oct 29, 2001 at 05:26:39PM +0100, allan wrote: > > Have you considered using a hash of arrays instead? > > > > push @{$files{'.pl'}}, ':folder_one:byte.pl'; > > push @{$files{'.pl'}}, ':folder_one:byte.pl'; > > push @{$files{'.gif'}}, ':folder_one:some.gif'; > > > > etc. > > > > Ronald

Re: [MacPerl-AnyPerl] hash of hashes -> sorting

2001-10-29 Thread Ronald J Kimball
On Sun, Oct 28, 2001 at 01:24:35PM +0100, allan wrote: > hi > while traversing a filesystem i want to output a list of all files > grouped by file extensions. > this is no problem in itself but in the output i want the file names to > appear in their correct sorted or nested order (which is in the

Re: [MacPerl-AnyPerl] slurp - line numbering

2001-10-14 Thread Ronald J Kimball
On Sun, Oct 14, 2001 at 01:00:15PM +0200, allan wrote: > is it somehow possible - while slurping a file - to still keep track of > the line numbers? Not with the $. variable. $. holds the number of chunks read, which is the number of lines only if $/ is "\n". > something like: > > #!/usr/bin/

Re: [MacPerl-AnyPerl] Speed of reformatting large file

2001-07-31 Thread Ronald J Kimball
On Tue, Jul 31, 2001 at 04:46:59PM -0400, Adam Witney wrote: > > Hi, > > I have a file which contains about 45000 lines of 50 characters each. I want > to reformat it to contain 60 characters each. > > I can read the whole file in and remove the line endings and then print out > lines of 60 cha

Re: [MacPerl-AnyPerl] singlesqoutes <-> doubleqoutes

2001-07-20 Thread Ronald J Kimball
On Fri, Jul 20, 2001 at 10:08:13PM +0200, allan wrote: > i know theres more than one way to do it, but i would like a cleaner way. > im trying to globally replace singlesqoutes with doubleqoutes and vice > versa and the script below does seem to work but its rather an akward > way to do it. is th

Re: [MacPerl-AnyPerl] Re: macperl deletes lines ....

2001-06-20 Thread Ronald J Kimball
On Wed, Jun 20, 2001 at 10:04:13AM +0200, Sean Carte wrote: > Add this line to the beginning of the script: > > $/ = ''; > > That makes Perl ignore the newlines and makes the regexp work on the > entire file. Actually, setting $/ to '' puts Perl into paragraph mode, with blank lines (i.e. cons

Re: [MacPerl-AnyPerl] macperl deletes lines ....

2001-06-19 Thread Ronald J Kimball
On Tue, Jun 19, 2001 at 11:33:27AM -0400, Brandon Barker wrote: > I'm having trouble writing a script that will remove the regular > expression "" in a text file in macperl. At first I thought I was > making a programming mistake but I tried the same script in Linux and it > worked as expected

Re: [MacPerl-AnyPerl] input to formatted date

2001-03-12 Thread Ronald J Kimball
On Mon, Mar 12, 2001 at 05:07:03PM +1100, John Murray wrote: > Given you have $yearnum $monthnum $daynum as input, you want a dayname out > of the array @monthdays defined below. Here's my untested [away from perl at > moment] go: > > @daynames = ('mon','tue','wed','thu','fri','sat','sun'); > @mo

Re: [MacPerl-AnyPerl] Terminating a perl script from the shell cleanly?

2001-02-07 Thread Ronald J Kimball
On Wed, Feb 07, 2001 at 01:22:18PM -0500, Jim Correia wrote: > > In particular, I want to nuke a program in mid-execution and have perl > clean up as best as it can at this point, which includes flushing the > buffers of any open files. The easiest solution is to just turn on autoflush when the