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.
As you can see it just runs over the input file with -n, putting it into a scalar. Then Perl::Tidys that scalar, then puts it back.
It works in every other way just as I'd like, but when it encounters unicode characters (I've been working on some Russian text and need to recognise these chars: 'ОЕАИН') it replaces them with question marks.
I can't add command-line flags like -CIO, that's not allowed. I've tried adding binmode STDOUT, ":utf8" and binmode STDIN, ":utf8" to the BEGIN block but that hasn't changed anything.
Of course I can use Perl::Tidy in other ways, but I'm used to this utility and would like to get it working again in a way I can trust, it's become a habit.
As the title hints, I would like to break apart mp4 videos to animation and sound, so these may be edited, and recombined, to form an edited version of the mp4 file.
My question is: do you know of any good and reliable modules that can help me do so ?
I have a little calc I wrote in perl that really just provides and eval & print loop for the user.
I have made changes over the years, but one of the things that has always bothered me is, if I want to add a complex expression -- anything that is multi-lined, how to get my input loop to know when it needs more input OR when it doesn't (vs. _could_ take more input).
My 'semi-model' for that would be something like bash, where if you type 'the beginning of a control structure, bash will change to a different prompt to indicate it wants more input.
How might I do the same in my eval/print loop?
As it is now, I can define functions on 1 line, for example, but there is no easy way to extend that to more than one line.
I could force the use of an 'extend char', like backslash at the end of line -- but in bash, those are only needed if it is ambiguous -- i.e. if the line is already well formed, you need to enter '\' to tell bash to keep parsing. Ex. (using 'home>' as normal prompt):
On the 2nd line, it doesn't display the normal prompt, but a single
greater than sign. How could I get my input/eval loop to get feedback
from perl that I'm in the middle of a similar structure and change the
prompt and not try to eval it?
Clarification: how can I do that w/o writing an entire perl parser? ;-)
My Background in Perl: 5 Days of Experience in using Perl
Task where I am stuck at :
1) I have a radio which outputs 10 values at a given time stamp. I need to send those 10 Values as a single UDP packet via Ethernet connected to Another Hardware managed by MATLAB/Simulink.
2) I wrote a Perl Script which gives me a string of all values like $data = '2.2,4,6,7.43,23.34,11,45576,343,22,10' ..
3) MATLAB/Simulink blocks (related to my hardware) doesn't accepts strings . It needs numbers of type (Boolean,int8,unit8,int16,uint16,int32,uint32,float,double) and have big Endian format...
4) Coming to my application , I can only receive 32 Bit Word input data stream so that decode block converts back into an array of 10 numbers... (There is no way I can know the functionality of Decode block so that I can encode in the same way in my perl script.)
Can anyone please help me in this regard as to tell how can i send those bunch of numbers in a single UDP packet.
I believe its similar to pack/unpack functions in Perl . Except the fact that Unpack is Decode block in Simulink. I have to PACK the data to either of Datatypes above mentioned with any possible delimiters