Hot Solutions

Hello,

I have log files created in text format. I need to identify issues by certain log file comments, and I often have to wade through pages and pages of log files to find what I am looking for. perhaps, there is a better way.

I would...

Hi there,

I'm now looking for a new database product that meets my following requirements.

1. Run on Linux
    Since my other applications/databases/scripts are running on Linux, just want to be able to simply reuse those resources.
2....

Tags:nagios, vmware, linux, perl

I run at nagios server at work and i want to install a plugin to monitor my vmware environment.  I'm just running the free version of ESXi so i don't have any builtin fancy tools.

I found this plugin and it seems promising.

i installed the...

Tags:perl, code, linux, nagios

I'm trying to install a nagios plugin but i'm getting an error within CPAN.
 
So then i try and install the Tiny.pm
 
Not sure what to do next....

Tags:Bash, Perl

Hello,

I have a command output like this:


# cat /proc/cpuinfo | grep 'core id'
core id         : 0
core id         : 0
core id         : 1
core id         : 1
core id         : 9
core id         : 9
core id         : 10
core id   ...

I installed a new 500 GB SATA  and my system will not detect it but keeps treating it as the old one by it's SERIAL number and tells me it's disabled on boot up. What's wrong? How do I fix it?

I have unplugged computer after switching it off...

Tags:usb, perl, libusb

Hello, I am looking for some help reading a USB HID device with LIBUSB and Perl. I have this basic code.

 

It does not work, This has a C example http://rowsandcolumns.blogspot.com/2011/02/read-from-magtek-card-swipe-reader-in.html and here...

Tags:cgi-bin, cgi, perl, .htaccess, errordocument, redirect

I have the following code in my .htaccess file:

ErrorDocument 401 /404.htm
ErrorDocument 403 /404.htm
ErrorDocument 404 /404.htm
ErrorDocument 500 /404.htm

I would like those error redirects ignored in my cgi-bin so that if I have CGI it...

Hello Experts,

I got bunch of visio files  for translation. For this, I would like to export the text from the visio file into xml as source and target. once target gets translated import back the translated text into visio file.

Can you...

Tags:permutations excel macros vb perl

I would like to know if there is a way to generate Permutations of numbers in Excel? i.e say I have a number between 1 to 10 and I want to generate all permutation/combination of two numbers from the set of 10 numbers. ie all the 90 combinations...

Tags:form mail php

I am trying to get FormMail to work on my localhost as a test, before uploading to my main server. I am running IIS. I have configured the FormMial.pl file with the correct information:

@referers =...

Hi

I currently have a script which ideally, I'd like to run 1000 times by submitting them to a queue on a linux cluster using qsub.

The script is called pipeline.sh.

I've tried submitting using qsub 10 times from the command line at the...

Tags:Batch file, file processing, perl, powershell

I have a directory of 770 text files.  I need to insert a carraige return at the end of each file.  What's the best way to do this?  Batch file, powershell, perl-I don't care the coding style.  Thanks!

Hi there.

There is a login form on the page index.php

 

When the form on index.php is posted, it generates session id on the same page and then passes login data to login.php.

How do I programmatically post the login data via php, and...

Tags:perl, cgi

I am trying to add an email address to this piece of code so that it emails Mary and Bob but it is not working. It just emails Bob. Can someone tell me why? Do I need to use a comma instead?

 


Here is a larger piece of the code for...

Tags:perl, programing, linux

We've been using a CentOS 5.7 server and i'm trying to get some additional perl modules installed.  No matter what i try, either trying to install the modules within perl or manually i always run into errors.

Here is just an example but the...

Tags:INSERT, mysql using SELECT, specified values

I am using Perl to do the script logic serverside in a web page. I have this query:
INSERT INTO movie_files_table (movie_id) SELECT id FROM movie_info_table WHERE name=".$dbh->quote($movieName).";

One row in movie_info_table can correspond to...

Hi,

I have a shell script (pipeline.sh) located in the following directory:

/fs/nas15/home/mqbpgsm4/permanalysis/bin

