Operators in Perl [closed] - perl

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Sorry for asking this question.I know Perl operators are very importance while writing Perl script.Can any one provide me all Perl operators with examples or else give any links for my case

See perlop. If you have Perl installed, you can read this from the command line with perldoc perlop (unless you have one of those idiotic distributions Linux distros that removed the perldoc program).
To learn more about Perl in general, start reading perldoc perltoc (table of contents) for Perl and perldoc perlintro.

Related

ANSI sequence to change terminal name [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
Improve this question
I use a bash script (konsole-name.sh) to change a terminal name, like this:
#!/usr/bin/bash
echo -en "\e]30;$1\a"
and I wanted to use the same method from a perl script that I use to check the GPU temperature, so that it updates periodically the window title.
Yet I didnt find a way.
I tried both this:
$comm='echo -en "\e]30;T=$t\a"';
`$comm`;
and this, using my bash script:
$comm="konsole-name.sh T=$t";
`$comm`;
there is some way to do it?
The console escape sequences work by printing text to the terminal. In your case, the backticks gobble up the output of the script.
Most likely you just want print "\e]30;$1\a"; from within Perl:
my $title = "Fancy terminal title";
print "\e]30;${title}\a";

Can someone please tell me what this means? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
Do the following sets of characters have a meaning? Thank you
+++++++++[ >+++++++++<]>+ ++.<++++[ >++++<]>++++.+.<+++[ ->+++<]>+.<+++[ >---<]>. <+++[ >+++<]>+.
If you look closer a little bit your BrainFck code, you will notice that doing:
+++++ ++++[ >+++ +++++ +<]
located at your first loop, is the same as:
+[><]
or:
+[]
or even:
-[><]
Only a little more confusing..
This is not C++ or python.
This is Brainf*ck.
The first loop looks suspect though :)

Fast Perl Parser Modules? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
At my work I wrote a little parser for C-like expressions in one of our in-house Perl tools. I initially chose Parse::RecDescent because of its extreme ease of use and straightforward grammar syntax, but I'm finding that it's excessively slow (which is corroborated by general opinion found on the web). It's safe to assume that the grammar of the expressions is no more complicated than that of C.
What are the fastest (but still with a straightforward and uncumbersome grammar format) lexxer/parser modules for the use case of thousands of simple expressions (I'd guestimate the median length is 1 token, mean is 2 or so, and max is 30)? Additionally, thanks to unsavory IT choices, it must work in Perl 5.8.8 and it and any non-core dependencies must be pure Perl.
Parse::Eyapp looks like satysfying 5.8.8, pure perl and dependency requirements. As for speed, it claims LALR parsers, which must be faster than recursive descent. A grammar for expressions is given in the doc. Hope it helps.

What is the convention for line wrapping in command-line instructions? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I need to document some very long command line instructions. What convention should I use to indicate that the line is not broken?
For example, for the command:
fab --fabfile=create_virtualenv.py --hosts=<user#remote> create_virtualenv:base=<base_folder>,name=<ve_name>,requirements=<requirements_file>,packages=<package_folder>
I was thinking:
fab --fabfile=create_virtualenv.py --hosts=<user#remote> \\
create_virtualenv:base=<base_folder>,name=<ve_name>,\\
requirements=<requirements_file>,packages=<package_folder>
but that's just me making something up based on a half-forgotten example, and I can see potential for ambiguities regarding whitespace and punctuation.
A referenced standard would be best, or consistent, well-regarded implementation.
On Windows, I would use the same character that CMD.EXE uses for line continuation - the caret ^.
fab --fabfile=create_virtualenv.py --hosts=<user#remote> ^
create_virtualenv:base=<base_folder>,name=<ve_name>,^
requirements=<requirements_file>,packages=<package_folder>
See Long commands split over multiple lines in Windows Vista batch (.bat) file for more info. Be sure to read the first three answers, as they each have useful information.
On 'nix, I would use a single \ for the same reason. A double \\ would imply a backslash literal, so that is not good. But a single \ at the end implies line continuation.
fab --fabfile=create_virtualenv.py --hosts=<user#remote> \
create_virtualenv:base=<base_folder>,name=<ve_name>,\
requirements=<requirements_file>,packages=<package_folder>

Searching through Stackoverflow.com from the commandline/bash [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
As the title says i am looking for a way to search through stackoverflow.com using only the command line specifically bash in linux.
Things I need to accomplish :
I just need to get the top 10 answers for my question or even top 5.
Plain Text Output , i.e. strip
HTML out if possible.
Also I would prefer if you didnt give a answer that required elinks or something similar.
here's a rough script to run from command line that does the job
wget 'http://stackoverflow.com/feeds/tag?tagnames=command-line&sort=newest' -qO - | perl -nle ' print $1 if /\<title[^>]+\>([^<]*)/;'|head
It grabs RSS output for a given tag (command-line here) and sort of parses it.
To be done properly one would probably want to parse XML in a better way or use some perl rss parser.