URL decode

2002-10-05 Thread Kevin
Hello, I need to progrmatically decode the following UTF-8 data via CGI: q=%D7%91%D7%A8%D7%99%D7%AA Can this be done? -Kevin -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: URL decode

2002-10-05 Thread Kevin Meltzer
URI::Escape can do this for you. # perl -MURI::Escape -e 'print \ uri_unescape(%D7%91%D7%A8%D7%99%D7%AA)' esc.txt The contents of esc.txt: \xd7\x91\xd7\xa8\xd7\x99\xd7\xaa Do what you need to with the output. Cheers, Kevin On Sat, Oct 05, 2002 at 08:25:31AM -0700, Kevin ([EMAIL PROTECTED])

select multiple

2002-10-05 Thread Vincent van Kuler
How can I get the selected items from a select multiple Example: form method=post action=do_it.pl SELECT multiple size=7 name=component-select OPTION name=first selected value=Component_1_aSelected Component_1/OPTION OPTION name=secondComponent_3/OPTION OPTION

Re: select multiple

2002-10-05 Thread Kevin Meltzer
Read the docs for CGI.pm perldoc CGI Cheers, Kevin On Sat, Oct 05, 2002 at 07:33:33PM +0200, Vincent van Kuler ([EMAIL PROTECTED]) said something similar to: How can I get the selected items from a select multiple Example: form method=post action=do_it.pl SELECT multiple size=7

Re: Cannot validate dynamic html with W3C because of missing Character Encoding

2002-10-05 Thread Todd Wade
Todd Wade wrote: Richard wrote: Hello I wrote a script that creates dynamic html. I validated the resulting html code with W3C and it couldn't validate it because it didn't detect the character encoding. I added the meta information to the header with the -meta argument: snip /

Re: Check for empty array

2002-10-05 Thread Dharmender Rai
You can use defined() function by checking for the first element. #!/usr/bin perl use strict; use warnings; my @arr=(); ## empty my $ref=\@arr; ## if(!defined ($ref-[0]) { # do your work here } if (!define ($arr-[0]) { # do your work } --- dan [EMAIL PROTECTED] wrote: or if (!$array[0])

Re: Check for empty array

2002-10-05 Thread Michael Fowler
I just noticed this thread, so forgive me if someone has already mentioned this, or if I'm missing the original point. I just saw some bad examples of how to accomplish what the subject asks, and felt I should chime in. The idiomatic method for checking if an array has elements is simply:

Genetic algorithms applied with Perl

2002-10-05 Thread Frank Carlos
Here's food for thought: One of the more intriguing types of algorithm is the genetic algorithm. Genetic algorithms mimic Darwinian natural selection, where fitness selects individuals for survival, breeding, and, hence, adaptive mutation. Genetic algorithms applied with Perl covered the

how to pass a list to a subroutine?

2002-10-05 Thread Grant Byers
Is there a simple way to unflatten @_ into a list within a subroutine? ie: sub mySub(%); mySub(arg1='val1',arg2='val2',arg3='val3') now i want to expand @_ back into a list. Cheers, Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Will not read line and split.

2002-10-05 Thread dan
the reason to this being you need to append my to declare each variable before use.. my $file; my $in_dir; my $tstopen; etc.. try phrase it like this: #!/usr/bin/perl use strict; use warnings; # Open Files my $in_dir; opendir(IN_DIR, /opt/crxml/tstdir) or die directory does not exist; # Read

Re: Check for empty array

2002-10-05 Thread John W. Krahn
Dharmender rai wrote: You can use defined() function by checking for the first element. No, checking the first element of an array will tell you whether or not the first element of the array is defined, it will not tell you if the array is empty. John -- use Perl; program fulfillment --

Re: how to pass a list to a subroutine?

2002-10-05 Thread John W. Krahn
Grant Byers wrote: Is there a simple way to unflatten @_ into a list within a subroutine? ie: sub mySub(%); mySub(arg1='val1',arg2='val2',arg3='val3') now i want to expand @_ back into a list. Did you read the perlsub document that is supplied with Perl? perldoc perlsub John --

Re: how to pass a list to a subroutine?

2002-10-05 Thread James Edward Gray II
If you want it in hash form, as it looks from your example, just copy it to a hash: my %hash = @_; On Friday, October 4, 2002, at 11:57 PM, Grant Byers wrote: Is there a simple way to unflatten @_ into a list within a subroutine? ie: sub mySub(%);

RE: how to pass a list to a subroutine?

2002-10-05 Thread nkuipers
= Original Message From James Edward Gray II [EMAIL PROTECTED] = If you want it in hash form, as it looks from your example, just copy it to a hash: my %hash = @_; Remember though that if you are passing anything in scalar context, like an scalar or a reference, or more than one

Re: WHO IS NAVER-MAILER@naver.com ???

2002-10-05 Thread David Garamond
[EMAIL PROTECTED] wrote: Every time I send a message to this list, I receive a message from [EMAIL PROTECTED] immediately afterwards. It appears to be garbage (lots of screwy characters...). Where is this coming from? Am I the only one receiving these? i suspect there is/are bouncing

Safe.pm examples?

2002-10-05 Thread David Garamond
i'm looking for something like a sandbox/compartment (like rexec module in python) so that i can be [reasonably] confident running untrusted snippets of code from inside the same process. Safe.pm seems like the perl way of doing it, right? however, from what i skimmed from the posts i got from

Group and concatenate

2002-10-05 Thread Paul Van Dalen
Hi Gang, Given this input: 222xxxJ 222wwwDD 222ccffFFF 909eee 909FFF 909j 888JJJ 888HHH I'd like to split the input, group it by the first column, and, for that group, print out a concatenated second

Re: Group and concatenate

2002-10-05 Thread Paul Johnson
On Sat, Oct 05, 2002 at 07:02:09PM -0400, Paul Van Dalen wrote: Hi Gang, Given this input: 222xxxJ 222wwwDD 222ccffFFF 909eee 909FFF 909j 888JJJ 888HHH I'd like to split the input, group

Re: Group and concatenate

2002-10-05 Thread James Edward Gray II
perl -pe 's/^(\d+\s+)([a-zA-Z]+)\s+([a-zA-Z]+)$/$1$2;$3/' infile outfile On Saturday, October 5, 2002, at 06:02 PM, Paul Van Dalen wrote: Hi Gang, Given this input: 222xxxJ 222wwwDD 222ccffFFF 909eee 909FFF 909j

Passing wildcards in filenames

2002-10-05 Thread Patel, SamirX K
If I want to run a script on any file with a .vhd extension in the directory, how do I pass *.vhd to the perl script? Easy one-line example (Note, I'm running on Windows): Say I want to find the pattern COMPONENT in any file with a .vhd extension: perl -lane if (/COMPONENT/) { printf \$ARGV