a regular expression issue

2008-04-04 Thread icarus
Hi, I want to display 'canada', 'cane', 'canine, 'ca.e.02'. Problem: It only displays 'canada' #!/usr/bin/perl use strict; use warnings; my $file; my @xfiles; @xfiles = (canada, cane, cane02, ca.e.02, canine, .hidden); foreach $file (@xfiles){ #want canada only for this iteration if

Re: Perl Stops Processing

2008-04-04 Thread inthepickle
I give thanks to everyone for all of the suggestions. Especially you Jenda . Yours is the easiest to implement, and exactly what I was looking for. David -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Perl and XML

2008-04-04 Thread Seth
I have an existing xml file that I need to display. Perl was suggested a good way to do that. I am using XML::Simple. None of the examples use the format that I have. Here is an example of what I am dealing with: config param name=SequenceNumber66/param param name=T16/param param

Re: week in a year

2008-04-04 Thread Ben Bullock
On Apr 2, 9:00 pm, [EMAIL PROTECTED] (Jennifer G.) wrote: How do I know this day is in NO. which week in this year? for example, Jan 1 is in the no.1 week of this year. but how about the current day? This seems to be a frequently asked question:

Re: a regular expression issue

2008-04-04 Thread John W. Krahn
icarus wrote: Hi, Hello, I want to display 'canada', 'cane', 'canine, 'ca.e.02'. Problem: It only displays 'canada' #!/usr/bin/perl use strict; use warnings; my $file; my @xfiles; @xfiles = (canada, cane, cane02, ca.e.02, canine, .hidden); my @xfiles = (canada, cane, cane02, ca.e.02,

Re: cpan or perl -MCPAN ?

2008-04-04 Thread LesleyB
Thanks for the reply Yitze. I simply wondered whether there was any benefit. I haven't yet tried the perl -MCPAN approach but have spent most of the day in cpan. I would expect to see perl -MCPAN in an anutomated approach somewhere I guess. I have successfully updated some modules locally

Re: Perl and XML

2008-04-04 Thread Rob Dixon
Seth wrote: I have an existing xml file that I need to display. Perl was suggested a good way to do that. I am using XML::Simple. None of the examples use the format that I have. Here is an example of what I am dealing with: config param name=SequenceNumber66/param param

Re: 4 questions

2008-04-04 Thread Wolf Blaum
Is there a 'bible' out there to read? Depending on you level of faith: learning perl by randal schwartz tom phoenix the camel book by Larry wall bless you, wolf -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

4 questions

2008-04-04 Thread tc314
Is there a l link to a brief summary of perl (5-10 pages)? What is the proper syntax to set LC_ALL for within a perl script? I want to run linux commands like sort, grep, uniq from within a perl script. But I want them to optionally continue to act like pipes. For example, I want ./perlsort to

Re: a regular expression issue

2008-04-04 Thread Wolf Blaum
hi, #!/usr/bin/perl use strict; use warnings; my $file; my @xfiles; @xfiles = (canada, cane, cane02, ca.e.02, canine, .hidden); foreach $file (@xfiles){ #want canada only for this iteration if ($file =~ /(canada)/){print $file\n - end first if - \n;} #wb: (expression) groups what

Re: a regular expression issue

2008-04-04 Thread John W. Krahn
Wolf Blaum wrote: #!/usr/bin/perl use strict; use warnings; my $file; my @xfiles; @xfiles = (canada, cane, cane02, ca.e.02, canine, .hidden); foreach $file (@xfiles){ #want canada only for this iteration if ($file =~ /(canada)/){print $file\n - end first if - \n;} #wb:

Re: Using PERL to retrieve MP3s

2008-04-04 Thread Jim
Thanks all. Can you tell me which is the best repository to use? The ActiveState one does not seem to have most of the modules I need. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: sort without ignoring hyphens

2008-04-04 Thread tc314
On Apr 2, 9:04 am, [EMAIL PROTECTED] (Matthew Whipple) wrote: LC_ALL=C sort echo.txt [EMAIL PROTECTED] wrote: On Mar 29, 3:19 pm, [EMAIL PROTECTED] (John W. Krahn) wrote: [EMAIL PROTECTED] wrote: When I do string comparisons in perl the strings seem to ignore the embedded hyphens.

