When most of your "perl" is shell statements in backticks, you're fighting the language. Each individual set of backticks is its own independent shell anyway, you might as well use one shell instead of thirty.
I feel your pain, I learned Perl first too, but trying to use it as a shell just makes ugly code -- you'll spend most of your time, effort, and code getting things in and out of shell.
Strip out the perl, keep the shell, and you can do the same job faster in half the code.
You might find it better to process ping's output than nslookup's output, they both look up domain names.
Last edited by Corona688; 03-07-2013 at 06:25 PM..
Hello,
I have a script that monitors files uploaded via ftp. After a successful upload, the file name is written to the pipe.
There is another program that reads this pipe and allows automatically run any program or script ( say test.sh ) to process the newly uploaded file.
cat test.sh... (2 Replies)
I have 2 files. I basically want to search both of them to see if the 1st column ($1) matches and if it matches then check to see if the 2nd column ($2) matches, then execute some code showing the results of the matches.
File 1:
AAA 123
misc blah
BBB 456
CCC 789
File 2:
... (2 Replies)
I don't quite know what I'm doing, so this simple script is proving a challenge.
Here is some pseudo code that doesn't work yet:
if tail -1 "WORKING.txt" >/dev/null | egrep "^NMBR=*" > /dev/null
then
curl -k 'http://www.myserver.com/log.cgi?input=$?'
echo "hi there"
fi
Purpose:... (3 Replies)
Hi,
I have one dir which has N subdirs.For ex:
/home/user/Project_Src
/home/user/Project_Src/Dir_A
/home/user/Project_Src/Dir_A/subdir/sub_dir2
/home/user/Project_Src/Dir_A/subdir/sub_dir3
/home/user/Project_Src/Dir_B
/home/user/Project_Src/Dir_B/Build
i want to create a folder with... (2 Replies)
hi,
i have a service on unix platform, it will generate traces in a particular folder
i want to check using shell script if traces exist, then perform some action else continue to be in loop.
filename is service.tra
can you please help?
thanks (4 Replies)
Hello,
I want to run one (not multiple) action if an element doesn't exist in array.
for example:
@array = (1..10);
foreach $el (@array)
{
if ($el != 11)
{
print "number not found\n";
}
}
the output of this simple script:
number not found (3 Replies)
Hi,
I want to access files from different directories (for example: /home/dir1/file1 , /home/dir2/file2 ...) Like this i have to access these files(file1, file2...). (3 Replies)
Hi All,
I need to create a script to monitor a dir for new files with ext .err and also it should b a non empty files. and perform a action or command .
We have a new ETL application that runs on a linux server, every times a etl fails it creates a .err file or updates the existing .err... (4 Replies)
Hi,
I am new to awk/unix and am trying to put together an awk script to perform an action similar to vlookup between the two csv files.
Here are the contents of the two files:
File 1:
Date,ParentID,Number,Area,Volume,Dimensions
2014-01-01,ABC,247,83430.33,857.84,8110.76... (9 Replies)
Discussion started by: Prit Siv
9 Replies
LEARN ABOUT CENTOS
mail::spf::mech::ptr
Mail::SPF::Mech::PTR(3) User Contributed Perl Documentation Mail::SPF::Mech::PTR(3)NAME
Mail::SPF::Mech::PTR - SPF record "ptr" mechanism class
DESCRIPTION
An object of class Mail::SPF::Mech::PTR represents an SPF record mechanism of type "ptr".
Constructors
The following constructors are provided:
new(%options): returns Mail::SPF::Mech::PTR
Creates a new SPF record "ptr" mechanism object.
%options is a list of key/value pairs representing any of the following options:
qualifier
domain_spec
See "new" in Mail::SPF::Mech.
new_from_string($text, %options): returns Mail::SPF::Mech::PTR; throws Mail::SPF::ENothingToParse, Mail::SPF::EInvalidMech
Creates a new SPF record "ptr" mechanism object by parsing the string and any options given.
Class methods
The following class methods are provided:
default_qualifier
qualifier_pattern
See "Class methods" in Mail::SPF::Mech.
name: returns string
Returns 'ptr'.
name_pattern: returns Regexp
Returns a regular expression that matches a mechanism name of 'ptr'.
Instance methods
The following instance methods are provided:
text
qualifier
params
stringify
See "Instance methods" in Mail::SPF::Mech.
domain_spec: returns Mail::SPF::MacroString
Returns the "domain-spec" parameter of the mechanism.
match($server, $request): returns boolean
Checks whether the mechanism's target domain name, or a sub-domain thereof, is a "valid" domain name for the given request's IP address
(see "ip_address" in Mail::SPF::Request), and returns true if it does, or false otherwise. See "valid_domain_for_ip_address" in
Mail::SPF::Util for how domains are validated. See RFC 4408, 5.5, for the description of an equivalent algorithm.
SEE ALSO
Mail::SPF, Mail::SPF::Record, Mail::SPF::Term, Mail::SPF::Mech
<http://tools.ietf.org/html/rfc4408>
For availability, support, and license information, see the README file included with Mail::SPF.
AUTHORS
Julian Mehnle <julian@mehnle.net>, Shevek <cpan@anarres.org>
perl v5.16.3 2014-06-10 Mail::SPF::Mech::PTR(3)