I would like to run 1000 instances of this script on a linux server by submitting it to a queue using Qsub 1000 times.
...

Hi,

When trying to execute a perl script, I'm getting the error:

can't locate parallel/forkmanager.pm

I'm having perl5 installed.

Is there any way to install without compiling? Is compiling mandatory?

How should I do it ?

Thanks!

Tags:shell script binned averages

I want to create a 12 month binned or rolling average to help smooth the data. I currently have monthly averages in the file. Since a 12 month rolling average needs 12 months of course, the first 11 rows will not have a binned average. I would...

I am trying to host a Foswiki installation on a new Mac Mini server with Lion Server on it. The perl scripts do not execute, so the browser just displays the script itself instead of running it.

I have added the LoadModule line in httpd.conf...

Tags:mysq, select distinct, two columns, multiple columns

I am using perl to script against mysql. I want to select two columns from a table and make sure that the only columns are returned that have distinct values in one of the columns.

select distinc column1, column2 from table;

This will...

Hello,

I am trying to use the perl script esxi-backup.pl to backup my unlicensed version of VMware ESXI 4.1.  I have one datastore with 2 VM's.  The second VM copys fine, but the first only copies a few bytes of the vmdk file which should be...

Hi,

 can some one please let me know how to find .text files by recursively reading folders and sub folders from a path.

