Hi
I need a perl onliner which seaches a line starting with a pattern(last occurence) and display it.
similar to
grep 'pattern' filename | tail -1 in UNIX
Ex: I want to display the line starting with "cool" and which is a last occurence
adadfadafadf
adfadadf
cool dfadfadfadfara... (4 Replies)
Hi,
I am trying to grep for two patterns from a set of 820 apache webserver logs,
When I Try to search the pattern with a date stamp and use a wildcard character * for ex: /28/Aug/2008:21*/ to get all the log entries for that particular hour that is 21 st hour I get errors. Please kindly... (1 Reply)
Hi
i want to search two pattern on same line and replace onther pattern..
INPut file
aaaa bbbbb nnnnnn ttttt
cccc bbbbb nnnnnn ppppp
dddd ccccc nnnnnn ttttt
ffff bbbbb oooooo ttttt
now i want replace this matrix like.. i want search for "bbbbb","nnnnnn" and search and replace for... (4 Replies)
can someone help me out with the bolded?
else if (regmatch($Subject, "^Application") && (regmatch($From, "^etgh") && (regmatch($Body, ".*not authorized to use this server.*"))))
what this section of the code is suppose to do is to scan through the contents of $Body, if do a set of... (1 Reply)
Hi friends, I want to search for some hex error codes in some files.
After the hex error code is found, the occurences would be counted.
Afterwards the found hex errorcode would be cat into a separate file.
Here is my code:
#!/usr/bin/perl
use File::Basename;
my $find = $ARGV;
my... (2 Replies)
user 10
values
content is:
musage.py
yes
value
user 11
values
content is:
gusage.py
yes
value
how to print "user" string line by searching "content is:" string and "usage.py" string in perl (8 Replies)
Hi Expert,
We have some shell scripts which Internally uses Perl Script to Unzip the source zip files which comes to inbound directory. So now our requirement is to avoid the dependency on Perl Script and us Shell Script to unzip the files. I have the Perl script with me attached can some one... (3 Replies)
I have existing pattern in the perl script as:
my $pattern = "^Line.*?:|^Errors*: |^SEVERE:.*?:|^Null pointer exception occurred";
and I wanted to include below keywords in my search pattern
"I/O exception" and "FileNotFoundException"the problem is when I include my pattern like
my... (5 Replies)
I have this fileA
TEST FILE ABC
this file contains ABC;
TEST FILE DGHT this file contains DGHT;
TEST FILE 123
this file contains ABC,
this file contains DEF,
this file contains XYZ,
this file contains KLM
;
I want to have a fileZ that has only (begin search pattern for will be... (2 Replies)
Discussion started by: vbabz
2 Replies
LEARN ABOUT CENTOS
ppix::regexp::token::literal
PPIx::Regexp::Token::Literal(3) User Contributed Perl Documentation PPIx::Regexp::Token::Literal(3)NAME
PPIx::Regexp::Token::Literal - Represent a literal character
SYNOPSIS
use PPIx::Regexp::Dumper;
PPIx::Regexp::Dumper->new( 'qr{foo}smx' )
->print();
INHERITANCE
"PPIx::Regexp::Token::Literal" is a PPIx::Regexp::Token.
"PPIx::Regexp::Token::Literal" has no descendants.
DESCRIPTION
This class represents a literal character, no matter how specified.
METHODS
This class provides the following public methods. Methods not documented here are private, and unsupported in the sense that the author
reserves the right to change or remove them without notice.
ordinal
print 'The ordinal of ', $token->content(),
' is ', $token->ordinal(), "
";
This method returns the ordinal of the literal if it can figure it out. It is analogous to the "ord" built-in.
It will not attempt to determine the ordinal of a unicode name ("N{...}") unless charnames has been loaded, and supports the vianame()
function. Instead, it will return "undef". Users of Perl 5.6.2 and older may be out of luck here.
Unicode code points (e.g. "N{U+abcd}") should work independently of charnames, and just return the value of "abcd".
It will never attempt to return the ordinal of an octet ("C{...}") because I don't understand the syntax.
SUPPORT
Support is by the author. Please file bug reports at <http://rt.cpan.org>, or in electronic mail to the author.
AUTHOR
Thomas R. Wyant, III wyant at cpan dot org
COPYRIGHT AND LICENSE
Copyright (C) 2009-2013 by Thomas R. Wyant, III
This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full
text of the licenses in the directory LICENSES.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of
merchantability or fitness for a particular purpose.
perl v5.16.3 2014-06-10 PPIx::Regexp::Token::Literal(3)