...
I have a large @all array which will contain a few (maybe 0-100) matches for a particular regular expression. I'd like to store the matches -- actually, formatted text based on those matches -- in an array so I can work with them later.
...
Here's a short script that should give you a few ideas:
Hi,
I have a program that searches for a particular string patten. I am however having difficulty passing the varible $i (in a loop) as the string pattern to replace. Using either perl or sed search and replace statements, I get the same kinda result. For example, using the perl:
for i in... (3 Replies)
hello ppl,
i'm coding a perl script and i have the following situation:
@array1 = ("test1", "test2", "test3");
@array2 = ("something1", "something2", "something1");
$var1 = "with_one_of_the_array1_values";
$var2 = "with_one_of_the_array2_values";
what i want to do is to compare $var1... (2 Replies)
@xray =~ s/^ *//g;
@xray =~ s/ *$//g;
@xray =~ s/\s+/ /g;
Guess I have a two part question ...
First
Is there a way to make substitutions, remove leading spaces, trailing spaces, and crunch multiple spaces into a single space, to the entire array, or must the substitutions be done on on... (1 Reply)
Hi,
I am trying to assign an array as a value to one of the array element, I mean
I have an array @KS and array @kr.
I want array @KS to hold @kr as an element.
So I am doin this
$KS=@kr;
But the value stored is number of elements in the @kr array.
Can... (2 Replies)
Hi
I need some help using arrays in perl.
I have an array say var and a variable var1.
I want to check if the var1 is present in the array. How do I check that ?
my @var = 1...10;
my $var1 =5;
if ( $var1 in @var )
{
.......
}
else
{
.......
}
Something like above. Can some... (2 Replies)
Hi all,
I am trying to compare two arrays in perl using the following code.
foreach $item (@arrayA){
push(@arrayC, $item) unless grep(/$item/, @arrayB); ... (1 Reply)
Hi,
I am not that good at Perl.
But here's what I wanna do.
I want to create a hash where the keys would point to different arrays. This is what I have tried to do but in vain :(
@arr=(1,2,3);
@arr1=(3,2,1);
%hashOfLists=();
$hashOfLists{Key1}=@arr."\n";
$hashOfLists{Key2}=@arr1."\n";... (3 Replies)
Hi all,
I have a log file which has logs. I am reading logs line by line into perl arrays. I want to print all the arrays elements starting from 8(word) to end of the line.
print array......array to a new file. and I have to do it in perl as res of the program in perl.
Please help me on... (9 Replies)
Hi friends,
I want to compare two arrays and find matched one using perl?
Also, I want to delete unmatched one.
Plz suggest me solution (1 Reply)
Discussion started by: Renesh
1 Replies
LEARN ABOUT REDHAT
pod::parselink
Pod::ParseLink(3pm) Perl Programmers Reference Guide Pod::ParseLink(3pm)NAME
Pod::ParseLink - Parse an L<> formatting code in POD text
SYNOPSIS
use Pod::ParseLink;
my ($text, $inferred, $name, $section, $type) = parselink ($link);
DESCRIPTION
This module only provides a single function, parselink(), which takes the text of an L<> formatting code and parses it. It returns the
anchor text for the link (if any was given), the anchor text possibly inferred from the name and section, the name or URL, the section if
any, and the type of link. The type will be one of 'url', 'pod', or 'man', indicating a URL, a link to a POD page, or a link to a Unix
manual page.
Parsing is implemented per perlpodspec. For backward compatibility, links where there is no section and name contains spaces, or links
where the entirety of the link (except for the anchor text if given) is enclosed in double-quotes are interpreted as links to a section
(L</section>).
The inferred anchor text is implemented per perlpodspec:
L<name> => L<name|name>
L</section> => L<"section"|/section>
L<name/section> => L<"section" in name|name/section>
The name may contain embedded E<> and Z<> formatting codes, and the section, anchor text, and inferred anchor text may contain any format-
ting codes. Any double quotes around the section are removed as part of the parsing, as is any leading or trailing whitespace.
If the text of the L<> escape is entirely enclosed in double quotes, it's interpreted as a link to a section for backwards compatibility.
No attempt is made to resolve formatting codes. This must be done after calling parselink (since E<> formatting codes can be used to
escape characters that would otherwise be significant to the parser and resolving them before parsing would result in an incorrect parse of
a formatting code like:
L<verticalE<verbar>barE<sol>slash>
which should be interpreted as a link to the "vertical|bar/slash" POD page and not as a link to the "slash" section of the "bar" POD page
with an anchor text of "vertical". Note that not only the anchor text will need to have formatting codes expanded, but so will the target
of the link (to deal with E<> and Z<> formatting codes), and special handling of the section may be necessary depending on whether the
translator wants to consider markup in sections to be significant when resolving links. See perlpodspec for more information.
SEE ALSO
Pod::Parser
The current version of this module is always available from its web site at <http://www.eyrie.org/~eagle/software/podlators/>.
AUTHOR
Russ Allbery <rra@stanford.edu>.
COPYRIGHT AND LICENSE
Copyright 2001 by Russ Allbery <rra@stanford.edu>.
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
perl v5.8.0 2002-06-01 Pod::ParseLink(3pm)