Category "perl"

what the following syntax means in perl?

my $dir = $ENV{"CDSSITE_INI_DIR"}; hello, I'm new to Perl. I'm confused with the curly braces above syntax. I know it is declared a scalar variable $dir. But w

Does anyone know how to enable mikrotik router FTP using Perl script?

my %attrs = ("/ip/service/enable" , "=ftp") ($retval,@results) = Mtik::mtik_cmd(\%attrs); or ($retval,@results) = Mtik::mtik_cmd('/ip/service/enable ftp' , \%a

Finding motifs and position of motif in FASTA file - Perl

Can someone help me with this Perl code? When I run it, nothing happens. No errors or anything which is weird to me. It reads in and opens the file just fine. I

Perl: break down a string, with some unique constraints

I'm using Perl to feed data to an LCD display. The display is 8 characters wide. The strings of data to be displayed are always significantly longer than 8 char

How do I open a file only if it already exists?

This is what I am trying to achieve: open(my $file,">>","/var/opt/input.txt"); if("/var/opt/input.txt" is opened sucessfully) { do some tasks; } else {

Perl backticks using bash

In Perl, the default shell to execute backticks is sh. I'd like to switch to use bash for its richer syntax. So far I found that the suggested solution is `bash

conda install: Package zlib conflicts for zlib[version='>=1.2.11,<1.3.0a0']

I am trying to install a given version of perl-bioperl with conda: $ conda install -c conda-forge perl $ which perl /home/hakon/miniconda3/bin/perl $ perl --v

Using foreach instead of map and grep in perl

my @a_columns = map { s/^"|"$|\n|\r|\n\r|"//g; $_ } split /;/, $s_act_line; above mentioned is my code. i am getting automatic warning while merging this code

How to get regex to work in a perl script?

I am working on a Linux based Debian environnement (precisely a Proxmox server) and I am writing a perl script. My problem is : I have a folder with some files

Perl Moose Dynamic assign the value to attribute suggestion

I am trying to accomplish the following. I have a Moose style modules A and B A need metadata as mandatory params B wants to create the object of A multiple tim

How to make regex works with perl command and extract numbers from a file?

I'm trying to extract from a tab delimited file a number that i need to store in a variable. I'm approaching the problem with a regex that thanks to some resear

how to implement odd numbers in a new array?

I want to output only the odd numbers from an array with the numbers from 1-100 in a new array. I have no idea how to do this. use strict; use warnings; my @z

Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : Login failed for user 'sa'

I am trying to execute one stored procedure using 'sa' user through perl script save this line in a perl file and execute that perl file system("start /wait s

invoking a stored procedure with input parameter and out cursor in perl script

Trying to execute a procedure in perl script, Proceure ->create or replace PROCEDURE Getproc ( v_catg IN CHAR DEFAULT NULL, v_cursor OUT SYS_REFCURS

Convert Outlook htmlrtf to html in perl

I managed to extract the RTF part from an Outlook .msg using Email::Outlook::Message. Here's how it looks: {\*\htmltag84 <b>}\htmlrtf {\b \htmlrtf0 {\*\ht

Allow CORS with Mojolicious::Plugin::SecureCORS

I am new to Mojolicious and using plugins especially SecureCORS. How can I allow CORS on POST requests? I managed to allow CORS for GET with following lines: us

Decrypt obfuscated perl script on hacked site

I was cleaning out a client's site that got hacked after I had cleaned it once already, when I found a cron job pointing to a script in the server /tmp director

perl match nested regex and write back to file

I have a txt file and I would like to match a certain pattern and convert a numeric field from decimal to hex and write back existing file using perl. Before Wi

How to directly assign the SOLE hash key to a scalar in perl

Is it possible to assign the only existing hash key directly to a scalar? For example can these two statements be combined into one? @the_keys = keys %the_hash;

enable vi command line editing from .perldb rc afterinit in perl debugger

Whenever I start the perl debugger from a script with a -d option, the session starts with emacs command line editing. I then type ESC ctrl J to enable vi edit