Sponsored Content
Top Forums Shell Programming and Scripting Perl - Grep open file more then once. Post 302539346 by matrixmadhan on Saturday 16th of July 2011 11:08:35 PM
Old 07-17-2011
No need to open a file for grepping, when grep it does that automatically for you

File::Grep - search.cpan.org
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep ^M in file using perl script....

hi i am using perl on windows ( active state perl 5.8 ) and i want to check for Control-M (^M) in file. files to be checked are in unix format so new line character is (\n). This perl script is called from Batch file ( windows .BAT file ) my script is while (<PROGRAM>) { ... (12 Replies)
Discussion started by: zedex
12 Replies

2. Shell Programming and Scripting

grep all records in a file and get a word count -perl

Hi, I have a file .. file.txt .. i need to get a total record count in the files into a $variable.. im using perl script thanks (4 Replies)
Discussion started by: meghana
4 Replies

3. Shell Programming and Scripting

Split a file based on pattern in awk, grep, sed or perl

Hi All, Can someone please help me write a script for the following requirement in awk, grep, sed or perl. Buuuu xxx bbb Kmmmm rrr ssss uuuu Kwwww zzzz ccc Roooowwww eeee Bxxxx jjjj dddd Kuuuu eeeee nnnn Rpppp cccc vvvv cccc Rhhhhhhyyyy tttt Lhhhh rrrrrssssss Bffff mmmm iiiii Ktttt... (5 Replies)
Discussion started by: kumarn
5 Replies

4. Shell Programming and Scripting

doing grep inside perl file

Hi have one Perl file inside that i am defining at an array file. @temp_vmdk_files = `grep vmdk '$guest_vmx'` where my $guest_vmx=/vmfs/volumes/47e40fec-9c8bb7f7-d076-001422159f8a/BES Exchange/BES-Exchange.vmx and i am just want to do grep of "vmdk" files from the above path but when... (5 Replies)
Discussion started by: bp_vardhaman
5 Replies

5. Shell Programming and Scripting

pattern grep using Perl in .TSV file

Hi All, I have a .TSV extension file having ~1 Gig data and I need to grep a pattern in that file using perl. I am not able to read the file using perl any suggestions on this/ If I Change the format my data gets mismangled so I am bothered about using specific format as well. #!... (3 Replies)
Discussion started by: vmsenthil
3 Replies

6. Red Hat

cannot set user id: Resource temporarily unavailable (not open file/open process related)

First post, sorry to be a bother but this one has been dogging me. I have a process user (java application server) that trips a resource limit every couple weeks and need help finding what limit we're hitting. First, this is what's running: This is the error when jobs are run or the... (0 Replies)
Discussion started by: Katahdin
0 Replies

7. Shell Programming and Scripting

Unable to open a file in perl

Not able to open a file using this code why not? use strict; use warnings; my $file = "verInfo.txt"; unless(open FILE, $file) { # Die with error message # if we can't open it. die "\nUnable to open $file\n"; } my $line = <FILE>; print $line; close FILE; (7 Replies)
Discussion started by: srijith
7 Replies

8. Shell Programming and Scripting

[Solved] perl and grep: get a script to look at more then one file

hi guys i have this very messy script, that looks in /var/log/messages.all for an error and reports if it finds the key works how can i get it to look at more then one file, i.e /var/log/message.all * so it looks in old logs as well thanks exit 0 if (isRenderNode(hostname)); my... (4 Replies)
Discussion started by: ab52
4 Replies

9. Shell Programming and Scripting

Using perl to grep a list of patterns from an input file

I have been struggling to grep a file of NGrams (basically clusters of consonants or Consonant and Vowel) acting as a pattern file from an Input file which contains a long list of words, one word per line. The script would do two things: Firstly read a text pattern from a large file of such... (5 Replies)
Discussion started by: gimley
5 Replies

10. Shell Programming and Scripting

Capture output of open pipe to a file in perl

Hi, I am trying to capture the output of the an open pipe in perl. but I am not sure how to do this. can some one please help me do that? Below is the script I am using (2 Replies)
Discussion started by: ahmedwaseem2000
2 Replies
XML::RSS::Headline(3pm) 				User Contributed Perl Documentation				   XML::RSS::Headline(3pm)

NAME
XML::RSS::Headline - Persistant XML RSS Encapsulation VERSION
2.2 SYNOPSIS
Headline object to encapsulate the headline/URL combination of a RSS feed. It provides a unique id either by way of the URL or by doing an MD5 checksum on the headline (when URL uniqueness fails). CONSTRUCTOR
XML::RSS::Headline->new( headline => $headline, url => $url ) XML::RSS::Headline->new( item => $item ) A XML::RSS::Headline object can be initialized either with headline/url or with a parse XML::RSS item structure. The argument 'head- line_as_id' is optional and takes a boolean as its value. METHODS
$headline->id The id is our unique identifier for a headline/url combination. Its how we can keep track of which headlines we have seen before and which ones are new. The id is either the URL or a MD5 checksum generated from the headline text (if $headline->headline_as_id is true); $headline->multiline_headline This method returns the headline as either an array or array reference based on context. It splits headline on newline characters into the array. $headline->item( $item ) Init the object for a parsed RSS item returned by XML::RSS. $headline->set_first_seen $headline->set_first_seen( Time::HiRes::time() ) Set the time of when the headline was first seen. If you pass in a value it will be used otherwise calls Time::HiRes::time(). $headline->first_seen The time (in epoch seconds) of when the headline was first seen. $headline->first_seen_hires The time (in epoch seconds and milliseconds) of when the headline was first seen. GET
/SET ACCESSOR METHODS $headline->headline $headline->headline( $headline ) The rss headline/title. HTML::Entities::decode_entities is used when the headline is set. (not sure why XML::RSS doesn't do this) $headline->url $headline->url( $url ) The rss link/url. URI->canonical is called to attempt to normalize the URL $headline->description $headline->description( $description ) The description of the RSS headline. $headline->headline_as_id $headline->headline_as_id( $bool ) A bool value that determines whether the URL will be the unique identifier or the if an MD5 checksum of the RSS title will be used instead. (when the URL doesn't provide absolute uniqueness or changes within the RSS feed) This is used in extreme cases when URLs aren't always unique to new healines (Use Perl Journals) and when URLs change within a RSS feed (www.debianplanet.org / debianplanet.org / search.cpan.org,search.cpan.org:80) $headline->timestamp $headline->timestamp( Time::HiRes::time() ) A high resolution timestamp that is set using Time::HiRes::time() when the object is created. AUTHOR
Jeff Bisbee, "<jbisbee at cpan.org>" BUGS
Please report any bugs or feature requests to "bug-xml-rss-feed at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=XML-RSS-Feed>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. SUPPORT
You can find documentation for this module with the perldoc command. perldoc XML::RSS::Headline You can also look for information at: * AnnoCPAN: Annotated CPAN documentation <http://annocpan.org/dist/XML-RSS-Feed> * CPAN Ratings <http://cpanratings.perl.org/d/XML-RSS-Feed> * RT: CPAN's request tracker <http://rt.cpan.org/NoAuth/Bugs.html?Dist=XML-RSS-Feed> * Search CPAN <http://search.cpan.org/dist/XML-RSS-Feed> ACKNOWLEDGEMENTS
Special thanks to Rocco Caputo, Martijn van Beers, Sean Burke, Prakash Kailasa and Randal Schwartz for their help, guidance, patience, and bug reports. Guys thanks for actually taking time to use the code and give good, honest feedback. COPYRIGHT &; LICENSE Copyright 2006 Jeff Bisbee, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
XML::RSS::Feed, XML::RSS::Headline::PerlJobs, XML::RSS::Headline::Fark, XML::RSS::Headline::UsePerlJournals, POE::Component::RSSAggregator perl v5.8.8 2006-07-17 XML::RSS::Headline(3pm)
All times are GMT -4. The time now is 10:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy