date format search insdie the files

2008-11-29 Thread Sureshkumar M (HCL Financial Services)
Hi All, I try to search the string which has the date format inside the file, But i am not able to get the desired files. Pls help me on this.. C)/tmp/sms/perl$ cat a1 115-06-1979 10-11-81 20-NOV-2008 05-07-1981 welcome 15-10-2008 12-03-20009 (C)/tmp/sms/per

Re: date format search insdie the files

2008-11-29 Thread David Schmidt
You missed some parentheses #!/usr/bin/perl use strict; use warnings; open(DATA, '<', "data") || die"Unable to open the file"; while() { #if($_=~/\d{2}-(\d{2}|\w{3})-\d{1,4}/) { if(/(\d{2}-(\d{2})|(\w{3})-\d{1,4})/) { print; } } close(DATA); exit 0; On S

RE: date format search insdie the files

2008-11-29 Thread Sureshkumar M (HCL Financial Services)
Hi David, Thanks for the reply, but still I am not able to get expected output from this. Pls help me how to get this. (C)/tmp/d$ cat a1 115-06-1979 10-11-81 20-NOV-2008 05-07-1981 welcome 20-03-20009 15-10-2008 (C)/tmp/d$ cat 1 #/usr/bin/perl use strict; use

Web File Download

2008-11-29 Thread Ирина Пуляхина
Hi all, I work with ssm-server - server for bioinformatic purposes (http://www.ebi.ac.uk/msd-srv/ssm/). For each request it gives information of several html-pages. Also there is a possibility save file in preferable format: to click on "save"-button, click Yes on "Do you want to save"-window. Wh

RE: date format search insdie the files

2008-11-29 Thread Sureshkumar M (HCL Financial Services)
Hi all , Can someone help me on this From: Sureshkumar M (HCL Financial Services) Sent: Saturday, November 29, 2008 4:21 PM To: 'David Schmidt' Cc: beginners@perl.org Subject: RE: date format search insdie the files Hi David, Thanks for t

Mailing list

2008-11-29 Thread Sureshkumar M (HCL Financial Services)
Hi All, Can someone send the maid's for Perl forum where I can clear all my doubts? I would like to discuss lot of doubts and get answer and get quick answers. Regards, Suresh

Re: date format search insdie the files

2008-11-29 Thread Dr.Ruud
"Sureshkumar M (HCL Financial Services)" schreef: > #/usr/bin/perl > open(DATA,"a1")||die"Unable to open the file"; > while() > { > if($_=~/\d{2}-(\d{2}|\w{3})-\d{1,4}/) > { > print $_; > } > } > close(DATA); > exit 0; #!/usr/bin/perl use strict; use warnings; my $in_name = "data.in";

RE: date format search insdie the files

2008-11-29 Thread Sureshkumar M (HCL Financial Services)
Thanks a lot for your help,, Can you explain me this part how it's works? (?:\d{2}|\w{3}) ?: what this will do? And also, the output is like below (C)/tmp/d$ perl 1 10-11-81 20-NOV-2008 05-07-1981 15-110-2008 this should not come as this as 3 digit month. (C)/tmp/d$ Program: (

Re: date format search insdie the files

2008-11-29 Thread Dr.Ruud
"Sureshkumar M (HCL Financial Services)" schreef: > Can you explain me this part how it's works? > > (?:\d{2}|\w{3}) > > ?: what this will do? Read perlre (and find out what (?:) means). > And also, the output is like below > > > (C)/tmp/d$ perl 1 > 10-11-81 > 20-NOV-2008 > 05-07-1981 >

Re: date format search insdie the files

2008-11-29 Thread Dr.Ruud
"Sureshkumar M (HCL Financial Services)" schreef: > Can someone help me on this Impossible. -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Not getting all the element.

2008-11-29 Thread slow_leaner
Hello all, what am i missing!!! #!/usr/bin/perl -w @array_number =; @new_array = half( @array_number ); print "@new_array\n"; sub half { @numbers = @_; while (<@numbers>){ @n = $_ / 2; @new_a = pop(@n); } return @new_a; } #I am calling a sub function "half". #but it r

Re: Not getting all the element.

2008-11-29 Thread Mr. Shawn H. Corey
On Fri, 2008-11-28 at 11:56 -0800, slow_leaner wrote: > Hello all, what am i missing!!! > #!/usr/bin/perl -w > @array_number =; > @new_array = half( @array_number ); > print "@new_array\n"; > > sub half { > @numbers = @_; > while (<@numbers>){ > @n = $_ / 2; > @new_a = pop(@n)

Re:Mailing list

2008-11-29 Thread Jeff Pang
> Message du 29/11/08 12:55 > De : "Sureshkumar M (HCL Financial Services)" > A : beginners@perl.org, [EMAIL PROTECTED] > Copie à : > Objet : Mailing list > > Hi All, > > > > Can someone send the maid's for Perl forum where I can clear > all my doubts? I would like to discuss lot of dou

Return available address book fields

2008-11-29 Thread John J. Foster
Hi again, Is it possible to modify the following script to return a list of available fields? I'm trying to query my address at fastmail.fm and would like to display as much info as possible. Thanks in advance, festus -- I just want to break even. -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: Return available address book fields

2008-11-29 Thread John J. Foster
OK - let's try the script this time! http://bsdconsulting.no/tools/mutt-ldap.pl On Sat, Nov 29, 2008 at 09:32:32AM -0700, John J. Foster wrote: > Hi again, > > Is it possible to modify the following script to return a list of > available fields? I'm trying to query my address at fastmail.fm and

Re: Return available address book fields

2008-11-29 Thread Chas. Owens
On Sat, Nov 29, 2008 at 11:32, John J. Foster <[EMAIL PROTECTED]> wrote: > Hi again, > > Is it possible to modify the following script to return a list of > available fields? I'm trying to query my address at fastmail.fm and > would like to display as much info as possible. snip Replace i

Re: Not getting all the element.

2008-11-29 Thread John W. Krahn
slow_leaner wrote: Hello all, Hello, what am i missing!!! #!/usr/bin/perl -w @array_number =; @new_array = half( @array_number ); print "@new_array\n"; sub half { @numbers = @_; while (<@numbers>){ That is short for: while ( defined( $_ = glob join $", @numbers ) ) {

How to match HTML tag with RegExp

2008-11-29 Thread Canol Gökel
Hi, My problem is to match HTML tags with RegExp. I managed to match something like this, properly: la la la a paragraph bla bla bla another paragraph ya ya ya But when nested, there arises problems: a paragraph bla bla bla la la la It matches A paragraph bla bla bla instead of matching the

Re: How to match HTML tag with RegExp

2008-11-29 Thread Chas. Owens
On Sat, Nov 29, 2008 at 20:02, Canol Gökel <[EMAIL PROTECTED]> wrote: > Hi, > > My problem is to match HTML tags with RegExp. snip Can't be done*. You need a parser. snip > Note: Most probably there is a module for this but: > - I want to learn the logic, snip Learn to write a parser instead.

Re: How to match HTML tag with RegExp

2008-11-29 Thread Canol Gökel
Chas. Owens gmail.com> writes: > > On Sat, Nov 29, 2008 at 20:02, Canol Gökel canol.info> wrote: > Can't be done*. You need a parser. snip It can be done. snip > Learn to write a parser instead. This is like asking how to build a > bridge for people out of toothpicks. It can be done (bu

Re: How to match HTML tag with RegExp

2008-11-29 Thread Chas. Owens
On Sat, Nov 29, 2008 at 20:50, Canol Gökel <[EMAIL PROTECTED]> wrote: > Chas. Owens gmail.com> writes: > >> >> On Sat, Nov 29, 2008 at 20:02, Canol Gökel canol.info> wrote: > >> Can't be done*. You need a parser. > > snip > > It can be done. snip Note that asterisk. snip >> Learn to write a pa

system -> $variable

2008-11-29 Thread David
I am trying to get 081129 into $dayStamp. #!/usr/bin/perl -w use strict; my $dayStamp; $dayStamp = `date +\'%y%m%d\'` && die "Failure!"; print "$dayStamp\n"; My program outputs: Failure! at /Users/dave/perl/dateLogger01.pl line 4. I thought I did every conceivable combination of backticks and

Re: system -> $variable

2008-11-29 Thread Chas. Owens
On Sat, Nov 29, 2008 at 21:25, David <[EMAIL PROTECTED]> wrote: > I am trying to get 081129 into $dayStamp. > > #!/usr/bin/perl -w > use strict; > my $dayStamp; > $dayStamp = `date +\'%y%m%d\'` && die "Failure!"; > print "$dayStamp\n"; > > > My program outputs: > Failure! at /Users/dave/perl/dateLo

Re: system -> $variable

2008-11-29 Thread John W. Krahn
David wrote: I am trying to get 081129 into $dayStamp. #!/usr/bin/perl -w use strict; my $dayStamp; $dayStamp = `date +\'%y%m%d\'` && die "Failure!"; You have three problems with that statement: 1) The '=' operator has higher precedence than the '&&' operator so you need to either enclose

capturing output from c program inside of perl

2008-11-29 Thread Richard
i have a c program that I want to just run from perl and capture output I would have thought my $c_output = `/tmp/c_program`; would get me the output of the program. instead it prints out to the screen. Is there way to redirect STOUT just for that line and put it back to normal? -- To unsubs

Re: capturing output from c program inside of perl

2008-11-29 Thread Chas. Owens
On Sun, Nov 30, 2008 at 00:52, Richard <[EMAIL PROTECTED]> wrote: > i have a c program that I want to just run from perl and capture output > > I would have thought > > my $c_output = `/tmp/c_program`; > > would get me the output of the program. > > instead it prints out to the screen. > > Is there

Re:capturing output from c program inside of perl

2008-11-29 Thread Jeff Pang
> Message du 30/11/08 06:52 > De : "Richard" > A : beginners@perl.org > Copie à : > Objet : capturing output from c program inside of perl > > > i have a c program that I want to just run from perl and capture output > > I would have thought > > my $c_output = `/tmp/c_program`; > I was not sure w

Re: capturing output from c program inside of perl

2008-11-29 Thread Richard
Chas. Owens wrote: On Sun, Nov 30, 2008 at 00:52, Richard <[EMAIL PROTECTED]> wrote: i have a c program that I want to just run from perl and capture output I would have thought my $c_output = `/tmp/c_program`; would get me the output of the program. instead it prints out to the screen.