See this: http://doc.perl6.org/language/concurrency#Safety_Concerns
"Opening a FIFO for reading normally blocks until some other process opens the same FIFO for writing, and vice versa."
]]>my $query = <<"";
SELECT foo, bar, baz
FROM sometable
WHERE id IN (${\ substr ',?' x @ids, 1 })
What? Oh, we weren’t golfing?
]]>$"
that can't be replaced with join
:
my @regexes = list_of_qr_objects(); my $combined = do { local $" = '|'; qr/@regexes/ };
If any of the regex objects contain (?{ })
or (??{ })
constructs, using join
would decompile and reparse the code. That in turn would require use re 'eval'
in scope for the final qr
, and even then it would break the use of any lexical variables that those code blocks might close over.
However, qr/@regexes/
uses the compiled form of each of the @regexes
directly, including the ordinary Perl code inside their code blocks, so this works fine.
Of course, this doesn't provide a direct argument either way about whether it's good to reach for punctuation variables by default, but I think it's interesting regardless, as well as an occasionally useful technique.
]]>my $query = <<"END_SQL";
SELECT foo, bar, baz
FROM SomeTable
WHERE id = ANY(?)
END_SQL
And then pass an array reference as the value. \o/
]]>But Abigail's example wouldn't make it past review onto a production server. I'm on a multi-decade project and there's an inevitable turnover of staff so maintainability of code is critical; moreso even than having it work properly (maintainable but faulty code is fixable; working but unmaintainable code that needs updating is useless). Other people who are new to my code (and that really includes me more than a couple of weeks after writing it :/ ) must be able to maintain it as easily as possible. It is increasingly difficult to find experienced perl devs and much of the resistance from others comes from all that "perl is line-noise" nonsense. I think it behooves us to write perl that is not line-noise, and is as far from it as is reasonable.
*frowns at Liz* :)
]]>
BTW: How did you start your career in bioinformatics? Was your primary education biology/genetics and you used Perl as a tool to solve your tasks, or was it the other way - you were a bored programmer that thought one day "it would be cool to sequence and save my hamster to hard drive"?
What is the bio knowledge threshold required to start work in bioinformatics company?
Also, the title should have been "FASTQ to FASTA." Darn.
]]>