What does “select((select(s),$|=1)[0])” do in Perl?

It’s a nasty little idiom for setting autoflush on a filehandle other than STDOUT. select() takes the supplied filehandle and (basically) replaces STDOUT with it, and it returns the old filehandle when it’s done. So (select($s),$|=1) redirects the filehandle (remember select returns the old one), and sets autoflush ($| = 1). It does this in … Read more

Get the Perl rename utility instead of the built-in rename [closed]

I can only speak for Debian. The two programs are called /usr/bin/rename.ul from the util-linux package (hence the .ul suffix) /usr/bin/prename from the perl package The actual rename command works via the /etc/alternatives mechanism, whereby /usr/bin/rename is a symlink to /etc/alternatives/rename /etc/alternatives/rename is a symlink to /usr/bin/prename The same problem has been bugging me on … Read more

what does the double forward slash mean here?

From this page here: http://perldoc.perl.org/perlop.html#Logical-Defined-Or Although it has no direct equivalent in C, Perl’s // operator is related to its C-style or. In fact, it’s exactly the same as ||, except that it tests the left hand side’s definedness instead of its truth. Thus, EXPR1 // EXPR2 returns the value of EXPR1 if it’s defined, … Read more

Capture the output of Perl’s ‘system()’

That’s what backticks are for. From perldoc perlfaq8: Why can’t I get the output of a command with system()? You’re confusing the purpose of system() and backticks (“). system() runs a command and returns exit status information (as a 16 bit value: the low 7 bits are the signal the process died from, if any, … Read more

What are the most important features of an IDE for Perl development? [closed]

The most important feature of an IDE for Perl development (including Padre) is: an interactive debugger that actually works. E.g. remembering breakpoints, ability to drill down into complicated data structures, and copy (to clipboard) should work on watched variables – including a menu command Copy Special that allows putting it in various formats; say CSV, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)