RE: Do Else Unless Statements Exist?

2004-01-11 Thread Charles K. Clarkson
Dan Anderson <[EMAIL PROTECTED]> wrote: : : Does Perl have any kind of else / unless statements, sort of : like elsif? I tried: : : if ($foo) { : } : else unless ($bar) { : } What about: elsif ( ! $bar ) { } HTH, Charles K. Clarkson -- Head Bottle Washer, Clarkson Energy Homes,

Do Else Unless Statements Exist?

2004-01-11 Thread Dan Anderson
Does Perl have any kind of else / unless statements, sort of like elsif? I tried: if ($foo) { } else unless ($bar) { } but it just gave me syntax errors. And I guess I could just do: if ($foo) { } else { unless ($bar) { } } But the place in the code I was trying it was for clarity, and all

Re: script works from shell but not http

2004-01-11 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > #!/usr/bin/perl -w > use strict; > BEGIN{open(STDERR, ">./err.txt")} > print "Content-Type: text/html\n\n"; > foreach my $key (sort keys %ENV) { > print "\$ENV{$key} = $ENV{$key}\n"; > } > > None of my scripts are functioning on my new server. The BEGIN statement >

Re: Perl mapping solution

2004-01-11 Thread R. Joseph Newton
Kyle Sexton wrote: > I am trying to implement something akin the the perl monger map located > at http://bath.pm.org/map/. I have got my map to the point that it > will pull lat/long information from a web server and generate a map. > What I am looking to do now is implement zooming in on the map

Re: script works from shell but not http

2004-01-11 Thread Dan Anderson
On Sun, 2004-01-11 at 11:47, zentara wrote: > On Sun, 11 Jan 2004 06:10:32 EST, [EMAIL PROTECTED] wrote: > > >#!/usr/bin/perl -w > >use strict; > >BEGIN{open(STDERR, ">./err.txt")} > >print "Content-Type: text/html\n\n"; > >foreach my $key (sort keys %ENV) { > > print "\$ENV{$key} = $ENV{$key}

netstat in Perl and OT

2004-01-11 Thread mcdavis941
Hi list, 1. Does anyone know of a module in CPAN which lets you implement the netstat function within Perl code? I was expecting to see something like netstat.pm, but a CPAN search turned up nothing. 2. If there's no such module, why not? Any guesses? It's seems like the kind of thing that g

Re: Matching invalid characters in a URL

2004-01-11 Thread Dan Anderson
On Fri, 2004-01-09 at 16:54, Wiggins d Anconia wrote: > > > Any suggestions? Thanks for your help and thoughts. > > > > It is much easier to define the set all chars must be in then not. Use > > the =! which is the complement of all charachters matched by =~. > > Alternatively, I believe there i

Re: script works from shell but not http

2004-01-11 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > > #!/usr/bin/perl -w > use strict; > BEGIN{open(STDERR, ">./err.txt")} > print "Content-Type: text/html\n\n"; > foreach my $key (sort keys %ENV) { > print "\$ENV{$key} = $ENV{$key}\n"; > } > > None of my scripts are functioning on my new server. The BEGIN > statemen

Re: Regular Exp for Numerics

2004-01-11 Thread Rob Dixon
Mallik wrote: > > I have to compare numeric values as below > > if (($segsep == 13) || ($segsep == 10) || ($segsep == 0)) > > Can I use the reg exp as below > > if ($segsep =~ /^(13|10|0)$/) > > My question is, is it adviceable to use reg exp for numeric values (entire > value). > If yes, why? > If

script works from shell but not http

2004-01-11 Thread Motherofperls
#!/usr/bin/perl -w use strict; BEGIN{open(STDERR, ">./err.txt")} print "Content-Type: text/html\n\n"; foreach my $key (sort keys %ENV) { print "\$ENV{$key} = $ENV{$key}\n"; } None of my scripts are functioning on my new server. The BEGIN statement doesn't write err.txt But it does function

Regular Exp for Numerics

2004-01-11 Thread Mallik
Dear Friends, I have to compare numeric values as below if (($segsep == 13) || ($segsep == 10) || ($segsep == 0)) Can I use the reg exp as below if ($segsep =~ /^(13|10|0)$/) My question is, is it adviceable to use reg exp for numeric values (entire value). If yes, why? If not, why? Thank you