okay, down below is the script. i have 32 words put into 32 variables and i want perl to print all those 32 variables into one text document, each word under another in the text file. the text files called times.txt Sorry about the length of the script
print " VToshiba ... (2 Replies)
have a simple text file as input.i have to print that file in paragraph format.whenevr it finds "\n" in the input text it should start printing in next paragraph in output file.also a fixed amount of space should be given before start writing in every paragraph.
the input and output file format... (5 Replies)
Hi,
I have a file of names and I want perl to do a sort on this file. How can I sort this list of names using perl? I'm thinking of a command like:
@sorted = sort { lc($a) cmp lc($b) } @not_sorted # alphabetical sort
The only thing I'm sort of unsure of is, how would I get the name in my... (6 Replies)
Hi,
I have a simple question:
I need to enter some text in a text file at a certain place via perl.
I would first need to find that specific text in the file and then I would like to insert a line after that particular line.
Say I have this text file:
I am a great Perl Programmer
I... (1 Reply)
Hi all
I have written Perl script to swap the strings in the second a third column from a text file.
My input file format is :
the|empty|the|det lake|empty|lake|conj_and was|empty|was|auxpass drained|empty|drained|conj_and birds|empty|bird|s|nn
The expected output file format is... (11 Replies)
I have two text file....
One text file contain in this format......
keyvalue.txt \SUM\SUM_cam.c
\SUM\SUM_cam.h
\SUM\SUM_command.c
\SUM\SUM_command.h
\SUM\SUM_dab.c
\SUM\SUM_dmb.c
\SUM\SUM_eventHandler.h
\SUM\SUM_eventHandler_dab.c
\SUM\SUM_eventHandler_dmb.c ... (6 Replies)
Hi Experts,
I have this requirement to process large files (200MB+).Format of files is like:
recordstart
val1 1
val2 2
val3 4
recordstart
val1 5
val2 6
val3 1
val4 1
recordstart
val1 ... (4 Replies)
Hi,
I am quite new to Perl scripting and i need to create a .TXT file using perl, with fields (A,B,C,D,E), and this text file should be named with current file creation date "XYZ_CCYYMMDD.TXT" (i.e.XYZ_2011042514:33 PM).
Can anyone who has done this, please share their expertise on this... (5 Replies)
Discussion started by: msrahman
5 Replies
LEARN ABOUT CENTOS
dbix::simple::comparison
DBIx::Simple::Comparison(3) User Contributed Perl Documentation DBIx::Simple::Comparison(3)NAME
DBIx::Simple::Comparison - DBIx::Simple in DBI jargon
DESCRIPTION
This is just a simple and inaccurate overview of what DBI things the DBIx::Simple things represent, or the other way around.
This document can be useful to find the foo equivalent of bar.
"?" means that DBI doesn't have an equivalent or that I couldn't find one.
"=" means that DBIx::Simple provides a direct wrapper to the DBI function.
"~" means that DBIx::Simple's method does more or less the same, but usually in a more high level way: context sensitive, combining things,
automatically taking care of something.
Note that DBIx::Simple is a wrapper around DBI. It is not "better" than DBI. In fact, DBIx::Simple cannot work without DBI.
Using DBI directly is always faster than using DBIx::Simple's equivalents. (For the computer, that is. For you, DBIx::Simple is supposed to
be faster.)
Classes, common names
use DBI ~ use DBIx::Simple
$DBI::errstr = DBIx::Simple->error
DBI::db ~ DBIx::Simple
$dbh ~ $db
$dbh->errstr = $db->error
connect ~ connect
connect ~ new
DBI::st ~ DBIx::Simple::Result
<undef> ~ DBIx::Simple::Dummy
$sth ~ $result
Queries
DBI
my $sth = $dbh->prepare_cached($query);
$sth->execute(@values);
~ DBIx::Simple
my $result = $db->query($query, $values);
Results
DBI DBIx::Simple
bind_columns ~ bind
fetchrow_arrayref/fetch = fetch
fetchrow_array ~ list
*1 ~ flat
[@{fetchrow_arrayref}] = array
fetchall_arrayref ~ arrays
fetchrow_hashref() *2*3 = hash
fetchall_arrayref({}) *4 ~ hashes
fetchall_hashref *2 = map_hashes
? ? map_arrays
fetchall_hashref(1) *2 = map
$sth->{NAME_lc/NAME} = $result->columns
*1 There's no fetch variant, but you can do "{ @{ $dbh->selectcol_arrayref('SELECT ...', { Slice => [] }) } }".
*2 To receive the keys (column names) lowercased, use "$db->{FetchHashKeyName} = 'NAME_lc'". DBIx::Simple lower cases them by default.
*3 Or supply an argument, 'NAME_lc'.
*4 No, arrayref isn't a typo. When supplied an empty hash reference, DBI's fetchall_arrayref actually returns hashrefs. This DBI method
does not support lower casing of keys, DBIx::Simple does.
Direct access
DBI DBIx::Simple
$dbh = $db->dbh
$sth->{$foo} = $result->attr($foo)
func = func
begin_work = begin_work
commit = commit
rollback = rollback
last_insert_id = last_insert_id
rows = rows
disconnect ~ disconnect
finish ~ finish
DBIx::Simple specific (?)
keep_statements
lc_columns
iquery (via SQL::Interp)
select, insert, update, delete (via SQL::Abstract)
abstract (via SQL::Abstract)
flat
hashes
map_arrays
map
AUTHOR
Juerd Waalboer <juerd@cpan.org> <http://juerd.nl/>
SEE ALSO
DBI, DBIx::Simple
perl v5.16.3 2010-12-03 DBIx::Simple::Comparison(3)