Re: confused by use of 'implied' variable

2013-04-05 Thread will trillich
of thing can normally be used, versus when not? thanks alot for any insights here greg -- Will Trillich :: 812.454.6431 “Grading takes away all the fun from failing. And a huge part of education is about failure.” -- Shimon Schocken ___ Perl-Win32

Re: pattern match 'or' operator |

2012-03-08 Thread will trillich
Greg -- The pipe | operator isn't single characters only: $string =~ /this|that|the other/; But the character set is: $string =~ /[abc]/; # matches any a, b or c $string =~ /[tw]hat/; # matches 'that' or 'what' What you're looking for is something like this: $string =~ /\\L(ength)?\b/;

Re: perl pattern match option 's' (coerce . to include \n)

2012-03-08 Thread will trillich
Greg -- When you're looking for something in particular, it's easy to just look for that specific thing. As you say, Perl has different definitions of what \n actually translates to depending on platform and context. So rather than worry about \n just have Perl look for what you're actually

Re: How to push a hash on to a hash of array entries

2011-11-08 Thread will trillich
On Tue, Nov 8, 2011 at 11:20 AM, Paul Rousseau paulrousseau...@hotmail.comwrote: Here is the Dumper output when I use the code, push @{$project{$projectno}}, \%days; Right, so $project{$projectno} is an ARRAYREF, and each entry pushed in this way will be a HASHREF. Note that other entries

Re: How to split up a string with carriage returns into an array

2011-11-04 Thread will trillich
On Fri, Nov 4, 2011 at 1:15 PM, andy_b...@wiwb.uscourts.gov wrote: Perl should handle the \r\n part for you - \n is normally a match for whatever your OS's end of line marker is. But just in case you're on *nix and processing a Windo~1 file, split( /[\r\n]+/, $msg ) is reasonably

Re: How to Extract a Date from a File

2011-11-02 Thread will trillich
How about something like this: next unless m:(\d\d\d\d)/(\d\d)/(\d\d):; $start_date = $1$2$3; On Wed, Nov 2, 2011 at 4:07 PM, Paul Rousseau paulrousseau...@hotmail.comwrote: Hello Perl folks, I would like to know if there is an eloquent way of extracting a date string from a file.

Re: Help with file redirect

2011-07-05 Thread will trillich
I haven't tested this, but here's a similar problem to yours--maybe these solutions will work for you: http://www.perlmonks.org/?node_id=4913 On Tue, Jul 5, 2011 at 3:43 PM, Barry Brevik bbre...@stellarmicro.comwrote: I am writing an app that has a lot of screen output which it writes to

Re: how to best convert an array containing hexadecimal values to ascii value?

2010-11-23 Thread will trillich
Dude! This one is really easy: print hex(ff); # 255! so @result = map{ hex } @source; Mwa ha ha! On Tue, Nov 23, 2010 at 3:44 PM, Greg Aiken gai...@visioninfosoft.comwrote: if one dumps a windows registry section using regedit (to *.reg format) the reg_sz values are listed in the

Re: how to best convert an array containing hexadecimal values to ascii value?

2010-11-23 Thread will trillich
Or if you want the characters themselves: @result = map { chr( hex ) } @source; Or as a solid string: $s = join '', map { chr( hex ) } @source; On Tue, Nov 23, 2010 at 3:47 PM, will trillich will.trill...@serensoft.comwrote: Dude! This one is really easy: print hex(ff); # 255! so

Re: lame question \\\\.\\pipe\\pipename vs '\\.\pipe\pipename'

2010-10-20 Thread will trillich
Here's my take: print 'it\'s time \\ to go'; The backslash can quote the single-quote, and hence another backslash as well for completeness, within a single-quoted string. On Wed, Oct 20, 2010 at 12:09 PM, Greg Aiken gai...@visioninfosoft.comwrote: forgive my ignorance here, but I thought