[Solved] Perl Match Operator =~

STRAIGHT OUTTA DOCS: The simplest regexp is simply a word, or more generally, a string of characters. A regexp consisting of a word matches any string that contains that word: “Hello World” =~ /World/; # matches What is this Perl statement all about? “Hello World” is a simple double-quoted string. World is the regular expression … Read more

[Solved] Perl Programming

You’re talking about regular expressions and how to use them in Perl. Your question seems to be whether the answers you picked to homework are correct. The code you’ve added should do what you want, but it has syntax errors. if ( ^x*$ ) { print “This is”; } Your pattern is correct, but you … Read more

[Solved] How set found text in variable in Perl

Use captures ((…)). if ( my ($capture) = $x =~ /(NY)/ ) { say $capture; } By the way, always use use strict; use warnings qw( all );. The above program also needs use feature qw( say );. solved How set found text in variable in Perl

[Solved] I found this code and I think it’s encoded. I tried to understand how it’s encoded or how can read it. Does anyone have an idea to decode this code?

I found this code and I think it’s encoded. I tried to understand how it’s encoded or how can read it. Does anyone have an idea to decode this code? solved I found this code and I think it’s encoded. I tried to understand how it’s encoded or how can read it. Does anyone have … Read more

[Solved] How to split a string and add new line before date

It’s not very good form to bring just a requirement to Stack Overflow without obviously having tried to solve the problem yourself. Without any code there is nothing to “help” with, and I hope you’ll at least make an effort in the future Assuming there is always some whitespace before each date, this will work … Read more

[Solved] JavaScript VS Perl Script [closed]

Start with the wikipedia pages for each language. Then grab some reference books on each (the Camel book for Perl, obviously). Areas to consider might include: Approach to types Namespacing / variable scoping Module/Class/Package inclusion mechanisms argument passing semantics return value contexts (search for scalar/list context wrt perl) Multi-processing/multi-threading support/approaches Unicode support Standard libraries Range … Read more

[Solved] use perl to print text in given commend [closed]

It appears as though you want to simply eliminate duplicate users. Here’s one way. The only difference is that the output is not sorted in the same order it came in from the file. It uses an external module, Getopt::Long to handle the arguments, then uses a hash to eliminate duplicates: Code: #!/usr/bin/perl use strict; … Read more

[Solved] How can I convert my shell script to Perl? [closed]

You should visit http://perlmaven.com/ (available in many languages) or http://learn.perl.org/ to learn some Perl first. Your shell script doesn’t need to copy the commandline values. You also used #!usr/bin/bash which won’t work because the path is either /usr/bin/bash or (more common) /bin/bash: #!/bin/bash createviewset ccm -b $1 -t $2 source setenv $2 rest of the … Read more