Most voted "perl" questions
Perl is a stable, cross-platform programming language, used in mission-critical applications in all sectors, with emphasis on its use in web development of all kinds.
Learn more…40 questions
Sort by count of
-
17
votes1
answer270
viewsError in serial port of Arduin with communication between C and Perl
I have to make a language communicate with the arduino and vice versa. I own the program at C and I have to modify it for this project, the language I have to use is Perl. Follow the code I have:…
-
11
votes1
answer886
viewsIs Perl used nowadays?
Well, I see little about Perl and I don’t know much about the language, it is still used nowadays and can replace some other language like PHP or Ruby? I don’t know exactly what Perl does but as I…
-
8
votes2
answers578
viewsPerl for web development
You can use Perl for web development? In this context, the language offers some benefit, that is, there are problems that it solves more effectively than on other platforms?
-
7
votes3
answers300
viewsRecover groups of a regular expression in Perl
I am running this regular expression to separate the digits of a version: ([\d]+)+ As you can see in this example, it works well enough to cover my needs. However, I have to add this treatment in a…
-
6
votes3
answers9222
views -
6
votes2
answers143
viewsCopy all before the first blank line
I have a file with several text blocks, separated by blank line. Ex.: block1 block1 block2 block3 block3 I need a solution with sed, awk or perl that locates the first blank line and redirects the…
-
5
votes1
answer111
viewsConcatenate a new line
How to add a new line by separating inputs into a Perl script? Example: I’m using the following script: #!/usr/bin/perl print 'oi' . '\n' . 'oi,de novo' And I call on the bash as follows: perl…
perlasked 8 years, 1 month ago Daniel Falbel 12,504 -
5
votes1
answer141
viewsPerl: Find a line in a txt by matching typed words?
Good afternoon, I have a notepad with several lines typed as for example: ★ Bayonet ★ Bayonet | Autotronic (Battle-Scarred) ★ Bayonet | Blue Steel (Minimal Wear) ★ Bayonet | Case Hardened…
-
4
votes1
answer107
viewsError Openwebmail when sending email to a person
I have installed Open Webmail, I have several more accounts in some accounts as soon as an email is sent to them, returns the error below, more they receive the message, someone has seen and or…
-
3
votes3
answers302
viewsHow to separate a file with multiple FASTA into different variables
I wanted to know how I can put each FASTA in a different variable, all of which are in the same file. Or even put in one array and retrieve each of them by numbers. Each Fasta starts with the symbol…
perlasked 10 years, 5 months ago user3783397 55 -
3
votes0
answers889
viewsLinux Script - Find, Copy, Paste and Change Text Files
I have these 3 files: Access.txt: Large text file with row records and columns separated by " ; ". NewAcess.txt: List of new accesses to add. NewUsers.txt: List of new users to add. File Example:…
-
3
votes1
answer50
viewsInsert perl timer
I need to put a timer on that perl below: It works by firing email followed to the end of the mailing list. Example if the list has 1 thousand emails it shoots email by email until finished. I’d…
-
3
votes2
answers65
viewsHow to convert a txt to csv in perl?
Hello, Little Boy. I am new to perl. I need to convert a txt file to csv. Follow the code I’ve managed so far. #!/usr/bin/perl my $filename = "interfaces.txt"; open(fh, $filename) or die "não…
-
2
votes1
answer96
viewsHow do I return the number of lines that appear with a given start?
I wanted to open a document and have it return to me the last number of a line containing '>' as reference. This of all lines that have this '>'. or that he reads the amount of '>' that…
-
2
votes0
answers37
viewsHow to disable numberLong in Mongo 3?
How to disable numberLong in Mongo 3? I’ve tried to mongo.native_long=0 and did not resolve. I’m using perl with mongoexport I’m using perl with mongoexport…
-
2
votes2
answers75
viewsDeconstructing a perl-based one-Liner error occurs "Can’t Modify single ref constructor in scalar assignment"
export dev2='/dev/sdb'; perl -'MDigest::MD5 md5' -ne 'BEGIN{\$/=\1024};print md5(\$_)' $dev2 Returns the following error: Can’t Modify single ref constructor in scalar assignment at -e line 1, near…
-
2
votes2
answers98
viewsHow to remove the Comma from the last occurrence [PERL]
Well I have a perl script that formats a json leaving it in this format: {"nome1":"123","nome2":"123","nome3":"123",} but I want only in the last instance to remain only the key without the comma…
-
2
votes1
answer62
viewsPerl script - how to calculate frequencies based on the size of the sequences?
I have this perl code to calculate the di-peptide count in my sequences (are 400 combinations, for example AA, AC, AD, AE...). But I want to calculate the frequency of these counts, for that I only…
-
2
votes1
answer56
viewsHow to make a condition with operators "+", "-", "*","/"
I have the following code: print ("Primeiro Valor: "); $valor1 = <STDIN>; print ("Segundo Valor: "); $valor2 = <STDIN>; print ("Operador: "); $op = <STDIN>; if ($op == "+") {…
-
1
votes1
answer83
viewserror when comparing C-torque
I have a Perl program that connects to a socket, receives binaries in this socket, reads the incoming binaries, compares them with other binaries in a buffer so I know if there are these binaries in…
-
1
votes2
answers757
viewsAnalyzing resource consumption by script
I have a server with S.Ubuntu Server 12.04 LTS, on this machine I have apache2 with PHP5 and PERL installed, but it consumes a lot of CPU resource, I wonder if it is a script with more problem for…
-
1
votes0
answers73
viewsEnd of script output before headers - Perl
Why so: print "Content-type: text/html\n\n"; print "<H1>Hello World</H1>\n"; Works! And so: my $tpl = HTML::Template->new(filename => 'index.html'); print "Content-Type:…
-
1
votes0
answers61
viewsDúvia match perl
I need a perl help for a match in regular expression... But it’s the opposite of what usually happens.... I need to do a match on the following. I have the number "(0003[6-9])|(00041)|:.:30/30", the…
perlasked 8 years, 7 months ago Leonardo Berbert 11 -
1
votes1
answer265
viewsHow to attach file in email?
I have this code in Perl that sends emails from a list with subject and body, I need one that does this but it is possible to attach some file of my choice. Can someone help me?…
-
1
votes1
answer89
viewsWhy some methods have ' :: '
Why some methods like Perl or Ruby: Net::FTP, has these two points; how is the construction of the methods of this class and why is created in this way (with this syntax) and not in the way used by…
-
1
votes1
answer392
viewsTime on timestamp
Talk it up, boys, it’s all right? Is it possible I know how much two hours in conversion timestamp? On this line I convert the current time to timestamp. $hours_2 = str2time(localtime()); But I need…
-
1
votes1
answer64
viewsTaking data from one Json and saving in another [Perl]
Good evening, I would like to know if there is a way to take data from one json and save it to another automatically without having to treat json as "text" (regex) in this case, I have already used…
-
1
votes0
answers160
viewsIndefinite reference error - C++
Hello! I’m trying to compile my program into C++ (it calls a function written in the Perl language) and it’s returning a long list of errors "indefinite reference": testeperl2principal.o: na função…
-
1
votes0
answers33
viewsHow to correctly print accented characters in file?
I am making a program that needs to get the words in a file that has a certain formatting. Everything is working correctly except that, in the output file, accented characters get wrong. I even…
-
1
votes0
answers45
viewsDST in Perl and PHP on Centos
I’m having a summer-time problem at Centos 7.8. The tzdata package has already been updated to not change the time (standard system package), but the functions in Perl and PHP continue to report 1h…
-
0
votes0
answers77
viewsJava function equivalent to pack("v",int) in Perl/PHP
I wonder if there is any function in Java equivalent to function pack("v",numero) of Perl and PHP. In perl/php: pack("v",numero) = unsigned short (always 16 bit, little endian byte order) In Java: ?…
-
0
votes0
answers143
viewsERROR Failed to find flength file
I am making an upload script working all right, but the upload does not work. Gives this error: Failed to find flength file cgi-bin/upload.cgi is below: #!/usr/bin/perl -w my $TEMP_DIR = '/tmp/'; my…
perlasked 10 years ago feliphe felix 629 -
0
votes1
answer116
viewsConvert perl script to php
I have a perl script working right and a script in php tbm working right. the only difference between the 2 is that my perl file has a command that makes a Return to the other script that calls it ,…
-
0
votes1
answer63
viewsPrint a line of a two-dimensional array in Perl
I have an array @data, two-dimensional, and I want to record line after line in a file. I’m doing so, for each line $i: print (ECR $data[$i][0]); for $j (1 .. $lastcol) { print (ECR "," .…
-
0
votes1
answer198
viewsPerl - Pass JSON data to variable and compare with IF
Good morning, I have a request that I make in an API using GET (LWP::Useragent), the data is returned in a JSON, in JSON are returned up to two results at most as follows :…
-
0
votes1
answer15
viewsCan’t call method "getFirstName" on an Undefined value at Consmanagement.pl
Good afternoon. I recently started learning Perl. I was practicing with a simple object-oriented program. This is my class package Consultant; sub new { my $class = shift; my $self = { _firstName…
-
0
votes2
answers28
viewsHow to identify the absence of a term in a file using PERL
Hi, I need some help here. I am writing a perl program that will identify certain patterns in a text file using regex. However, when the search term is not present in the text, I need the program to…
-
-1
votes2
answers59
viewsConvert arrays to hash
I am giving some maintenance on a system in Perl (language that I am Noob) and I needed to create a new report module where I need to solve the following situation: I have 2 arrays with the…
-
-1
votes1
answer31
viewsIgnore PERL lines
I made a script that reads the lines of a file, but now I need to ignore the first 3 lines and the last, returning only what is in the middle. Below is a text file and script template. text.txt:…
perlasked 4 years, 11 months ago Fábio Dias 1 -
-2
votes2
answers67
viewsDoubt code in Perl
The following code returned error in execution. Could anyone tell me where the error is and how to fix it? From now on, thank you. #!/usr/bin/perl for ($i=1; $i<15; $i = $i + 1;){ for ($j=1;…
perlasked 5 years, 5 months ago Selene Melo 7