Hello,
I am trying to output the values in an array to a file. The output needs to be formated such that each array value is left jusified in a field 8 character spaces long. Also, no more than 6 fields on a line. For example:
@array= 1..14;
Needs to be output to the file like so:
1 ... (4 Replies)
Hello everybody, I'm new in this forum.
I searched a long time for a solution for my problem but I didn't find the right thing.
I have to read from a file (content is "abngjm" without any other signs) and have to write this content in an array. But every sign has to be called by its own... (5 Replies)
Hi,
Is there any way I can grep an array against another array?
Basically here's what I need to do.
There will be an array containing some fixed texts and I have to check whether some files contain these lines. Reading the same files over and over again for each different pattern doesnt seem... (1 Reply)
Hi Everyone,
#!/usr/bin/perl
use strict;
use warnings;
my @test=("a;b;qqq;c;d","a;b;ggg;c;d","a;b;qqq;c;d");
would like to split the @test array into two array:
@test1=(("a;b;qqq;c;d","a;b;qqq;c;d"); and @test2=("a;b;ggg;c;d");
means search for 3rd filed.
Thanks
find the... (0 Replies)
Iam trying to load the full path of multiplie files in the same directory to an array if the filenames matches a pattern. The following is the current code;
where $input=C:\test
# change to and open the comparison directory
chdir("$input2") || die "Cannot change dir: $!";
opendir(DIR2,... (2 Replies)
I have an array and two variables as below,
I need to check if $datevar is present in $filename.
If so, i need to replace $filename with the values in the array.
I need the output inside an ARRAY
How can this be done.
Any help will be appreciated. Thanks in advance. (2 Replies)
Hello Guru's
I want to read an array into a flatfile
Please let me know how to do the same
So far this the below code
use strict;
use warnings;
open (my $data , '<', $ARGV)|| die "could not open $ARGV:\n$!";
my @array=(<$data>);
my @sorted=sort... (8 Replies)
I wrote a simply perl that searched a file for a particualr value and if it found it, rite it and the next three lines to a file. Now I have been asked to check those next three lines for a different value and only write those lines if it finds the second value.
I was thinking the best way to... (1 Reply)
ok, so here is the issue, I have 2 arrays.
I need to be able to create a loop that will find ${ARRAY1 in the text doc, and replace it with ${ARRAY2 then write the results. I already have that working. The problem is, I need it to do that same result across however many items are in the 2... (2 Replies)
Discussion started by: gentlefury
2 Replies
LEARN ABOUT DEBIAN
log::dispatch::array
Log::Dispatch::Array(3pm) User Contributed Perl Documentation Log::Dispatch::Array(3pm)NAME
Log::Dispatch::Array - log events to an array (reference)
VERSION
version 1.001
SYNOPSIS
use Log::Dispatch;
use Log::Dispatch::Array;
my $log = Log::Dispatch->new;
my $target = [];
$log->add(Log::Dispatch::Array->new(
name => 'text_table',
min_level => 'debug',
array => $target,
));
$log->warn($_) for @events;
# now $target refers to an array of events
DESCRIPTION
This provides a Log::Dispatch log output system that appends logged events to an array reference. This is probably only useful for testing
the logging of your code.
METHODS
"new"
my $table_log = Log::Dispatch::Array->new(\%arg);
This method constructs a new Log::Dispatch::Array output object. Valid arguments are:
array - a reference to an array to append to; defaults to an attr on
$table_log
array
This method returns a reference to the array to which logging is being performed.
log_message
This is the method which performs the actual logging, as detailed by Log::Dispatch::Output.
AUTHOR
Ricardo Signes, "<rjbs@cpan.org>"
BUGS
Please report any bugs or feature requests through the web interface at <http://rt.cpan.org>. I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.
COPYRIGHT
Copyright 2008 Ricardo SIGNES, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2008-04-29 Log::Dispatch::Array(3pm)