All Questions
32 questions
8
votes
1
answer
365
views
Parse data from Input file and print results
I have written a script which does parsing to the input file and take out some values from them with respect to the node and print the data accordingly.
Below is my script, and it works as expected:
<...
12
votes
4
answers
3k
views
Simple C transpiler
I wrote a simple transpiler (that may be a bit of a stretch) in perl to cut down on some boiler plate code.
I'm very new to perl, this being maybe my third ever project in it. My main question would ...
6
votes
1
answer
146
views
Extract strings from nested array in Perl
Extract the strings from nested arrays in Perl.
It prints: a, b, c, d, E
...
9
votes
2
answers
3k
views
Count line of code for a JavaScript project
Here is my bash script that I just wrote to count line of code for JavaScript project.
It will list number of:
Comment lines
Blank lines
All lines
Here is my script:
...
5
votes
2
answers
129
views
Assigning several variables from request URL using regexes
I refactored some of my code:
Summary: This implementation works with PSGI/Plack. It gets the URL from $env->{PATH_INFO} and assigns a different variable ...
5
votes
2
answers
140
views
Python2 to Python3 print fixer in Perl
Sometimes, I'm reviewing old questions written in Python2, with no parentheses around print statements. Or I'm changing one of my older codes, also without ...
4
votes
2
answers
417
views
Matching Fasta file header and section of sequence, printing each header only once
I have a Fasta file which I am opening and reading. I need to search for certain regions of the DNA sequence and, for each match found, print the sequence header followed by all matches within that ...
5
votes
2
answers
127
views
Extracting parts of filenames from an array
I am very new to perl. So far I love it, my new favorite interpreted language. I am quickly learning that perl has MANY 'tricks' to it. The following code extracts file names out of one array and into ...
7
votes
2
answers
414
views
Finding the first non-repeated character in a string
Given a string, find the first non-repeated character in it.
E.g., "yellow" should return "y"
There are several solutions for this in other languages, but I haven't seen one ...
4
votes
1
answer
113
views
Perl module validate quoted string literal, test with Test::LectroTest
I guess for some motivation: I ripped this out of a larger library I'm half-working on to parse S-expressions and cleaned it up a bit.
I'm trying to write a simple function that tests whether a ...
7
votes
1
answer
112
views
Perl script to match case law references
I am very new to Perl and decided to work on a simple script that could solve a problem I encounter in my day to day work. The purpose of the code that follows is to search over a body of text and ...
6
votes
1
answer
104
views
Extracting Linux configuration information using Bash and Perl
For few days I'm thinking about making my code faster and using less CPU. This code is a statusbar that runs in a loop. I'm asking because there's a lot of perl and I'm wondering if it could be done ...
6
votes
2
answers
320
views
Terminal Chat Room
Summary
I have written a pair of Perl scripts that form a UDP chat room allowing users to send messages over the internet with RSA encryption, making the messages imune to MITM attacks. The scripts ...
7
votes
1
answer
764
views
Network chat in Perl
I have written a network chat program as my first major project in Perl. It makes simple use of REGEXP's, modules, sockets, command-line option parsing, and forking and uses these features to produce ...
4
votes
1
answer
89
views
Deleting most recent files by parsing filename
I have hundreds of .mp3 files in a single directory of the same naming format, title_YYYY-MM-DD.mp3, with maybe 30 different ...