Re: Regex for matching files that don't have type extensions

2016-11-05 Thread Aaron Wells
True. It could get hairy. Unicode is a pretty vast landscape, and I think if you only want ASCII word characters to count as things that could be in a filename, your original [A-Za-z0-9_] is your best bet. Thanks to the others for their comments. As Ken says: there are probably more ways to code th

Re: Regex for matching files that don't have type extensions

2016-11-05 Thread Aaron Wells
*predefined On Sat, Nov 5, 2016, 10:27 AM Aaron Wells wrote: > Hi Jovan. \w is a presidents character classes that is equivalent to > [A-Za-z0-9_], so this works also: > m/^\w+$/ > > On Sat, Nov 5, 2016, 10:24 AM Jovan Trujillo > wrote: > > Ah, I figured it out. >

Re: Regex for matching files that don't have type extensions

2016-11-05 Thread Aaron Wells
Hi Jovan. \w is a presidents character classes that is equivalent to [A-Za-z0-9_], so this works also: m/^\w+$/ On Sat, Nov 5, 2016, 10:24 AM Jovan Trujillo wrote: > Ah, I figured it out. > m/^[A-Za-z0-9_]+$/ works because it will only match if the entire string > follows the pattern. Thanks! >

Re: Data type of attributes

2016-09-29 Thread Aaron Wells
Hi Klaus, Have you tried this? ref $some_obj; # should give your class name as a string Doubtless Uri will find something wrong with this 😋 On Thu, Sep 29, 2016, 12:34 PM Klaus Jantzen wrote: > Hello, > > I have defined Moose-classes with various attributes. > > During the execution of a progr

Re: calculate within a loop

2016-09-12 Thread Aaron Wells
@Jim, That eval bit i think Nathalie got from me. I need to review my core Perl. I think i’m in the habit of assuming Perl warns against any usage of undefined values, even in boolean context. Not so. I’ve proven to myself that this is not the case: $ perl -E’ >my ($foo, $bar); # these aren’t

Re: calculate within a loop

2016-09-10 Thread Aaron Wells
Hi there, Me again. The sort function does NOT default to <=>. It defaults to string comparison order. See the Perl doc for sort: "If SUBNAME or BLOCK is omitted, sorts in standard string comparison order. " So assuming you want numbers sorting, 'sort { $a <=> $b } keys %{$nameref}' would be the

Re: This is one of the things ...

2016-05-14 Thread Aaron Wells
Ha. Java has one... but it's not very pretty. Just like anything Java, it's bloated, overly verbose, and clunky. Java just discovered "lambdas" a couple years ago with jdk 8. But functional languages have had lambda syntax for years. Ocaml: List.map((*) 2)[1;2;3;4;5] Haskell: map (2*)[1,2,3,4,5]

Re: This is one of the things ...

2016-05-12 Thread Aaron Wells
Thank you Lee. I had forgotten about that use case. I tried to do dibasic query building once upon a time with JavaScript before discovering the goodness of Perl. Ended up leaning on a library. It made things better, but it didn't make them Perl. On Thu, May 12, 2016, 5:06 PM lee wrote: > > ...

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-14 Thread Aaron Wells
Hi Kenneth, Welcome aboard (for the nth time)! The replies on this thread have been helpful, but they haven’t really addressed the underlying issue, which is that there’s subscripting, then there’s dereferencing. I’ll try to keep my explanation brief, but first a solution: $confused = [ bl