read(3pm) User Contributed Perl Documentation read(3pm)NAME
OpaL::read - Perl extension for reading files and commands.
SYNOPSIS
use OpaL::read qw(functions);
No functions or variables are exported automaticly so you have to specify them here.
DESCRIPTION
OpaL::read is used for reading files and commands.
All functions are autoloaded so they will not be loaded into memory if you have not used them before.
FUNCTIONS
readfile
Reads the content of the specified file and returns a list with the all lines.
USAGE:
@foo = "readfile"($filename);
readfileline
Reads the first line of the specified file and returns a scalar with that line.
USAGE:
$foo = "readfileline"($filename);
readscalarfile
Reads the content of the specified file and returns a scalar with the entire content.
USAGE:
$foo = "readscalarfile"("filename");
readcommand
Reads the content from the output of the specified command and returns a list with the all lines.
USAGE:
@foo = "readcommand"("command");
readcommandline
Reads the first line from output of the specified command and returns a scalar with that line.
USAGE:
$foo = "readcommandline"("command)";
readscalarfile
Reads the content for the output of the specified file and returns a scalar with the entire content.
USAGE:
$foo = "readscalarcommand"($command);
AUTHOR
Ola Lundqvist <ola@inguza.com>
SEE ALSO perl(1).
perl v5.10.1 2012-08-21 read(3pm)
Check Out this Related Man Page
Parser::Style::Tree(3pm) User Contributed Perl Documentation Parser::Style::Tree(3pm)NAME
XML::Parser::Style::Tree - Tree style parser
SYNOPSIS
use XML::Parser;
my $p = XML::Parser->new(Style => 'Tree');
my $tree = $p->parsefile('foo.xml');
DESCRIPTION
This module implements XML::Parser's Tree style parser.
When parsing a document, "parse()" will return a parse tree for the document. Each node in the tree takes the form of a tag, content pair.
Text nodes are represented with a pseudo-tag of "0" and the string that is their content. For elements, the content is an array reference.
The first item in the array is a (possibly empty) hash reference containing attributes. The remainder of the array is a sequence of tag-
content pairs representing the content of the element.
So for example the result of parsing:
<foo><head id="a">Hello <em>there</em></head><bar>Howdy<ref/></bar>do</foo>
would be:
Tag Content
==================================================================
[foo, [{}, head, [{id => "a"}, 0, "Hello ", em, [{}, 0, "there"]],
bar, [ {}, 0, "Howdy", ref, [{}]],
0, "do"
]
]
The root document "foo", has 3 children: a "head" element, a "bar" element and the text "do". After the empty attribute hash, these are
represented in it's contents by 3 tag-content pairs.
perl v5.14.2 2011-11-15 Parser::Style::Tree(3pm)
I have the following questions regrading Unix commands.
1. Could you provide the commands how to print the content of .profile and .shrc files on the screen using more and piple command? or a better way?
2. How can i use the head and tail to display lines from 25 through 75... or a better... (4 Replies)
I have one file in which some commands have written line line
i have to read lines from this file(file name passed as avariable)
and then i have to execute these commands..
how can i do it? (5 Replies)
Actually I want to display the entire output fired by ps command. My output gets trucated after 80 chars.
Thus, i am not able to see the entire command running when i give a ps -eaf ....
Does anyone know how do i display the entire output fired by ps command .. (i.e the command along with... (5 Replies)
Could any one tell me how to read and match multiple lines in perl? Did this code below still work in this situation?
while (<FILE>) {
if (/ /) {
}
}
Thanks a lot! (5 Replies)
hi guys,
I posted a similar question about reading a file and adding its content to another file and i used
sed '/HELLO/r fileB' fileA
however this command adds the content of fileB under the word "HELLO"
what if i need to add the word above "HELLO".
what could i use?
Thanks, (6 Replies)
Hi,
I am reading a file line by line using read line function of while loop. Each line contains 4 fields. I want to take these 4 values in 4 variables in each iteration so that i can use them in my script. The issue here is that my awk command is returning awkward results -
Here is a sample line... (8 Replies)
i have the following files with content
file a content;
1234|wert|
file b content;
2345|byte|
file c content;
9999|kilo|
i want to read the contents of three files seperately and for each of them select the first column and output below
welcome 1234
welcome 2345
welcome... (6 Replies)
I'm learning about the read command and wrote this little script to read data from a file:
readfile()
{
while read variable; do
echo $variable
done
}
readfile < File.txt
I have three lines in File.txt; each a single word. The script only echoes the first two lines and drops the... (9 Replies)
I need to read temp.$i file content line by line through while loop but somehow the '\' do not appear in output.. Can someone guide how to read this exact content line by line in unix :
if
then
cat temp.$i | head -1 # the file content appears fine
while... (13 Replies)
Hi All,
I would like to print the content from the specific line of a file .
For example... i have file abc.txt which has 100 lines of code ,from this file i would like to print the content from 20,19,18th line......like that
Regards
Srikanth (4 Replies)
Hi All,
I wanted to write a perl script to read the content in a file,the file content is either 0 (zero) OR 1. The idea is like this.
If (content =1), then it will proceed to perform some step. and then update the file content to 0(zero)
else
if (content =0), it will update the content to... (11 Replies)
Hi there,
I am trying to read the content such that if there is 'adsmsext.dll', it will read everything from line one until it reads line 6 with 'C:' then it will terminate at line 5.
1. C:\WINDOWS\system32\adsmsext.dll NT AUTHORITY\Authenticated Users:R
2. ... (5 Replies)
Hello,
Is possibly there a way to prepend the filename to its content without a third file? The reason is to add a header to each file contents to distinguish each other when they are pasted side-by-side.
sample.txt:
XLOC_001 0
XLOC_002 23
XLOC_003 4
XLOC_012 6output (with the same... (4 Replies)