Re: Array to hash with reverse split?

2003-08-20 Thread linux . rocks
[SNIP] John> #/usr/local/bin -w John> ^^ John>I see no 'perl' there. Typo. [SNIP] John> my (@ARRAY, %TEST, $FILTER) = ""; John> John> Why are you assigning "" to the first element of @ARRAY? 'Cause I'm an idiot... [SNIP] John> Perl has the tools to do most of that without runnin

Array to hash with reverse split?

2003-08-18 Thread linux . rocks
Hi All, I want to read contents of a dir, filtered, into a hash. I have this: #/usr/local/bin -w use strict; my (@ARRAY, %TEST, $FILTER) = ""; print "Enter filter:"; $FILTER = ; chomp $FILTER; @ARRAY = ` ls -l /foo/bar | grep "$FILTER" `; for (@ARRAY) { chomp; } This gets just the info I want,