Re: grabbing leading spaces from line

2002-01-05 Thread Jeff 'japhy' Pinyan
On Jan 5, Prahlad Vaidyanathan said: >> >my $leading_spaces = ($text =~ m/^(\s+)/) ; # This doesn't work >> >print $leading_spaces ; # Prints 1 >> >> You have executed the regex in scalar context. Why? Because the > >Does this mean the return value of the match is put into

Re: grabbing leading spaces from line

2002-01-05 Thread Prahlad Vaidyanathan
Hi, On Fri, 04 Jan 2002 Jeff 'japhy' Pinyan spewed into the ether: > On Jan 4, Prahlad Vaidyanathan said: > > >I tried this : > > > >my $text = " this is a test" ; > > > ># Test 1 > >my $leading_spaces = ($text =~ m/^(\s+)/) ; # This doesn't work > >print $leading_spaces ;

Re: grabbing leading spaces from line

2002-01-04 Thread Jeff 'japhy' Pinyan
On Jan 4, Prahlad Vaidyanathan said: >I tried this : > >my $text = " this is a test" ; > ># Test 1 >my $leading_spaces = ($text =~ m/^(\s+)/) ; # This doesn't work >print $leading_spaces ; # Prints 1 You have executed the regex in scalar context. Why? Because the left

Re: grabbing leading spaces from line

2002-01-04 Thread Prahlad Vaidyanathan
Hi, Oh nevermind .. I found Text::Tabs :-) pv. -- Prahlad Vaidyanathan <[EMAIL PROTECTED]> Got Mole problems? Call Avogadro at 6.02 x 10^23. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]