Issue here is , in that folders I have two type of txt files. For example (`7249184.txt',  '7419841_0001.txt'), but I...

Tags:Regex

I'm trying to do a match on things such as thomas. - any string ends up with a period or a comma.  How should I do it?  Thanks.

Tags:Java, Perl, VBScript

Hello Experts,

There is an requirement for converting translated strings into java chars[\u00f7] using Java or Perl Script, VBScript. The script should recognize the language and convert the strings into java chars.

Can you please provide...

Tags:Bash

Please look at this piece of a Bash script:

[root - opt]# cat /proc/cpuinfo | grep 'model name' | uniq | awk -F': ' '{print $2}'
Intel(R) Xeon(R) CPU              X5560  @ 2.80GHz

I wish to have the output like this after suppressing the...

Tags:Perl, Oracle

HI,

I have a problem. I want to catch the return code from SQL Loader inside perl script. How can I do it?

I am doing the following. Here SQL Loader returns 0, even if it is successful to insert all rows which is correct but it also...

Tags:Perl, Regex, Split

I'm testing a bunch of strings.  Some of them match a pattern like /^.+\.+$/ (strings end with n dots, n > 0).  For those strings, I want to split it into 1. whatever before the dots and 2. the dots.

How should I do that in Perl?

Thanks.

Tags:Regex Perl

Hello,

I want to verify in a string various substrings. They are all in a format  TEXT#RRGGBB but optinal one should be able to provide TEXT#RRGGBBTT  where TT varies from 00 to FF (transparent setting).
My current code looks like this
 
So...

Tags:Shell

Hi,

I have a shell script Kshell.ksh which calls 3 perl programs A.pl, B.pl, C.pl. Now each of those perl scripts have many if-else conditions inside and if any condition is not satisfied, they exit with exit 1. Now from inside the shell...

Tags:fast, quick, fastest, quickest, fetch, fetching, perl, mysql

$dbh=DBI->connect('dbi:mysql:info_db',$dbUser,$dbPassword,{AutoCommit => 0}) || die "Error opening database: $DBI::errstr\n";
$sth=$dbh->prepare("SELECT name FROM info_table WHERE name=". $dbh->quote($lastname) .";") || die "Prepare failed:...

Need a Shell script to compare files under the directories on AIX box.



Code contains two directories
Java—which contains various subdirectories containing .java files and
Oracle ---which contains oracle code containing subdirectories...

My date format is dd/mm/yyyy

This date should return an error:  30/31/2009

How can I check this date and return that it does not exist.

Can someone give me a Perl one-liner that will go through a log and delete all lines which match a certain regex?  I'm running this on Solaris, btw.

For instance, given the content below:

this is one line
this is two lines 2011
this is...

Tags:script, ssl

Hello Experts,

The command line output is given below for the gsk7capicmd command to check expiring certs

 $ gsk7capicmd -cert -list testss1 -db key.kdb -expiry 366 -pw hhh

Certificates found:
* default, - has private key, ! trusted
 ...

Tags:mod_perl centos apache2

Dear,

You are my last hope for solve this problem. I have box Centos 5.7 installed Apache2  when package mod_perl was installed , the Apache not start , show follown message error :



[Fri Mar 23 18:41:59 2012] [notice] Digest:...

Tags:Perl

Hi Experts,

I'm trying to compare 2 sets of files to get the difference in another file using perl.

I have written the code but it takes forever to run as the input file is quite large.

Being new to perl, what I have written is...

Tags:apache and mysql

I plan to install a Ticket software at my only INTERN network which need Apache web server port 80, Perl server and Mysql server port 3306.
But i have already Apache web server and Mysql server running for our web sites on our network.

My...

Tags:Perl, regular expression

Hello experts!

Quick question, I have been searching the web to find a regex to match these possible inputs.

+ - * /

this is what I am using

 

This works if a user enters a single character, but if i put

=-     <--- will match...

Tags:Perl

I would like to pass a hashref into a subroutine and the subroutine can modify this original hash.

I have been able to do this when using an arrayref.  However, I need to use a hash because I will need to extract values by key.

I struggled...

Tags:Perl, coding

Hello,

I am going through a Perl script and being not a Perl expert I come
across the following I do not understand
 

And then the next question I have,
supposse I have another array
my @arg2 = ('four','five');

How can I add/push...

Tags:Regex

Hello,

I have a string of multiple 'blocks' of colors in Hex notation. The number of blocks can vary from 1 to 9. each is separated with one or more spaces.

eg: string with 2 block  BLCK1:#222222 BLCK2:#333333
string with 4 blocks ...

I have a file that has some info for user records, each record is separated by a new line such as:

dn: John Doe
alias: JDoe
contacts: 20101118
contacts: Visable

dn: Mary Doe
alias: MDoe
contacts: 20101118
contacts: Visable
contacts:...

I have a string - n consecutive dots ......................

I'm trying to use /^[.]+&/ to identify it.   However it looks like Perl doesn't like the word boundary ^ and & - /^[.]+&/ doesn't match the string.  If I remove the ^ and &, it...

Tags:awk, linux, regex

My file is called /exports/tmp/ip789 and its content are pasted below:

# ipbackup
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=""
HOME=/var/lib/backup

14 00 * * * backup /usr/lib/backup --batch...

Tags:perl

I'm trying to use the Net::Telnet module in Perl.  One of the methods is waitfor().  I'm totally new to perl and can't figure out the syntax for the pattern.  The prompt on the screen that is what I guess the method is waiting for is...

Tags:Perl Regex

Hello,

I am not that experienced in regex and I struggle with the following

 
This code should accept TEXT:9:TEXT  or  TEXT:99:  or  TEXT:2:"TEXT"   but should not accept
TEXT:9 or   TEXT:   or  TEXT.

The regex I have here does accept...

I have string with single quotes that I need to handle before inserting into mysql.

Quote examples are      hel'lo    or   hello'    or  'hello


How can I use a perl regex to add another single quote in front of the single quote within the...

Tags:perl ssh eval

I have a script that ensure ssh is running by logging in every few mins. I have to be have output is the ssh deamon is not working.  However, my eval statement does not work.  Thoughts?


eval {
$scon = Net::SSH::Perl->new ($fqn, port => 22,...

Tags:Regex, Word Boundary, Perl

I'm using the following regex to match a word.

 

The problem now is although I've been using the word boundary (\b), I can still match words such as #sell or sell@.

Is there a way to avoid matching those with punctuation marks?  Thanks.

Tags:Perl

I have and array and in the array I need to not print the following.

Dont print if line 1 = <ON CODE
Dont print if line 2 = </ON>

but print if they do not follow each other

Thanks

Hello,

I search a script perl for generate oracle tnsnames.ora in csv file.

Thanks

Regards

My data looks like this:

<todo>
filename: call john doe_20120405_081431_
call john doe_20120405_081431_about car
call john doe_20120405_081431_about car_about offer
Update-YN:y
OpenClosed_OC:O
Status-RYG:G
<todo>
filename: till...

Tags:VB MACRO, PERL

Hello Experts,

There's an requirement to highlight the duplicate sentences in word documents using Macro or Perl Script.
The script will segment the paragraph using delimiter as fullstops and if single word appears the script will check for...

Tags:perl

Hi,

I am writing one perl script to print only some lines of all the files.

there is one array which has paths of filenames
from that list I need to print only some lines from each file
<
open (MASSAGE, "/tmp/files_list.log");
...

If I submit a form online, is it possible to track where the data is going? I know that I can see the "POST" and form actions fields, but it doesn't seem to be true for all forms; in that having that value doesn't necessarily mean that is the...

Tags:perl

$floatnum = "1234.5678";
# I want to floor the number to 3rd digit after the decimal.  So 1234.567
# also, ceiling it to:  1234.568

For a given associative array of the form

$ass{a}{b}[0] .... $ass{a}{b}[n]
where the last dimension is an array of unknown size n

What is the syntax for the last element in the last dimsion?

For example

$ass{a}{b}[0] = "ab0";...

Tags:perl, regex

Hi,

I need a regex that mathches a specific word and not a character

so for example

my input file contains the text

---------------------------------------------
john loves ice-cream
john is fun
________________________________
...

Tags:Perl

Hi,

I have a problem. I have 3 scripts A.pl, B.pl, C.pl. Now A.pl calls B.pl and B.pl calls C.pl. Now I have if-else conditions in C.pl. In the conditional loop of C.pl  if the condition is not satisfied), I want to stop the execution of A.pl...

I have developed a form in HTML and I want to allow the users to send data from the client servers, not with mailto method; the Javacript "<form... action="..."> needs only to be completed with the action reference, I guess.
I have found on the...

Tags:perl

$val1 =             "0.000001";
$val2 = $val1 + "0.00001";
print "val2 = $val2\n";  # it prints out 1.1e-05

#How do I get it to print "0.000011"

Tags:perl

$myfile = "/var/www/html/test.dat";

#how to check if file exist?
#if exist, what is the modified time of the file

Request a perl to count matched patterns in a file. Is one-liner possible? The environment is ms windows. For example,
in test.txt,

aa bb 12 32 24 bc d1 ff f0 cc
24 bc d1 99 0f cd ab db ea 12
12 23 34 45 54 55 21 78 34 89
cd ae de ef ca...

Tags:Perl

I have a script that breaks the files up by the po in the CSV files.
This script works great when there is a CRLF at the end but some of our customer are just send CR at the end of each line. Can I get help in modifing this script to handle...

Tags:Perl, PID

I just have a vague idea about using PID to avoid running multiple instance of the same Perl script, but I don't know how should I implement it in specific.  Any one could give me some idea?  Thanks.

Tags:Perl, Visual Basic

Writing Perl code from a sample VB Script. Basically create an internet explorer object and need to center it. I got all the code converted except the piece of code I pasted below below.

My objIE is $ie in my perl script.

Not sure how to...

Tags:Perl

I am trying to find out $business_date = $business_date -1 in YYYYMMDD format by using stat function on a file

But on running this code, getting error that $yr, $day, $hr and $min are not initialized. Why?

...

I hope I have enough information in the code:
 

I have a string that looks like this:

99-9999-A-9  format as dd-dddd-Alpha-d

I need to get three strings from this

First:  return first 6 numbers without hyphen    ex. 999999

Second: return alpha character   ex. A

Third: return...

I need some help writing a bash script (or something else, if suggested) that will scour recursively through all the php files in a folder and subfolders, and do a search & replace.

The text to match is quite long, so I'm guessing a script...

Hi,
 
i need a working example step by step how to connect Perl to MS SQLSERVER

regards,

Tags:open F, "-|", $|++

In Perl, I need the signs -| in the context of open F, "-|", and $| explained.

what are differences between following unix commands.

:wq
:w
:x
yy
ym
grep
cat


When we have to go to command mode when we have to go insert mode. Is command and insert mode applicable to only VI mode not for other modes. What other...

Tags:dynamical, client side, content, web pages

I was wondering if anyone could recommend me a good tutorial they have read themselfes or know about that teaches dynamically loading content to a web page?

I have a file containing the below data.


define host              {
use                     passive-linux-check-100-Mbps
hostname                abhinav.cl.da
alias                   abhinav.cl.da
_SERVERTYPE             virtual...

Tags:PERL, RegEx, substitution, search, replace, variables, backreferences

I need to load a list of search-and-replace patterns (with backreferences) in from a config file and apply them to a series of strings. I can't figure out how to do a search-and-replace with backreferences using variables.

This is the RESULT...

Tags:Perl

Hi,

I have this shell command -->

xmllint --schema schema1.xsd file1.xml 1>/dev/null

When executed gives me this

"file1.xml validates."

Now I want to catch this output "file1.xml validates" in a variable in perl.

I am doing...

Is there a quick way to get today's day of the week?  Getting the numeric representation would be best.

Thanks in advance.

Tags:create files, foreach loop, crate files recursively

Hi,
I need to create a file in foreach loop .
Its like in my code i need to manipulate data to appear in a certain way and its going through loops of foreach as shown below.

foreach $a(@a){
   foreach $b(@b){
       foreach $c(@c){
      ...

Tags:mysql syntax for

I have a query and it doesn't work very well

I have put in a not like statement in the query and my thinking is that the query would catch everything including the null values for the field except it doesn't.  If the field is empty it doesn't...

Tags:Perl

Hello,

I have a command output like shown below. From this output, I want to capture a field (highlighted in BOLD and underlined) and assign it to a variable called $iowait. Please give me a Perl syntax to do it. Thanks.

[root ~]# iostat -x...

Tags:perl

My log is as below. I want to replace tab with semicolon. Does anybody know how to do this?

Thanks very much!

Apr 30 2012 6:30:47 AM         10.186.166.63      Mismatch                
Apr 30 2012 6:28:43 AM         10.189.198.61         Mismatch                
Apr 30 2012...

Tags:Perl DBI

I have duplicate records of contact information from various sources (tables).

I've written the perl code to collect those fields that have values from the various columns in the various tables.  I use this collection to form a 'combined' set...

Tags:XML, parse, Perl

How can I parse the example XML file that is shown below by using PERL?

 

Thanks,

Tags:Perl

Hi,

I have a problem. In this code below, I am getting a “semi-colon” delimited csv file from a table. But if last column has null value, it is not putting that extra semi-colon at the end.

So we are getting results as (D is null here in...

I have hash with array in it that I print out with data::dumper like:

print Dumper($buildingDat);


$VAR1 = {
          'GB' => {
                    'buildings' => [
                                     'Aberdeen_Enterprise Drive...

Hello Folks,
I have a perl script that does some work based on an input file I provide.

What I would wish is a way to somehow log any changes that were not part of my input file. Meaning if I am changing a name to IP  that was not in my...

Tags:Perl

Hi,

I'm currently working with two scripts.
Running pipeline.sh generates three result files in the ~/candidates folder:

'proteome'-statistics file
'proteome'-final file
'proteome'-endfile file.

It is the generated statistics file I...

Tags:perl formmail

Attached are a small HTML file and a Perl Script (basically it is the MSA Matt's cript Archive Formmail Script) that gathers some basic info & emails it to my office.
Can anone show me the changes necessary if I want to be able to send the...

Can someone provide me with a good free tool to parse out data from an Apache Tomcat server log.

Of course Google provides a billion results, but I'd like a to sort through the list quickly.
Something in Perl would be best suited.

I'm...

Tags:Perl

Hi,

I need to execute a bunch of sql statements together after calling them from a  .sql config file. Can I do this in perl? Here it is what I tried so far...where am I going wrong?
...

Experts,

I'm trying to link two sections in a iOS Storyboard that contain NavigationControllers. The main reason why I do this is because one section has the Navigation bar turned off and the second has it turned on. How do I connect the two...

Tags:perl

Hi all,

Can you suggest me best IDEs for perl. I am using Komodo edit but it doesn't seem that great

thanks
-anshu

I want to click on an icon and ruby produces a report.  

the report if output to a text file which is then opened automatically by ...... ruby

I have an issue with a perl script, if there is a space in the data between the delimiter.

Example:

perl -nle '@c = split(/[\|\s]+/); print $_,$c[1].$c[3]' file.txt

20 13|SaC|DES37|17|165466|
20 14|SeC|DES38|18|165466|

Returns

20...

Tags:sum columns binned avgs

See attached input file.

assuming the file perl file is called aceavg.pl or the shell script file is called aceavg.sh and creates an output file called aceavg.txt and I want to called the the script by either

perl aceavg.pl > aceavg.txt
...

Tags:Perl remote ssh

I am trying to figure out how to adjust this subroutine to allow me to cut the shell connection without killing the PID. Basically what this script does is go to each server and restart the jboss instance. It must wait for each instance to start...

Tags:perl

Consider this perl script. It's called grepp since instead of returning a single line like the standard grep command does it returns the whole matching paragraph from a file...

#!/bin/bash
#usage:  grepp string filename or cat filename |...

Loading Advertisement...

Top Perl Experts

  1. ozo

    100,340

    Master

    0 points yesterday

    Profile
    Rank: Savant
  2. farzanj

    60,737

    Master

    0 points yesterday

    Profile
    Rank: Genius
  3. FishMonger

    45,500

    0 points yesterday

    Profile
    Rank: Genius
  4. wilcoxon

    39,566

    0 points yesterday

    Profile
    Rank: Sage
  5. kyanwan

    16,300

    0 points yesterday

    Profile
  6. bounsy

    15,700

    0 points yesterday

    Profile
    Rank: Wizard
  7. parparov

    14,460

    0 points yesterday

    Profile
    Rank: Guru
  8. ahoffmann

    14,252

    0 points yesterday

    Profile
    Rank: Genius
  9. simon3270

    11,550

    0 points yesterday

    Profile
    Rank: Wizard
  10. BinaryWarrior

    10,833

    0 points yesterday

    Profile
  11. kaufmed

    9,856

    0 points yesterday

    Profile
    Rank: Genius
  12. DaveBaldwin

    8,582

    0 points yesterday

    Profile
    Rank: Genius
  13. xterm

    8,500

    0 points yesterday

    Profile
    Rank: Sage
  14. woolmilkporc

    6,372

    0 points yesterday

    Profile
    Rank: Genius
  15. Ray_Paseur

    5,900

    0 points yesterday

    Profile
    Rank: Savant
  16. sjklein42

    5,468

    0 points yesterday

    Profile
    Rank: Sage
  17. arnold

    5,100

    0 points yesterday

    Profile
    Rank: Genius
  18. pfrancois

    4,888

    0 points yesterday

    Profile
    Rank: Guru
  19. Tintin

    4,268

    0 points yesterday

    Profile
    Rank: Genius
  20. johanntagle

    4,000

    0 points yesterday

    Profile
    Rank: Sage
  21. Papertrip

    4,000

    0 points yesterday

    Profile
    Rank: Sage
  22. slightwv

    3,800

    0 points yesterday

    Profile
    Rank: Genius
  23. nemws1

    3,800

    0 points yesterday

    Profile
    Rank: Sage
  24. bazika

    3,668

    0 points yesterday

    Profile
  25. dragon-it

    3,650

    0 points yesterday

    Profile
    Rank: Genius

Hall Of Fame