Re: $_ and while stmt

2002-05-01 Thread Patrick Diffley
Try this: for ($i=0; $i<@inlocation; $i++) { print ("Error location is required\n") if ( $inlocation[$i] !~ /\w+/); } - Original Message - From: "Scot Robnett" <[EMAIL PROTECTED]> To: "Teresa Raymond" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, May 01, 2002 8:03 PM

RE: $_ and while stmt

2002-05-01 Thread Scot Robnett
You could use 'for' instead of 'while' in this case, I think. Example: my @inlocation = (one,two,three,four,five,six,seven); for (@inlocation) { if(($_ eq "two") or ($_ eq "four") or ($_ eq "six")) { print "$_ is an even number. \n"; } else { print "$_ is an odd number. \n"; } } Scot Ro

$_ and while stmt

2002-05-01 Thread Teresa Raymond
I'm trying to test @inlocation to make sure it is not null or filled in with a space but although I input via ckbox a value, the error msg is returned. I am not comfortable using the while or the $_. while (length @inlocation) {if ($_ eq "" || $_ eq " ") { print "Error location is required\n";

RE: Does CGI.pm have escapeURL?

2002-05-01 Thread Camilo Gonzalez
The HTML escaping feature of CGI is called with 'use CGI qw(:escapeHTML);'. It must be called explicitly or it will not be imported into your namespace. As a function it can be called as escapeHTML("some stuff & some other stuff") though I'm sure you can use the OO method. The URL escaping featur

Re: Does CGI.pm have escapeURL?

2002-05-01 Thread Adam Morton
The URL encoding versions are in CGI::Util and are just called 'escape' and 'unescape'. I don't know why they are not documented in the CGI perldoc, or even the CGI::Util perldoc. I guess they are considered private, although they are handy. -Adam - Original Message - From: "Camilo Gon

RE: Does CGI.pm have escapeURL?

2002-05-01 Thread Bob Showalter
> -Original Message- > From: John Brooking [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, May 01, 2002 1:49 PM > To: Beginners CGI > Subject: Does CGI.pm have escapeURL? > > > Does CGI.pm have some kind of URL escape function, > similar to escapeHTML? I couldn't find any > documentation o

RE: Does CGI.pm have escapeURL?

2002-05-01 Thread Camilo Gonzalez
Try 'escapeHTML()'. -Original Message- From: John Brooking [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 12:49 PM To: Beginners CGI Subject: Does CGI.pm have escapeURL? Does CGI.pm have some kind of URL escape function, similar to escapeHTML? I couldn't find any documentation

Does CGI.pm have escapeURL?

2002-05-01 Thread John Brooking
Does CGI.pm have some kind of URL escape function, similar to escapeHTML? I couldn't find any documentation on it in "perldoc CGI", and I tried the obvious, "escapeURL", with negative results. I suppose that the reason there is no obvious function for this is if you have a form submitted with GET

Re: HELP!

2002-05-01 Thread fliptop
Bob Showalter wrote: > > They are the same as far as the effect on %array. But you > shouldn't use map() in a void context, as it constructs a > result list which is then thrown away. So your iterative > approach is better. sorry, i should have done: my %a = map { $_ => 1 } @a; my @unique

Re: HELP!

2002-05-01 Thread drieux
On Wednesday, May 1, 2002, at 05:10 , Andrew Rosolino wrote: > Say I have an array that contains! > > @array = qw( cool cool dog dog dog ); > > Now I want to sum that up, so that the array only has > 1 COOL and 1 DOG, so it would contain! > > @array = qw( cool dog ); we just went around this on

RE: HELP!

2002-05-01 Thread Bob Showalter
> -Original Message- > From: Gary Stainburn [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, May 01, 2002 10:53 AM > To: Bob Showalter > Cc: Perl Help > Subject: Re: HELP! > > > On Wednesday 01 May 2002 2:26 pm, Bob Showalter wrote: > [snip] > > > {$array{$_}++} foreach @array; > > > > They

Re: HELP!

2002-05-01 Thread Gary Stainburn
On Wednesday 01 May 2002 2:26 pm, Bob Showalter wrote: [snip] > > {$array{$_}++} foreach @array; > > They are the same as far as the effect on %array. But you > shouldn't use map() in a void context, as it constructs a > result list which is then thrown away. So your iterative > approach is better

Help about transfer data from perl to java

2002-05-01 Thread Qi zhang
Hello all, I used the java to setup the user's interface and the perl to do the local job processing. My question is: How to output data from perl processing directly to the java interface without file transfer? How to perform the realtime data transfer between perl and java? How to embed the java

Need help ...

2002-05-01 Thread Mailing List
*** Sorry for the typo in the previous mail Hello Gurus, I am learning perl just by book "sams teach your self perl in 24 Hours". I was trying to write a program for but due to some error in the program, it does not work.. What I want is: 1. On excution you have choice to select 2. if you se

Need Help ...

2002-05-01 Thread Mailing List
Hello Gurus, I am learning perl just by book "sams teach your self perl in 24 Hours". I was trying to write a program for but due to some error in the program, it does work.. What I want is: 1. On excution you have choice to select 2. if you select choice # 5, it should get confirm if I want t

RE: HELP!

2002-05-01 Thread Bob Showalter
> -Original Message- > From: Gary Stainburn [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, May 01, 2002 9:50 AM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Cc: Perl Help > Subject: Re: HELP! > > > On Wednesday 01 May 2002 1:43 pm, fliptop wrote: > > Andrew Rosolino wrote: > > > Say I hav

Re: HELP!

2002-05-01 Thread Gary Stainburn
On Wednesday 01 May 2002 1:43 pm, fliptop wrote: > Andrew Rosolino wrote: > > Say I have an array that contains! > > > > @array = qw( cool cool dog dog dog ); > > > > Now I want to sum that up, so that the array only has > > 1 COOL and 1 DOG, so it would contain! > > > > @array = qw( cool dog ); >

Re: HELP!

2002-05-01 Thread fliptop
Andrew Rosolino wrote: > Say I have an array that contains! > > @array = qw( cool cool dog dog dog ); > > Now I want to sum that up, so that the array only has > 1 COOL and 1 DOG, so it would contain! > > @array = qw( cool dog ); my %array; map { $array{$_}++ } @array; my @unique = keys %a

HELP!

2002-05-01 Thread Andrew Rosolino
Say I have an array that contains! @array = qw( cool cool dog dog dog ); Now I want to sum that up, so that the array only has 1 COOL and 1 DOG, so it would contain! @array = qw( cool dog ); Note: I'm doing this for one off my scripts and it contains more text than that, thats just an example.