Hello all
im facing some kind of problem i have this string :
functionA() $" "$ functionB("arg1") $" = "$
i will like to replace all the pairs of opening and closing "$" to be something like that
functionA() <#" "#> functionB("arg1") <#" = "#>
i cant of course do is with simple ... (1 Reply)
Hi All,
I have a file that I need to be able to find a pattern match on a line, search that line for a text pattern, and replace that text.
An example of 4 lines in my file is:
1. MatchText_randomNumberOfText moreData ReplaceMe moreData
2. MatchText_randomNumberOfText moreData moreData... (4 Replies)
Hello,
I have a Perl script that reads in an Excel spread sheet and formats the values into a text file. I am having trouble with one column that can have numbers or letters. Excel left justifies the values that start with a letter and right justifies the values that contain only a... (2 Replies)
I have a file where the rows correspond to individuals and the columns are about 106 variables. Each variable is coded as either ACGT, and "missing" is coded as blank. This is a tab delimited file. I'm trying to replace all blanks (" ") with 0. The simple script I have is only replacing some of the... (3 Replies)
Hi. I have a file with asterisk field separators and backslash line terminators. The first field in each line names the line type. I am trying to process each range separately. Here's what the data looks like:
BA*DATA\
LS*DATA1*DATA2*00020*\
TA*DATA1*DATA2*DATA3*\
TA*DATA1*DATA2*DATA3*\... (1 Reply)
I am not sure if this is doable. I am trying to open and print the content of the file by replacing all instances fo perl to PERL . This is my code but it is
giving me the number count instead of the actual lines with changes.
open (PERLHISTORY, 'sample.txt') or die "The file sample.txt could... (3 Replies)
I am trying to write a simple perl script to run on a FreeBSD machine.
There are alot of posts here, and I have read so many, yet can not get this script to run.
#!/usr/bin/perl
-e 's/\r\n/~/' infile.txt outfile.txt
I am trying to take a windows text file, move it into Unix, run a script on... (1 Reply)
Hi,
I have a file having around 30 records. Each record has 5 fields delimited by PIPE. Few records in the file having Junk characters in the field2 and field4.
I found the junk charcter and I tested it and replace the junk with space with the command below
perl -i -p -e "s/\x00/ /g"... (1 Reply)
When I use special characters the command to replace multiple files with a string pattern does nt work.
---------- Post updated at 12:33 PM ---------- Previous update was at 11:38 AM ----------
This works
perl -pi -e 's/100/test/g' *
This does nt work
perl -pi -e 's... (1 Reply)
Hi All,
i can replace a perticular value in sentence using perl.
perl -pi -e 's/old/new/' sample.txt
but i am not able to replace whole string by perl.
file1 contains "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.147.109.211)(PORT=1526))(CONNECT_DATA=(SID= MWDBD22)))". i... (3 Replies)
Discussion started by: arindam guha
3 Replies
LEARN ABOUT DEBIAN
wiki::toolkit::testlib
Wiki::Toolkit::TestLib(3pm) User Contributed Perl Documentation Wiki::Toolkit::TestLib(3pm)NAME
Wiki::Toolkit::TestLib - Utilities for writing Wiki::Toolkit tests.
DESCRIPTION
When 'perl Makefile.PL' is run on a Wiki::Toolkit distribution, information will be gathered about test databases etc that can be used for
running tests. Wiki::Toolkit::TestLib gives convenient access to this information.
SYNOPSIS
use strict;
use Wiki::Toolkit::TestLib;
use Test::More;
my $iterator = Wiki::Toolkit::TestLib->new_wiki_maker;
plan tests => ( $iterator->number * 6 );
while ( my $wiki = $iterator->new_wiki ) {
# put some test data in
# run six tests
}
Each time you call "->next" on your iterator, you will get a fresh blank wiki object. The iterator will iterate over all configured search
and storage backends.
METHODS
new_wiki_maker
my $iterator = Wiki::Toolkit::TestLib->new_wiki_maker;
number
use Test::More;
my $iterator = Wiki::Toolkit::TestLib->new_wiki_maker;
plan tests => ( $iterator->number * 6 );
Returns the number of new wikis that your iterator will be able to give you.
new_wiki
my $wiki = $iterator->new_wiki;
Returns a fresh blank wiki object, or false if you've used up all the configured search and storage backends.
configured_databases
my @configured_databases = $iterator->configured_databases;
Returns the @configured_databases array detailing configured test databases.
Useful for very low-level testing only.
SEE ALSO
Wiki::Toolkit
AUTHOR
Kake Pugh (kake@earth.li).
COPYRIGHT
Copyright (C) 2003-2004 Kake Pugh. All Rights Reserved.
Copyright (C) 2008 the Wiki::Toolkit team. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
CAVEATS
If you have the Search::InvertedIndex backend configured (see Wiki::Toolkit::Search::SII) then your tests will raise warnings like
(in cleanup) Search::InvertedIndex::DB::Mysql::lock() -
testdb is not open. Can't lock.
at /usr/local/share/perl/5.6.1/Search/InvertedIndex.pm line 1348
or
(in cleanup) Can't call method "sync" on an undefined value
at /usr/local/share/perl/5.6.1/Tie/DB_File/SplitHash.pm line 331
during global destruction.
in unexpected places. I don't know whether this is a bug in me or in Search::InvertedIndex.
perl v5.14.2 2011-09-25 Wiki::Toolkit::TestLib(3pm)