you have a question on how to do something in Perl, or
you need a Perl solution to an actual real-life problem, or
you're unsure why something you've tried just isn't working...
then this section is the place to ask. Post a new question!
However, you might consider asking in the chatterbox first (if you're a
registered user). The response time tends to be quicker, and if it turns
out that the problem/solutions are too much for the cb to handle, the
kind monks will be sure to direct you here.
Hello wise monks! I come to ask for your kind advice and enlightenment on the following matter:
I've been trying to print a character a certain number of times, if a certain condition is met. For the printing, I use an “until” loop. For the condition, I would like to use the conditional (ternary) operator. However, this apparently results in a syntax error. Below is example code which produces the error. My intention was to print the equals sign ten times instead.
my $count = 0;
( defined $count ) ?
( print "=" until ( $count ++ == 10 ) ) :
( print "Undefined count.\n" );
but I get message that I am unable to to modify read-only value despite Moose docs saying that trigger can modify RO values.
What is correct way to force upper case (and thus in general) 'pre-preocess' object constructor arguments?
Here is the question:
How do I retrieve the foreground value #FF0000?
Docs says to use itemconfigure without value:
but that does not work. I am stuck!
My ultimate task for that is to:
1st. flip-flop the color of the text.
2nd: flip-flop the font from normal to bold.
The delimiter is used to determine the exact whitespace to remove from the beginning of each line.
It's not obvious to me what "the delimiter" is and how was it declared. To me, it's an odd use of the word "delimiter".
Am I correct in assuming that what's meant is: when you write "<<~EOF;", Perl will take the initial whitespace characters from the following line as an "indentation definition" and remove it from the beginning of every line in the here-doc?
Got saddled with a project that involves utilizing DBIx for CRUD operations in a MySQL database. One of the fields is something I haven't had to deal with in Perl and particularly in DBIx. I have a binary(60) field in MySQL that will store a bcrypt hash for passwords. In some testing and discovery, I am having a hard time storing properly and ultimately authenticating passwords correctly. In my testing been using Crypt::Eksblowfish::Bcrypt. I've googled about for the morning and have unfortunately found nothing that applies to a best practice in the situation. Does anyone have any suggestions?
I would like to override Perl's printing to STDOUT/STDERR with my own version which simply adds the line number the print function call happened. Ideally, ALL the line numbers/filenames/packagenames in the case of nested calls all the way to the top/main because I want to separate a program's STDOUT depending on which part of the program it originated.
You can assume I have complete control over the source code (of the program which I want to override its print statements) and can change anything I like. HOWEVER, I do not have control of the source-code of the many packages the program may be using and the print statements therein.
Initially I thought to just replace print with my_own_print in the source code and run that. Then I realised that it should only affect print in a function-call context and I used PPI for this purpose. And then I realised that there are other ways of printing to STDOUT/STDERR including the croaks etc. And finally I also realised that print statements in the packages will be out of my control. So this plan collapsed fairly quickly.