get a (array)list of icons from registry
Hi all, Is there any way of getting all icons of installed programs from the registry? If so, how do i display them in a tk app? is there support for *.ico in tk? Thanks in advance for any help. -Jeremy A. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
on reading sms messages from mobile phone Hi all! I have siemens c55 mobile connected to my pc I also have programm "phone data suite" which allows for reading incoming sms messages from mobile. aforementioned programm from my point of view is "thing in itself" : it is menu driven and have no description of format of .sm files in which are stored sms messages. My question - is there a way of reading sms in perl ? may be for other types of mobiles ? and lastly - may be there are programs for reading sms on Linux ?
on reading sms messages from mobile phone Hi all! I have siemens c55 mobile connected to my pc I also have programm "phone data suite" which allows for reading incoming sms messages from mobile. aforementioned programm from my point of view is "thing in itself" : it is menu driven and have no description of format of .sm files in which are stored sms messages. My question - is there a way of reading sms in perl ? may be for other types of mobiles ? and lastly - may be there are programs for reading sms on Linux ? ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: regexp question
Christopher Hahn wrote: > $Bill, > > The (?: ) construct may be non-capturing, but it does eat text from the > buffer (sic) > > ...and, besides, when I ran it I saw this: > = > 1: asd asdf adf asd \n asd adf > 2: asd asdf adf asd \n asd adf > 3: asd asdf adf asd asd adf > = > > where I need to see something like this: > = > 1: asd asdf adf asd > 2: asd asdf adf asd \n asd adf > 3: asd asdf adf asd asd adf > 4: asd asdf adf asd asd adf " ad dasf \n dsaf > = > > i.e. \n should pass through, where \\n or \" should not. Does a non-greedy match help (also - I was missing an escape or two on the \\n): foreach ( '1: asd asdf adf asd n asd adf \" ad dasf dsaf ', '2: asd asdf adf asd \n asd adf \" ad dasf dsaf ', '3: asd asdf adf asd asd adf \" ad dasf n dsaf ', '4: asd asdf adf asd asd adf " ad dasf \n dsaf ', ) { if (/^(.*?)(?:n|\\")/) { print "$1\n"; } } > > What about trying something like: > > $strval =~ m/^(( [^\\] | \\ (?! \\ (?= n)) | \\ (?! \") )*)/x; > > which (or so I think ;0) collects as many characters from the beginning of > $str that > meet these conditions (bs = backslash): > = >1) not a bs > or 2) a bs that is *not* followed by a ( bs that *is* followed by a n ) > or 3) a bs that is *not* followed by a " > = -- ,-/- __ _ _ $Bill LuebkertMailto:[EMAIL PROTECTED] (_/ / )// // DBE CollectiblesMailto:[EMAIL PROTECTED] / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ -/-' /___/_<_http://dbecoll.tripod.com/ (My Perl/Lakers stuff) ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: regexp question
$Bill, The (?: ) construct may be non-capturing, but it does eat text from the buffer (sic) ...and, besides, when I ran it I saw this: = 1: asd asdf adf asd \n asd adf 2: asd asdf adf asd \n asd adf 3: asd asdf adf asd asd adf = where I need to see something like this: = 1: asd asdf adf asd 2: asd asdf adf asd \n asd adf 3: asd asdf adf asd asd adf 4: asd asdf adf asd asd adf " ad dasf \n dsaf = i.e. \n should pass through, where \\n or \" should not. What about trying something like: $strval =~ m/^(( [^\\] | \\ (?! \\ (?= n)) | \\ (?! \") )*)/x; which (or so I think ;0) collects as many characters from the beginning of $str that meet these conditions (bs = backslash): = 1) not a bs or 2) a bs that is *not* followed by a ( bs that *is* followed by a n ) or 3) a bs that is *not* followed by a " = Am I making any sense? ;0) Thank you for taking the time in any case! Christopher -Original Message- From: $Bill Luebkert [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 14, 2004 1:41 PM To: Christopher Hahn Cc: [EMAIL PROTECTED] Subject: Re: regexp question Christopher Hahn wrote: > Hey, > > I seem to be missing a piece of the puzzleI want to define a > character class ([]) with atoms to (not) match involve negative > look-ahead assertions.but no joy. > > I am reading a stream of text that may contain the two segments \\n and \" > > I want to define a regexp that will match up to the first of either of > these. > > ...ie. something like ([^]*) where the character class is just the two > sequences above. > > ...but they are not characters at all, but strings, and so I wonder > how to approach this. > > Question: how best to do something to set > >$1 == every character in the string up to and not including the > first of either a \\n or a \" > > That is all. (something like $strval =~ m/ (.* (?! \\ (?= \" | \\ (?= > n) ) ) > )/x;) > > I am going to use this regexp in a Parse::RecDescent Production, and > have other Rules to deal with the \\n and \" strings. > > I am banging on this and will report when something good comes out of > it, but please do chime in with any "best practices" that suggest > themselves to you. I assume that \\n is actually 3 characters and not a newline. It should be as simple as : use strict; foreach ( '1: asd asdf adf asd \\n asd adf \" ad dasf dsaf ', '2: asd asdf adf asd \n asd adf \" ad dasf dsaf ', '3: asd asdf adf asd asd adf \" ad dasf \\n dsaf ', '4: asd asdf adf asd asd adf " ad dasf \n dsaf ', ) { if (/^(.*)(?:n|\\")/) { print "$1\n"; } } __END__ -- ,-/- __ _ _ $Bill LuebkertMailto:[EMAIL PROTECTED] (_/ / )// // DBE CollectiblesMailto:[EMAIL PROTECTED] / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ -/-' /___/_<_http://dbecoll.tripod.com/ (My Perl/Lakers stuff) ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: regexp question
Christopher Hahn wrote: > Hey, > > I seem to be missing a piece of the puzzleI want to define a character > class ([]) > with atoms to (not) match involve negative look-ahead assertions.but no > joy. > > I am reading a stream of text that may contain the two segments \\n and \" > > I want to define a regexp that will match up to the first of either of > these. > > ...ie. something like ([^]*) where the character class is just the two > sequences above. > > ...but they are not characters at all, but strings, and so I wonder how to > approach this. > > Question: how best to do something to set > >$1 == every character in the string up to and not including the first of > either a \\n or a \" > > That is all. (something like $strval =~ m/ (.* (?! \\ (?= \" | \\ (?= n) ) ) > )/x;) > > I am going to use this regexp in a Parse::RecDescent Production, and have > other Rules to > deal with the \\n and \" strings. > > I am banging on this and will report when something good comes out of it, > but please do > chime in with any "best practices" that suggest themselves to you. I assume that \\n is actually 3 characters and not a newline. It should be as simple as : use strict; foreach ( '1: asd asdf adf asd \\n asd adf \" ad dasf dsaf ', '2: asd asdf adf asd \n asd adf \" ad dasf dsaf ', '3: asd asdf adf asd asd adf \" ad dasf \\n dsaf ', '4: asd asdf adf asd asd adf " ad dasf \n dsaf ', ) { if (/^(.*)(?:n|\\")/) { print "$1\n"; } } __END__ -- ,-/- __ _ _ $Bill LuebkertMailto:[EMAIL PROTECTED] (_/ / )// // DBE CollectiblesMailto:[EMAIL PROTECTED] / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ -/-' /___/_<_http://dbecoll.tripod.com/ (My Perl/Lakers stuff) ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
regexp question
Hey, I seem to be missing a piece of the puzzleI want to define a character class ([]) with atoms to (not) match involve negative look-ahead assertions.but no joy. I am reading a stream of text that may contain the two segments \\n and \" I want to define a regexp that will match up to the first of either of these. ...ie. something like ([^]*) where the character class is just the two sequences above. ...but they are not characters at all, but strings, and so I wonder how to approach this. Question: how best to do something to set $1 == every character in the string up to and not including the first of either a \\n or a \" That is all. (something like $strval =~ m/ (.* (?! \\ (?= \" | \\ (?= n) ) ) )/x;) I am going to use this regexp in a Parse::RecDescent Production, and have other Rules to deal with the \\n and \" strings. I am banging on this and will report when something good comes out of it, but please do chime in with any "best practices" that suggest themselves to you. TIA! Christopher -- Realisant mon espoir, je me lance vers la gloire Christopher Kenneth Hahn -- [EMAIL PROTECTED] ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: RegEx help
[EMAIL PROTECTED] <> wrote: : I wrote a RegEx to let me know if a line of text has exactly : 36 commas in it (the comma is the separator) and I came up : with this. I don't think it is quite right. I could use a : little pointing in the right direction. Any thoughts? You could use tr/// to count the commas. It sounds like you need a test for valid records. This sub counts the commas and returns a comparison of the count with 36. foreach my $record_length ( 35 .. 37 ) { my $foo = ' ,' x $record_length; if ( is_valid_record( $foo ) ) { print " valid record: $foo\n" ; } else { print "invalid record: $foo\n" ; } } sub is_valid_record { return $_[0] =~ tr/,// == 36; } __END__ HTH, Charles K. Clarkson -- Mobile Homes Specialist 254 968-8328 ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: dll written in c++
> And also which module do you propose for using dlls in perl? Look into Win32::API Thank you. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: RegEx help
Any thoughts? > > > > > >$lines[0] =~/^(.*?,){36}.*?$/ > > > $lines[0] =~ /^[^,](?:*,[^,]*){36}$/ I like Joe's answer, but if you must use a regex this one works: print scalar(my @commas = $lines[0] =~ /(,)/g); - Mark. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: RegEx help
There's a fun little idiom using tr/// to count the number of occurances of a character in a string: perl -le '$str = "a,b,c,d,e"; $count = ($str =~ tr/,/,/); print "$count"' will output "4", the number of commas in "a,b,c,d,e". --Kester > Jeff Williams wrote, on Tue 12/14/2004 11:23 > : I wrote a RegEx to let me know if a line of text has exactly 36 commas in > it (the comma is the separator) and I came up with this. I don't think it > is quite right. I could use a little pointing in the right direction. Any > thoughts? > > > : $lines[0] =~/^(.*?,){36}.*?$/ ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: RegEx help
at 09:23 AM 12/14/2004, Jeff Williams wrote: I wrote a RegEx to let me know if a line of text has exactly 36 commas in it (the comma is the separator) and I came up with this. I don't think it is quite right. I could use a little pointing in the right direction. Any thoughts? $lines[0] =~/^(.*?,){36}.*?$/ $lines[0] =~ /^[^,](?:*,[^,]*){36}$/ ^ beginning of line [^,]* grab any stuff before the first comma (?: group but don't capture , one comma [^,]* followed by zero or more of anything not a comma ){36} 36 of these groups $ end of line Thanks, Jeff. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: RegEx help
Title: RegEx help Jeff Williams wrote, on Tue 12/14/2004 11:23: I wrote a RegEx to let me know if a line of text has exactly 36 commas init (the comma is the separator) and I came up with this. I don't think itis quite right. I could use a little pointing in the right direction. Anythoughts?: $lines[0] =~/^(.*?,){36}.*?$/ Presumably you also want the fields, eventually. I'd use @fields = split(/,/, $lines[0]); and then you can simply check if (@fields == 37) { } (36 commas implies 37 fields). That way you already have the @fields array when you want them later. Presumably the magic number 37 is a constant defined at the top of your script? Good luck, Joe == Joseph P. Discenza, Sr. Programmer/Analyst mailto:[EMAIL PROTECTED] Carleton Inc. http://www.carletoninc.com 574.243.6040 ext. 300 fax: 574.243.6060 Providing Financial Solutions and Compliance for over 30 Years ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: threads::shared
I wrote this a few months ago because I wanted to make the data from XML::Simple available to multiple threads, and it seems to work ok - at least all my threads can see the recursed structure! You'll need to use a semaphore to control access to the data though, or you'll get into all sorts of trouble... Anyone else - is this a bad way to handle this? Should I be using storable instead? Paul My $NiceSharedStructure = ShareRecurse(\%hashref); sub ShareRecurse { my $orig = shift; my $ref = ref($orig); if ($ref eq "SCALAR") { my $copy : shared; $copy = &share($orig); return \$copy; } elsif ($ref eq "ARRAY") { my @copy : shared; foreach my $value (@{$orig}) { my $ref = ref($value); if ($ref eq "SCALAR") { push @copy, ShareRecurse($value); } elsif ($ref eq "ARRAY") { push @copy, ShareRecurse($value); } elsif ($ref eq "HASH") { push @copy, ShareRecurse($value); } else { push @copy, $value; } } return [EMAIL PROTECTED]; } elsif ($ref eq "HASH") { my %copy : shared; foreach my $key (keys %{$orig}) { my $ref = ref($orig->{$key}); if ($ref eq "SCALAR") { $copy{$key} = ShareRecurse($orig->{$key}); } elsif ($ref eq "ARRAY") { $copy{$key} = ShareRecurse($orig->{$key}); } elsif ($ref eq "HASH") { $copy{$key} = ShareRecurse($orig->{$key}); } else { $copy{$key} = $orig->{$key}; } } return \%copy; } } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chris Sent: 14 December 2004 15:23 To: perl-win32-users Subject: threads::shared All, I'm attempting to set the value of a shared variable from within a thread and I'm getting a weird error. Can someone tell me what I'm doing wrong here? -- use threads; use threads::shared; my %final : shared = (); $final{'foo'}{'bar'}{'test'} = 1; # this is run inside a thread -- I get the error "thread failed to start: Invalid value for shared scalar at lookup.pl line 84." The weird part is that I can set a variable in the root hash like... $final{'foo'} = 1; - Chris ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs * Gloucester Research Limited believes the information provided herein is reliable. While every care has been taken to ensure accuracy, the information is furnished to the recipients with no warranty as to the completeness and accuracy of its contents and on condition that any errors or omissions shall not be made the basis for any claim, demand or cause for action. * ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RegEx help
I wrote a RegEx to let me know if a line of text has exactly 36 commas in it (the comma is the separator) and I came up with this. I don't think it is quite right. I could use a little pointing in the right direction. Any thoughts? $lines[0] =~/^(.*?,){36}.*?$/ Thanks, Jeff. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
AW: threads::shared
> All, > > I'm attempting to set the value of a shared variable from > within a thread > and I'm getting a weird error. Can someone tell me what I'm > doing wrong > here? > > -- > use threads; > use threads::shared; > > my %final : shared = (); > > > $final{'foo'}{'bar'}{'test'} = 1; # this is run inside a thread > -- You cannot share more than one level in your hash. So this will not work even if this error disappears. Maybe perl warns you about this mistake with this message... If you have more than one level to share you have to write some kind of wrapper and use storable to stringify your first level. See the threads::shared manpage for further information about limitations. Dietmar > I get the error "thread failed to start: Invalid value for > shared scalar at > lookup.pl line 84." The weird part is that I can set a > variable in the root > hash like... > > $final{'foo'} = 1; > > > - Chris > > > ___ > Perl-Win32-Users mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
threads::shared
All, I'm attempting to set the value of a shared variable from within a thread and I'm getting a weird error. Can someone tell me what I'm doing wrong here? -- use threads; use threads::shared; my %final : shared = (); $final{'foo'}{'bar'}{'test'} = 1; # this is run inside a thread -- I get the error "thread failed to start: Invalid value for shared scalar at lookup.pl line 84." The weird part is that I can set a variable in the root hash like... $final{'foo'} = 1; - Chris ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs