Hi,
In principle I am searching for a Perl equivalent for this sed command:
sed "/TIM_AM_ARGS=/ s/60/1440/" $EDIT_FILE > $TEMP_FILE
cp $TEMP_FILE $EDIT_FILE
I was wondering if it needs to be like this, or that there other, shorter, alternatives:
open (TIMENVFILE, "<$timenvfile") or die... (5 Replies)
Am trying to remove urls from text strings in PERL. I have the following but it does not seem to work:
$remarks =~ s/www\.\s+\.com//gi;
In English, I want to look for www. then I want to delete the www. and everything after it until I hit a space (but not including the space).
It's not... (2 Replies)
I am trying to match a pattern exactly in a shell script. I have tried two methods
awk '/\<mpath${CURR_MP}\>/{print $1 $2}' multipath
perl -ne '/\bmpath${CURR_MP}\b/ and print' /var/tmp/multipath
Both these methods require that I use the escape character. I am guessing that is why... (8 Replies)
I am trying to match a character return from a website so that I can replace it. It is the '...' character (didnt even know it existed initially). The character apparently has the hex value of 2026, but in the script, attempting to substitute regular 3 periods is not working.
What am I... (2 Replies)
Hi Everyone,
I am looking for neat way to grep a non-empty string that basically contains a hostname, which might be in FWDN form or without the domain, for example:
hostname.internal.domainname.net
The file I am parsing contains blan lines (^$) and also series of "-" which in other places... (2 Replies)
i have a script in which i need to skip comments, and i am able to achieve it partially...
IN text file:
{****************************
{test : test...test }
Script:
while (<$fh>)
{
push ( @data, $_);
}
if ( $data =~ m/(^{\*+$)/ ){
}
With the above match i am... (5 Replies)
Hi all,
Here is the data file:
- want to match only lan3 in the output .
- not lan3:1
file :
OPERATING_SYSTEM=HP-UX
LOOPBACK_ADDRESS=127.0.0.1
INTERFACE_NAME="lan3"
IP_ADDRESS="10.53.52.241"
SUBNET_MASK="255.255.255.192"
BROADCAST_ADDRESS=""
INTERFACE_STATE=""... (2 Replies)
cat clinvar_00-latest.vcf | perl -aF/\\t/ -lne '/CLNSRCID=(\d+)/ and print join("\t",@F,$1)' > OMIM.txt
The above code finds the text CLNSRCID=, but only outputs those records in which there is a numerical value only.
For example, the first match is CLNSRCID=103320.0001 in line 4 of the... (1 Reply)
Hi Perl users,
I have another problem with text processing in Perl. I have a file below:
Linux Unix Linux Windows SUN
MACOS SUN SUN HP-AUX
I want the result below:
Unix Windows SUN
MACOS HP-AUX
so the duplicate string will be removed and also the keyword of the string on... (2 Replies)
Discussion started by: askari
2 Replies
LEARN ABOUT DEBIAN
ncc::countrycode
CountryCode(3pm) User Contributed Perl Documentation CountryCode(3pm)NAME
NCC::CountryCode - Perl extension for blah blah blah
SYNOPSIS
use NCC::CountryCode;
my $cc = new NCC::CountryCode();
my $cc_hash = $cc->getCCs();
print ($cc->isCC('NL')) ? "exists" : "non-existing";
$cc->CC2Country('fr');
$cc->Country2CC('russia');
DESCRIPTION
This module provides class and several methods to simplify mapping between country names and country codes, as they assigned in the
ISO3166.
The CC2Country() method maps country code to the corresponding country name or empty string, if it doesn't exist.
The Country2CC() tries to map passed country name into country code. As the spelling of the name may vary, this function tries to find all
possible matches for passed name. In array context method returns hash of country codes and names, in scalar - a string, containing all
possible country codes and corresponding country names.
The isCC() method verifies, that passed country code is a legal one and returns it in upper case. Otherwise it returns empty string.
The getCCs() method returns the reference to the internal hash, that containes all the country codes with corresponding them country names.
BUGS
In addition to the country codes defined by ISO3166 standart this module also introduce 'UK' as a synonim for 'GB' and 'EU' as additional
'virtual' name for the Europe itself.
AUTHOR
Timur Bakeyev, timur@ripe.net
SEE ALSO perl(1).
perl v5.10.1 2001-09-10 CountryCode(3pm)