Oops! (was Re: if then and perl)

2001-07-18 Thread Sascha Kersken
Oops! I just discovered a little mistake made by quick copy'n'paste. The line elsif ($url =~ /^http:\/\//i) should read elsif ($url =~ /^ftp:\/\//i) of course. Sascha -- "We Apologize For The Inconvenience" (God's Last Message To His Creation by Douglas Adams)

Re: if then and perl

2001-07-18 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Sascha Kersken" <[EMAIL PROTECTED]> w hispered: | if ($url =~ /^http:\/\//i) Try and save yourself from going blind trying to decipher all those slashes and backslashes. If you have a literal slash in your code, change your delimiters: if ($url =~ m

Re: if then and perl

2001-07-18 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Sparkle Williams" <[EMAIL PROTECTED]> whispered: | I'm trying to write a perl script that can distinguish between http and ftp | files. I got it to work on my UNIX system using case, but I can't seem to | get it to function correctly when I switch to usin

Re: Oops! (was Re: if then and perl)

2001-07-18 Thread Michael Fowler
On Wed, Jul 18, 2001 at 03:11:22PM +0200, Sascha Kersken wrote: > Oops! > I just discovered a little mistake made by quick copy'n'paste. > The line >elsif ($url =~ /^http:\/\//i) > should read > elsif ($url =~ /^ftp:\/\//i) > of course. Actually, it should probably read something like:

Re: if then and perl

2001-07-18 Thread Will Cottay
Or, at the risk of beating a dead horse: #!/usr/bin/perl -w use strict; my $url = shift || ''; $url =~ /^(.*?):/; my $protocol = lc($1); my %handlers = ( 'http' => \&http_handler, 'ftp' => \&ftp_handler, 'https' => \&http_handler, 'ftps'

Re: if then and perl

2001-07-18 Thread Sparkle Williams
MANY MANY THANKS!!! >From: "Sascha Kersken" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Subject: Re: if then and perl >Date: Wed, 18 Jul 2001 14:56:49 +0200 > >Hi! >This looks a bit strange to me. >I wonder how this could ever have run on UNIX -

Oops! (was Re: if then and perl)

2001-07-18 Thread Sascha Kersken
Oops! I just discovered a little mistake made by quick copy'n'paste. The line elsif ($url =~ /^http:\/\//i) should read elsif ($url =~ /^ftp:\/\//i) of course. Sascha -- "We Apologize For The Inconvenience" (God's Last Message To His Creation by Douglas Adams)

Re: if then and perl

2001-07-18 Thread Sascha Kersken
"I'm sorry. This program does not support that type of file." ; } Sascha - Original Message - From: "Sparkle Williams" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 18, 2001 2:45 PM Subject: if then and perl > I

if then and perl

2001-07-18 Thread Sparkle Williams
I'm trying to write a perl script that can distinguish between http and ftp files. I got it to work on my UNIX system using case, but I can't seem to get it to function correctly when I switch to using if-then on my Windows NT system. Does anyone have any ideas as to how I can correctly adjust