Re: Opening .dat file in perl

2006-10-30 Thread Dr.Ruud
Goksie schreef: > #!perl > use warnings ; > use strict ; > my $fl = "c:/Perl/CDR_MSC_DAT/00016363.DAT"; That is probably not a line-oriented file. I would change that line to the more robust: my $fl = q{c:/Perl/CDR_MSC_DAT/00016363.DAT} ; because filenames can contain sigils etc. > { loca

Re: split and grouping in regexp

2006-10-30 Thread Dr.Ruud
Daniel Kasak schreef: > I'm trying to split a date where the values can be separated by a dash > '-' or a slash '/', eg: > 2006-10-31 or 2006/10/31 > > I'm using: > my ( $, $mm, $dd ) = split /(-|\/)/, $mmdd; > but it doesn't work. It does work, but not as you expected. Read `perldoc -f s

Re: [SPAM DETECT] split and grouping in regexp

2006-10-30 Thread Arnaldo Guzman
On Mon, 2006-10-30 at 02:34 +0100, xavier mas wrote: > A Dimarts 31 Octubre 2006 02:22, Daniel Kasak va escriure: > > my ( $, $mm, $dd ) = split /(-|\/)/, $mmdd; > > split function can't accept an expression on its syntax, only a character as > separator field. > -- > Xavier Mas To Xavi

Re: split and grouping in regexp

2006-10-30 Thread Arnaldo Guzman
On Tue, 2006-10-31 at 12:22 +1100, Daniel Kasak wrote: > I'm trying to split a date where the values can be separated by a dash > '-' or a slash '/', eg: > 2006-10-31 or 2006/10/31 > > I'm using: > my ( $, $mm, $dd ) = split /(-|\/)/, $mmdd; > but it doesn't work. > > If I just do: > my

Re: split and grouping in regexp

2006-10-30 Thread John W. Krahn
Daniel Kasak wrote: > I'm trying to split a date where the values can be separated by a dash > '-' or a slash '/', eg: > 2006-10-31 or 2006/10/31 > > I'm using: > my ( $, $mm, $dd ) = split /(-|\/)/, $mmdd; > but it doesn't work. Yes it does work, it's just that the capturing parentheses

RE: split and grouping in regexp

2006-10-30 Thread bou, hou \(GE Money, consultant\)
>my ( $, $mm, $dd ) = split /(-|\/)/, $mmdd; my ( $, $mm, $dd ) = split /-|\//, $mmdd; with this it works. -Original Message- From: Daniel Kasak [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 31, 2006 10:22 AM To: beginners@perl.org Subject: split and grouping in regexp

Re: split and grouping in regexp

2006-10-30 Thread Jeff Pang
> >I'm using: >my ( $, $mm, $dd ) = split /(-|\/)/, $mmdd; >but it doesn't work. > Hello, try split /\W/,$string pls. $ perl -le '$str="2006/10/31";my ( $, $mm, $dd ) = split /\W/, $str;print join " ",$, $mm, $dd' 2006 10 31 $ perl -le '$str="2006-10-31";my ( $, $mm, $dd

Re: [SPAM DETECT] split and grouping in regexp

2006-10-30 Thread xavier mas
A Dimarts 31 Octubre 2006 02:22, Daniel Kasak va escriure: > my ( $, $mm, $dd ) = split /(-|\/)/, $mmdd; split function can't accept an expression on its syntax, only a character as separator field. -- Xavier Mas -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-m

split and grouping in regexp

2006-10-30 Thread Daniel Kasak
I'm trying to split a date where the values can be separated by a dash '-' or a slash '/', eg: 2006-10-31 or 2006/10/31 I'm using: my ( $, $mm, $dd ) = split /(-|\/)/, $mmdd; but it doesn't work. If I just do: my ( $, $mm, $dd ) = split /-/, $mmdd; it works for dates separated b

Re: what's wrong with this code?

2006-10-30 Thread Tom Phoenix
On 10/30/06, Octavian Rasnita <[EMAIL PROTECTED]> wrote: I am trying to read a UTF-8 coded file, decode its html character entities, and print it into another UTF-8 coded file. The program works fine if I write the line: $t++; last if $t > 200; What is the largest value you can use, instead

Re: Opening .dat file in perl

2006-10-30 Thread Goksie
John W. Krahn wrote: > Goksie wrote: > >> Tommy Nordgren wrote: >> >>> On 20 okt 2006, at 21.31, Goke Aruna wrote: >>> >>> On 10/20/06, John W. Krahn <[EMAIL PROTECTED]> wrote: > Goksie wrote: > >> Can someone advice me on how i can open .dat

what's wrong with this code?

2006-10-30 Thread Octavian Rasnita
Hi, I am trying to read a UTF-8 coded file, decode its html character entities, and print it into another UTF-8 coded file. The program works fine if I write the line: $t++; last if $t > 200; If I comment that line (for parsing the entire file, and not only the first 200 lines), the program finis

Re: Dynamical our/my/local

2006-10-30 Thread Oleg V. Volkov
"Oleg V. Volkov" <[EMAIL PROTECTED]> wrote: [skip] > Speaking of globals, AFAIK, I have virtually no drawbacks > against "my", as long as I use "our" variables inside > the scope. So what's bad there in using "our"? After some thinking I've found a scenario where Alias::attr use of globals can giv

Re: Ok, this time Net::SSH2 question :-) (pls ignore )

2006-10-30 Thread Michael Alipio
- Original Message From: Michael Alipio <[EMAIL PROTECTED]> To: Michael Alipio <[EMAIL PROTECTED]>; beginners perl Sent: Monday, October 30, 2006 1:25:36 PM Subject: Re: Ok, this time Net::SSH2 question :-) Hi, Do you know if I still need to do something to enable Net::SSH::Perl to us