Re: What is the simplest way to do this?

2008-04-04 Thread Rob Dixon
dylanthomasfan wrote: Hi All, I already know of a way to do the following, but I want to know the simplest way to do this in perl: I have an input string which is of the following form: ((a+b)*c)*(e+f*(g+h-i*(j+k)))+u I want to know how to split it easily so that I end up with an

Re: What is the simplest way to do this?

2008-04-04 Thread John W. Krahn
dylanthomasfan wrote: Hi All, Hello, I already know of a way to do the following, but I want to know the simplest way to do this in perl: I have an input string which is of the following form: ((a+b)*c)*(e+f*(g+h-i*(j+k)))+u I want to know how to split it easily so that I end up with an

Re: Using PERL to retrieve MP3s

2008-04-04 Thread Gunnar Hjalmarsson
Jim wrote: Can you tell me which is the best repository to use? The ActiveState one does not seem to have most of the modules I need. Really? Can you give us examples of such modules? This is one of the AS repositories I'm using: http://ppm4.activestate.com/MSWin32-x86/5.10/1002/ -- Gunnar

Re: 4 questions

2008-04-04 Thread Gunnar Hjalmarsson
[EMAIL PROTECTED] wrote: Is there a l link to a brief summary of perl (5-10 pages)? http://perldoc.perl.org/perlintro.html What is the proper syntax to set LC_ALL for within a perl script? http://perldoc.perl.org/perllocale.html#The-setlocale-function -- Gunnar Hjalmarsson Email:

Regex: Lines where one pattern may not occure, but other pattern has to?

