| rook2pawn | thanks guys |
| talexb | rindolf, Interesting article by Ovid. http://use.perl.org/~nicholas/journal/33110 -- very interesting. |
| FuzzyB | is it possible to take the output of a function parse it through a regex and assign it to a variable all in the same line? |
| BinGOs | parse ? |
| FuzzyB | something like my $name = unshift(@blocks); $name =~ s/\{//; in one line |
| BinGOs | oh a substitution |
| integral | why do you want to do something in one line? (my $foo = func()) =~ s/// works for me anyway. |
| BinGOs | my ($name) = map { s/\{//; $_ } unshift @blocks; # perhaps ? |
| spx2 | FuzzyB, what does unshift(@blocks) do ? |
| FuzzyB | because i would like to see efficency in my code |
| integral | BinGOs: no. |
| BinGOs | oh ignore me. |
| integral | FuzzyB: Lines doesn't equate to efficiency. |
| spx2 | integral, what does that do (my $foo = func()) =~ s/// ? |
| BinGOs | integral++ |
| integral | spx2: It calls func() in scalar context, assigning its return to $foo, and then using the lvalue returned from the assignment which is $foo to bind to a substitution |
| savvas | how would you make a perl one-liner equal to: sed -e 's/example/replaced/g' ? |
| rindolf | talexb: yeah. |
| integral | savvas: perl -pe 's///g' |
| savvas | much obliged :) |
| integral | why not use s2p? |
| spx2 | integral, so the substitution replaces '/' with '' ? |
| integral | spx2: Huh? The substitution replaces the empty pattern where it matches with the empty string. It does nothing, it's an example, fill in your own pattern |
| spx2 | integral, i was stupid sorry |
| savvas | integral: can i make two substitutions in one line? like sed -e 's/one/moo/g' -e 's/two/moo2/g' ? |
| integral | put them inside one '' with a ; in between, or just use s2p |
| savvas | oh s2p was for me, yeah just started reading the manual, thanks s2p or psed? same thing eh? |
| ion_bidon | hello; %hash = @array is the correct way to convert array values into hash keys ? hmm |
| FuzzyB | my counter = 0; foreach(@array) { $hash{$count} = $_; } maybe? |
| talexb | ion_bidon, How about %hash = map { $_ -> 1 } @array instead. |
| FuzzyB | i don't know how to use map |
| rindolf | talexb: map { $_ => 1 } @array FuzzyB: it's not hard to learn. |
| ion_bidon | talexb, rindolf: thanks |
| talexb | rindolf, Sorry, my bad -- it's not 6am yet. |