comp.lang.perl.misc
  Home FAQ Contact Sign in
comp.lang.perl.misc only
 
Advanced search
July 2006
motuwethfrsasuw
     12 26
3456789 27
10111213141516 28
17181920212223 29
24252627282930 30
31       31
2006
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.perl.misc Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  how match/expose the value in an empty variable having length of 1         


Author: Jack
Date: Jul 14, 2006 23:49

Hi folks,

Ok I am stumped... I am reading a fileline in as follows:

12535957@140@2006-07-08 09:34:45.000@@@2005-11-24@

and splitting on the "@"...
open(SOURCE1,$filename1)
@columnarray = split(/\@/, $_);

Whats really wierd is $columnarray[4] has a length of 1, when clearly
above its NULL !!
I want to be able to recognize this as null, but you cant even match
regex it... I tried

if ($columnarray[4] =~ m/.*?[[:print:]]/) { print " NON PRINTABLE
"."\n"; }
$columnarray[4] =~ s/^\s+//;
$columnarray[4] =~ s/\s+$//;
$length = length @columnarray[4]."\n";
and a number of other things that dont work.. how do I identify "WHAT"
is making up the length =1 ?

Also, what is the detection match test for NULL ?
Show full article (0.75Kb)
3 Comments
  Re: Interfacing with Matlab using Win32::OLE         


Author: Ben Morrow
Date: Jul 14, 2006 23:25

Quoth "A. Sinan Unur" <1usa@llenroc.ude.invalid>:
> Ben Morrow tiscali.co.uk> wrote in
> news:s60mo3-o4q.ln1@osiris.mauzo.dyndns.org:
>
>>
>> Quoth "scottmf" gmail.com>:
>>>> I'm fairly sure you still need the Win32::OLE->new line. If matlab
>>>> is running it should give you a handle on the current instance.
>>>> [Caveat: my understanding of OLE is sketchy at best :)]
>>>>
>>>> The Perl program is in no sense 'inside' matlab. It is a completely
>>>> separate process: it doesn't even know you invoked it from matlab,
>>>> so how would you get an OLE object?
>>>
>>> when I use the Win32::OLE->new line it launches a new instance of
>>> matlab rather than linking to the current instance. I think this is
>>> the basic problem; that I need some way to link the perl script to
>>> the current matlab instance.
>>
>> OK, you are reading the Win32::OLE docs, yes? About 30 seconds worth ...
Show full article (3.65Kb)
no comments
  Re: foreach capture regex with /g         


Author:
Date: Jul 14, 2006 23:04

On Fri, 14 Jul 2006 20:05:33 GMT, A. Sinan Unur <1usa@llenroc.ude.invalid> wrote:
> andreas a@t mrs d.t ch wrote in
> news:44b7f766$0$12613$5402220f@news.sunrise.ch:
>
>> perl -e 'foreach ("abc" =~ m/(.)/gc) {print "$1"}'
>>
>> prints 'ccc' and not what I (and maybe other stupid users) would
>> expect 'abc'.
>
> "abc" =~ m/(.)/gc
>
> in list context returns all the matches. However, you are not printing
> elements of that list, only $1.


> On the other hand, a while loop is better here: It allows you iterate
> through matches without a list of all matches being constructed. That
> can become a significant overhead if the number of matches is large
> (just like the difference between

Ok, I guess I stay with the while, it's more the way I think.
Show full article (0.95Kb)
no comments
  Re: foreach capture regex with /g         


Author:
Date: Jul 14, 2006 22:58

On Fri, 14 Jul 2006 23:01:22 +0200, Dr.Ruud wrote:
> andreas a@t mrs d.t ch schreef:
>
>> perl -e 'foreach ("abc" =~ m/(.)/gc) {print "$1"}'
>>
>> prints 'ccc'
>
> Yes. What puzzles me is the c-modifier, why did you use it?
>

Puzzles me to, it somehow sneaked in during my shell examples. The
original regex doesn't use it.

Andreas
no comments
  Re: foreach capture regex with /g         


Author:
Date: Jul 14, 2006 22:56

On 14 Jul 2006 13:09:07 -0700, Paul Lalli gmail.com> wrote:
> andreas a@t mrs d.t ch wrote:
>> The problem:
>>
>> perl -e 'foreach ("abc" =~ m/(.)/gc) {print "$1"}'
>>
>> prints 'ccc' and not what I (and maybe other stupid users) would expect
>> 'abc'.
>
> You have several Perl features conspiring against you.

Well... looks like the big conspiration, lets start a theory on that :-)
> 1) the condition to a foreach() loop is evaluated in list context



Took me several minutes to understand this, but I guess I do it now.
The regexp is evaluated correctly, all the matches are stored in a list
and the list is evaluated with foreach, but as the evaluation of the
regexp is done, all the matches are through, $1 is set to the last match
and printed three times for each list element.
Show full article (1.63Kb)
no comments
  Re: Interfacing with Matlab using Win32::OLE         


Author: A. Sinan Unur
Date: Jul 14, 2006 22:00

Ben Morrow tiscali.co.uk> wrote in
news:s60mo3-o4q.ln1@osiris.mauzo.dyndns.org:
>
> Quoth "scottmf" gmail.com>:
>>> I'm fairly sure you still need the Win32::OLE->new line. If matlab
>>> is running it should give you a handle on the current instance.
>>> [Caveat...
Show full article (2.89Kb)
no comments
  Re: finding perl info on google can be hard         


Author: Tad McClellan
Date: Jul 14, 2006 20:53

John Bokma castleamber.com> wrote:
> Tad McClellan augustmail.com> wrote:
>
>> [snip rancid TOFU]
>
> Never liked tofu much. Rancid tofu, there goes my appetite :-(

I think I listened to too much Zappa when I was younger.

--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
no comments
  OSCON 2006 Lightning talks deadline extended         


Author: Mark Jason Dominus
Date: Jul 14, 2006 20:32

There is still time to propose a lightning talk for OSCON 2006. The
deadline has been extended through Monday, 25 July.

Lightning Talks at the 2006 O'Reilly Open Source Convention

Lightning talks are brief (5-minute) talks that focus on a single
example, idea, project, or technique. Lightning talks do not attempt
to cover all aspects of their subject matter, but rather to present
one facet of the idea clearly and succinctly.

To submit a proposal for a lightning talk, please send your proposed
title and an abstract of up to four sentences to:

osc-lt-2006-submit@plover.com

For more complete information, visit:

http://perl.plover.com/lt/osc2006/

Thanks.
no comments
  Re: Perl and Politics         


Author: Kevin Michael Vail
Date: Jul 14, 2006 20:23

In article ,
"J
no comments
  Re: Perl and Politics         


Author: Tad McClellan
Date: Jul 14, 2006 19:52

ilikesluts@gmail.com gmail.com> wrote:
> I think you are right about this board.

This is not a "board". This is a Usenet newsgroup.
> I don't think I'm going to
> make it a regular stop on my information super highway.

The loss to this community will be great, but thank you for doing
what you can to make this a better place.

--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
no comments
1 2 3 4 5 6