2008-04-04 Thread maillists
Hi I am trying to regex a make output line (g++) and don't get it together. What I want is: All lines where the -c option does not occure, neither before nor after the -o option and then extract the portion after the -o option. $regexApplication = '(?![ \t]-c[ \t])-o[

String To Hash Conversion

2008-04-04 Thread Prabu Ayyappan
Hi All, I want to convert a string into a Hash data structure For Example String: [['aaa',{27' = '543','21' = '111','Client' = '543','chat' = '111'}]] Hash: [['aaa',{27' = '543','21' = '111','Client' = '543','chat' = '111'}] From CPAN I got a module called Convert/PerlRef2String

Can't find string terminator EOHTML anywhere before EOF

2008-04-04 Thread Pau Marc Munoz Torres
Hi I just copied this script from CGI::Ajax manual at cpan.org page use strict; use CGI; # or any other CGI:: form handler/decoder use CGI::Ajax; my $cgi = new CGI; my $pjx = new CGI::Ajax( 'exported_func' = \perl_func ); print $pjx-build_html( $cgi, \Show_HTML); sub

Re: Regex: Lines where one pattern may not occure, but other pattern has to?

2008-04-04 Thread yitzle
On Fri, Apr 4, 2008 at 8:46 AM, [EMAIL PROTECTED] wrote: Hi I am trying to regex a make output line (g++) and don't get it together. What I want is: All lines where the -c option does not occure, neither before nor after the -o option and then extract the portion after the -o option.

Re: Perl and XML

2008-04-04 Thread Jenda Krynicky
From: Rob Dixon [EMAIL PROTECTED] Seth wrote: I have an existing xml file that I need to display. Perl was suggested a good way to do that. I am using XML::Simple. None of the examples use the format that I have. Here is an example of what I am dealing with: config param

Re: Can't find string terminator EOHTML anywhere before EOF

2008-04-04 Thread Jenda Krynicky
From: Pau Marc Munoz Torres [EMAIL PROTECTED] I just copied this script from CGI::Ajax manual at cpan.org page use strict; use CGI; # or any other CGI:: form handler/decoder use CGI::Ajax; my $cgi = new CGI; my $pjx = new CGI::Ajax( 'exported_func' = \perl_func );

Re: Can't find string terminator EOHTML anywhere before EOF

2008-04-04 Thread Rob Dixon
Pau Marc Munoz Torres wrote: Hi I just copied this script from CGI::Ajax manual at cpan.org page use strict; use CGI; # or any other CGI:: form handler/decoder use CGI::Ajax; my $cgi = new CGI; my $pjx = new CGI::Ajax( 'exported_func' = \perl_func ); print

Re: Regex: Lines where one pattern may not occure, but other pattern has to?

2008-04-04 Thread Rob Dixon
[EMAIL PROTECTED] wrote: Hi I am trying to regex a make output line (g++) and don't get it together. What I want is: All lines where the -c option does not occure, neither before nor after the -o option and then extract the portion after the -o option. $regexApplication = '(?![ \t]-c[

Re: Can't find string terminator EOHTML anywhere before EOF

2008-04-04 Thread Pau Marc Munoz Torres
mmm i did in a single line and i keep havinh the problem my $html = EOHTML;HTMLBODYEnter something:input type=text name=val1 id=val1onkeyup=exported_func( ['val1'], ['resultdiv'] );brdiv id=resultdiv/div/BODY/HTMLEOHTML return $html; 2008/4/4, Rob Dixon [EMAIL PROTECTED]: Pau

Re: Can't find string terminator EOHTML anywhere before EOF

2008-04-04 Thread Rob Dixon
Pau Marc Munoz Torres wrote: mmm i did in a single line and i keep havinh the problem my $html = EOHTML;HTMLBODYEnter something:input type=text name=val1 id=val1onkeyup=exported_func( ['val1'], ['resultdiv'] );brdiv id=resultdiv/div/BODY/HTMLEOHTML return $html; You

Re: algorithm/permute.pm

2008-04-04 Thread Sharan Basappa
Dont seem to have luck. I did make test followed by make install. Here is what I got: make install Installing /u/basappas/local/perl/Algorithm-Permute-0.06/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/Algorithm/Permute/Permute.so Installing

Re: foreach vs for

2008-04-04 Thread Randal L. Schwartz
Rob == Rob Dixon [EMAIL PROTECTED] writes: Rob Although 'foreach' is more useful, I think it's it's far more likely Rob that someone realized that the two could be distinguished by context and Rob needn't have different symbols, so the two were made equivalent. That someone would be one Mr.

PPM Repository

2008-04-04 Thread Jim
Hi all, I am looking to easily install some modules, like for example Win32::Clipboard, but they don't show with teh standard modules on ActiveState's repository. Are there a couple of better ones I can add? Thanks for your time Jim -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Perl and XML

2008-04-04 Thread Seth
On Apr 4, 6:41 am, [EMAIL PROTECTED] (Rob Dixon) wrote: Seth wrote: I have an existing xml file that I need to display. Perl was suggested a good way to do that. I am using XML::Simple. None of the examples use the format that I have. Here is an example of what I am dealing with:

Constant not working in hash...

2008-04-04 Thread pisces . philip
use constant PART_NUMBER= 'P/N'; print PART_NUMBER; The above prints, P/N, as I would expect. Later in the script I want to access a hash value using the constant like this: my $part = $parts{ $key }{ PART_NUMBER }; - this doesn't work, but this does: my $part = $parts{ $key }{

how can I change the encoding of the email subject?

2008-04-04 Thread kun niu
Dear all, I'm trying to send email with perl in my application. The email is encoded with utf8. The content of the email is good. But the subject of the email is wrongly shown. I use MIME::Lite package. So how can I use utf8 encoding in the subject of my email? Thanks for any help. -- To

assign javascript variables to a perl variables using ajax

2008-04-04 Thread Pau Marc Munoz Torres
Hi , I got a cgi in perl, in this cgi i use ajax to ejecute a javascript code, in this code i produce a prompt, and i store the value at the res variable. now i would like to store this variabe, res into a perl variable ($res), something like $res=res How can i do that? thanks

Re: how can I change the encoding of the email subject?

2008-04-04 Thread Jeff Pang
use MIME::Words qw/:all/; for example, $subject = encode_mimeword($subject,'b','gb2312'); On Fri, Apr 4, 2008 at 9:38 PM, kun niu [EMAIL PROTECTED] wrote: Dear all, I'm trying to send email with perl in my application. The email is encoded with utf8. The content of the email is good.

Re: Constant not working in hash...

2008-04-04 Thread Jeff Pang
On Fri, Apr 4, 2008 at 11:42 PM, [EMAIL PROTECTED] wrote: use constant PART_NUMBER= 'P/N'; print PART_NUMBER; The above prints, P/N, as I would expect. Later in the script I want to access a hash value using the constant like this: my $part = $parts{ $key }{ PART_NUMBER };

Re: PPM Repository

2008-04-04 Thread Jeff Pang
I saw many people use CgyWin for unix shell emulator, maybe you can try it. For me I use VMWare on my WinXP to run linux and Perl. On Fri, Apr 4, 2008 at 6:04 PM, Jim [EMAIL PROTECTED] wrote: Hi all, I am looking to easily install some modules, like for example Win32::Clipboard, but they

Re: Perl and XML

2008-04-04 Thread Rob Dixon
Seth wrote: On Apr 4, 6:41 am, [EMAIL PROTECTED] (Rob Dixon) wrote: Seth wrote: I have an existing xml file that I need to display. Perl was suggested a good way to do that. I am using XML::Simple. None of the examples use the format that I have. Here is an example of what I am dealing

Re: Constant not working in hash...

2008-04-04 Thread Rob Dixon
[EMAIL PROTECTED] wrote: use constant PART_NUMBER= 'P/N'; print PART_NUMBER; The above prints, P/N, as I would expect. Later in the script I want to access a hash value using the constant like this: my $part = $parts{ $key }{ PART_NUMBER }; - this doesn't work, but this

Re: PPM Repository

2008-04-04 Thread Chris Charley
- Original Message - From: Jim [EMAIL PROTECTED] Newsgroups: perl.beginners To: beginners@perl.org Sent: Friday, April 04, 2008 6:04 AM Subject: PPM Repository Hi all, I am looking to easily install some modules, like for example Win32::Clipboard, but they don't show with teh

Re: PPM Repository

2008-04-04 Thread Gunnar Hjalmarsson
Jim wrote: I am looking to easily install some modules, like for example Win32::Clipboard, but they don't show with teh standard modules on ActiveState's repository. Are there a couple of better ones I can add? Try: http://ppm.tcool.org/archives/ and install the libwin32 package.

Re: PPM Repository

2008-04-04 Thread Rob Dixon
Jim wrote: Hi all, I am looking to easily install some modules, like for example Win32::Clipboard, but they don't show with teh standard modules on ActiveState's repository. Are there a couple of better ones I can add? http://ppm.tcool.org/ Rob -- To unsubscribe, e-mail: [EMAIL

Re: foreach vs for

2008-04-04 Thread Rob Dixon
yitzle wrote: Huffman encoding is basically the idea that the more often a symbol is used, the shorter it should be. Huffman Coding turns data into a binary sequence. It is an algorithm for data compression, not simply a notion, and isn't relevant outside that field (except perhaps philosphy).

Re: foreach vs for

2008-04-04 Thread Rob Dixon
Chas. Owens wrote: On Thu, Apr 3, 2008 at 8:37 PM, Rob Dixon [EMAIL PROTECTED] wrote: snip * Note, this is not real Huffman encoding, just Larry Wall's version of it. Huffman encoding is a compression algorithm, used in GIF files if I remember correctly. It's not relevant to

Re: foreach vs for

2008-04-04 Thread Chas. Owens
On Fri, Apr 4, 2008 at 7:20 PM, Rob Dixon [EMAIL PROTECTED] wrote: Chas. Owens wrote: On Thu, Apr 3, 2008 at 8:37 PM, Rob Dixon [EMAIL PROTECTED] wrote: snip * Note, this is not real Huffman encoding, just Larry Wall's version of it. snip from

Re: Constant not working in hash...

2008-04-04 Thread Rob Dixon
ken Foskey wrote: On Sat, 2008-04-05 at 00:37 +0800, Jeff Pang wrote: On Fri, Apr 4, 2008 at 11:42 PM, [EMAIL PROTECTED] wrote: use constant PART_NUMBER= 'P/N'; print PART_NUMBER; The above prints, P/N, as I would expect. Later in the script I want to access a hash value