Re: vb or ubb

2003-01-13 Thread Paul Murphy
; my %replace = ( > url => '', > b => '', > i => '', > ); > > my $text = '[url]www.test.com[/url] [b][i]Hello[/i] World[/b]!'; > > for (keys %replace) { > $text =~ s|\[$_\](.*?)\[/$_\]|toHtml($replace{$_}, $1)|seg; >

Equivilence not working (forget it)

2002-12-03 Thread Paul Murphy
Don't bother. I have just seen exactly how stupid I am. "multipart" will never match "multitype". == This is driving me nuts! Look at this: if(/Content-Type:\s*(.+)\/(.+);/) { $content = $1; $subtype = $2; print $content; #this returns "multitype" print "1match $1\n"

Equivilence not working

2002-12-03 Thread Paul Murphy
This is driving me nuts! Look at this: if(/Content-Type:\s*(.+)\/(.+);/) { $content = $1; $subtype = $2; print $content; #this returns "multitype" print "1match $1\n" if $1 eq $content; print "2match $1\n" if $1 eq "multitype"; print "3match $1\n" if $content eq "multitype"; } If

Re: Repeating Regexp

2002-11-28 Thread Paul Murphy
Thanks for the answers I got for this one. There was a bit of a resounding "doh!" when I saw the "just add g" answer. I must have read about this a million times before, but those brain cells just failed to activate when I was trying to do this yesterday. Paul. You wrot

Repeating Regexp

2002-11-28 Thread Paul Murphy
Hello, this is a two part question: a how to, and a how best to. I have a string of numbers: "2329238023089823" And I want insert a space after each number. I can see how to insert after the first: s/(\d)/$1 / Can any one tell me how I can get the regexp to continue through the string and

RE: No access to /etc/protocols

2002-02-28 Thread Paul Murphy
Thanks for the advice Luke, but I don't quite get what you are saying. If I copy the contents of /etc/protocols into my Perl script, then surely it will just fail to compile? Paul. >From: Luke Bakken Reply-To: [EMAIL PROTECTED] To: Paul Murphy CC: >[EMAIL PROTECTED] Subject: RE

RE: No access to /etc/protocols

2002-02-28 Thread Paul Murphy
f an article > that has been posted to perl.beginners as well. > > >>>>> "Paul" == Paul Murphy <[EMAIL PROTECTED]> writes: > > Paul> Hello everyone. > > Paul> My ISP doesn't have /etc/protocols world readable, and so IO::Socke

re: No access to /etc/protocols

2002-02-27 Thread Paul Murphy
Thanks Jenda. Is there a particular way I have to implement this? I have the following code but it runs the normal getproto rather than my one. -- #/bin/perl -w sub my_getprotobyname { print "hello"; } *CORE::GLOBAL:

No access to /etc/protocols

2002-02-27 Thread Paul Murphy
Hello everyone. My ISP doesn't have /etc/protocols world readable, and so IO::Socket doesn't work, as getprotobyname and getprotobynumber fail. I am using the Mail::POP3Client wrapper. I am trying to come up with a workaround, and the best I can come up with is a horrendous hack to IO::Socke

Win32 fork(), parent then child

2001-06-29 Thread Paul Murphy
Hey everyone: Anyone using fork() in Win32 ActivePerl? Consider the following code: use FileHandle; STDOUT->autoflush(1); $kidpid = fork(); print "pid = $$ kidpid = $kidpid\n"; print "pid = $$ kidpid = $kidpid\n"; print "pid = $$ kidpid = $ki

Re: Joining variables

2001-06-27 Thread Paul Murphy
Umm... like $newvar = sprintf("$var1-$var2-$var3"); Can we get uglier? >>> Chas Owens <[EMAIL PROTECTED]> 6/27/2001 03:06:28 pm >>> On 27 Jun 2001 14:37:14 +0100, Pierre Smolarek wrote: > > On Wed, Jun 27, 2001 at 02:07:22PM +0100, Pierre Smolarek wrote: > > > $newvar = $var1."-".$var2."-".$va

Associative array of a normal array

2001-06-26 Thread Paul Murphy
Hi all. Is there any way in Perl to set up an associative array of normal arrays? So the key would be an arbitrary string, and the value for instance would be an array of numbers. I'll explain what I want to do, as their may well be better ways: Suppose I have a file like this: Hello; 1 Go

RE: Unsubscribing

2001-06-26 Thread Paul Murphy
Can you not filter on the To: field? Paul. >>> Johan van Aarde <[EMAIL PROTECTED]> 6/26/2001 01:17:19 pm >>> What would be nice is to have in the subject the words [PERL] or something so my rules will sort this automatically to the perl folder. -Original Message- From: Chris Hedemark [