[Tinyos-help] Note about motelist and perl

Matt Miller mjmille2 at crhc.uiuc.edu
Fri Sep 23 07:51:18 PDT 2005


Cory,

I got revision 1.5 of motelist-linux out of the CVS repository and
tested it with Perl 5.8.0 and it seems to work fine now.

Thanks,

Matt

On 9/22/05, Cory Sharp <cory at moteiv.com> wrote:
> Hi Matt,
>
>  I've committed a change to motelist-linux, now at Revision 1.4, that
> hopefully addresses the problem.  I haven't tested it on any older versions
> of Perl, but I've rewritten the parse_usb_devices_text function to do less
> Perl-fancy things while achieving the same goal of chewing a paragraph from
> /proc/bus/usb/devices into a hash/dictionary.
>
>  The problem stems from the format of /proc/bus/usb/devices.  I'd swear that
> whoever spec'ed out that format aggressively intended to win blue ribbon in
> the ugly contest at the state fair.  The file is a headache to parse both
> visually and mechanically, and so the code and/or regular expression to
> parse it tend to be a little messed up just to get along.
>
>  If you could possibly check it out from CVS and test it again with your
> older version of Perl and let me know if it works out, I'd appreciate it.
>
>  Thanks, best,
>  Cory Sharp <cory at moteiv.com>
>
>
> On 9/21/05, Matt Miller <mjmille2 at crhc.uiuc.edu> wrote:
> >
> > This is something I discovered trying to run the
> > tools/src/motelist/motelist-linux script with a Telos
> Mote attached to
> > my USB port.  The regular expression:
> >
> > ($text =~ m/([^\s=]+)=\s*(.*?\S)\s*(?=[^\s=]+=|$)/mg)
> >
> > in the parse_usb_devices_text function does not work correctly with
> > older versions of Perl (e.g., I was using RedHat 9 which has v.
> > 5.8.0).  It will return null rather than 1, so the script fails.  I
> > grabbed a RPM from this site:
> >
> > http://www.activestate.com/Products/ActivePerl/
> >
> > that gave me Perl v. 5.8.7 and the script works fine.
> >
> > The documentation maintainers might want to make note of this for
> > others attempting to use the script and/or change the regular
> > expression to be backwards compatible with older versions of Perl.
> >
> > -Matt
> >
> > _______________________________________________
> > Tinyos-help mailing list
> > Tinyos-help at Millennium.Berkeley.EDU
> >
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> >
>
>



More information about the Tinyos-help mailing list