how can i filter the numbers between 25-30? (the range is included)
grep '[2][5-9]' filename;
filters only 25 to 29. is there a solution for 25-30?
thanks for the response.
i'm trying to learn object oriented approach; when i tried to use ceil function in on of my subroutines it gives me undef function error.
i've a .pm file where i have all my subroutines that belong to a class. in one of these subroutines i tried to use ceil function where i've gotten the...
you can use index function:
$pos = index ($string, $lookfor, $startPos);
when used in loop you can all positions.
$pos=-1;
$startPos=0;
while(($pos = index($string, $lookfor, $startPos))>-1){
print "Found at $pos\n";
$startPos=++$pos;
}
yes, it works; just i dunno yet how to make it work with Data::dumper, but without it no problem. just use foreach to print:
foreach (@list){ print "@$_\n"}
Thanks mikevh for your response.
I've never used sort inside of a map, and it took some time to figure out, so the solution should be like this:
map { @$_ = sort { $a <=> $b } @$_, $_ } @list;
yeah, but my co-worker is telling me that there is a much superp solution with map. I need that because i'm going to stick that sort to the behind of another map which does something else. So I should not use for(each) although I do have that working code which looks hairy.
so it is going to...
I'm trying to sort each list in the list of lists without using foreach and flattening the two dimentional array.
I already have a working code with foreach which does very complicated stuff, but I'd like to improve my code using map, so the only way it can be improved is to find a way to use...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.