07-01-2009
Even though you start adding to the array at index 1, perl inserts index 0 before index 1.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi
this is an example of code:
use strict;
use warnings;
open FILE, "/tmp/result_2";
my $regex="\\ Starting program ver. (.*)";
my $res="Program started, version <$1> - OK.\n";
while (<FILE>) {
if ($_ =~ /($regex)/) {
print "$res";
}
}
close FILE;
This finds $regex and print... (3 Replies)
Discussion started by: xist
3 Replies
2. Shell Programming and Scripting
Anyone know how to get the data out of the "who" command?
I'm still in lukewarm pursuit of creating an OS X-like welcome message at the start of any Terminal session, sans having to use either bash login or calling up ssh.
My trials & errors and surfing around have narrowed it down for me... (1 Reply)
Discussion started by: SilversleevesX
1 Replies
3. Shell Programming and Scripting
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)
Discussion started by: jimmy_y
0 Replies
4. Shell Programming and Scripting
I am trying to find a way to utilise the full potential of my cpu cores and memory on my windows machine.
Now, I am quite familiar with grep, however, running a Unix based OS is not an option right now.
Unfortunately, the 32 bit grep for windows that I am running, I cannot run multiple... (1 Reply)
Discussion started by: Moloch
1 Replies
5. Shell Programming and Scripting
Hi,
I am having an conf file like this:
<Main>
<NODE>
<NODENAME>FRUITS</NODENAME>
<NAME>APPLE</NAME>
<COLOUR>RED</COLOUR>
<NODE>
<IsWrapper/>
<NODENAME>SEASONAL</NODENAME>
<NODE>
<NAME>MANGO</NAME>
<COLOUR>GREEN</COLOUR>
</NODE>
</NODE>... (4 Replies)
Discussion started by: vanitham
4 Replies
6. Shell Programming and Scripting
Hi! I've a C program as shown below..
The line numbers and the statements of the program are separated by a space..
1 #include<stdio.h>
2 char a,b,c;
3 float x,y,z;
4 int main()
5 {
6 int d,e,f;
7 // further declarations
8 // further declarations
9 /* body*/
10 }
11 void fun1()
12... (1 Reply)
Discussion started by: abk07
1 Replies
7. Shell Programming and Scripting
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)
Discussion started by: irudayaraj
2 Replies
8. UNIX for Dummies Questions & Answers
I feel that i am missing something obvious but i can't find what is wrong.
I have a script that is launching some functions with "&" and each call is feeding the array with a value. When all calls are finished I just want to retrieve the values of that array.
It is looking like that :
... (5 Replies)
Discussion started by: bibou25
5 Replies
9. Shell Programming and Scripting
Hi all,
a question for the Perl knowledgeable:
I have use warnings; enabled.
I use something like:
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
In the further code I only work with some of the returned variables, as the others I have no need for.
Though the... (1 Reply)
Discussion started by: zaxxon
1 Replies
10. Programming
I have reviewed many examples on-line about running another process (either PERL or shell command or a program), but do not find any usefull for my needs way. (Reviewed and not useful the system(), 'back ticks', exec() and open())
I would like to run another PERL-script from first one, not... (1 Reply)
Discussion started by: alex_5161
1 Replies
LEARN ABOUT DEBIAN
sql::translator::schema::index
SQL::Translator::Schema::Index(3pm) User Contributed Perl Documentation SQL::Translator::Schema::Index(3pm)
NAME
SQL::Translator::Schema::Index - SQL::Translator index object
SYNOPSIS
use SQL::Translator::Schema::Index;
my $index = SQL::Translator::Schema::Index->new(
name => 'foo',
fields => [ id ],
type => 'unique',
);
DESCRIPTION
"SQL::Translator::Schema::Index" is the index object.
Primary and unique keys are table constraints, not indices.
METHODS
new
Object constructor.
my $schema = SQL::Translator::Schema::Index->new;
fields
Gets and set the fields the index is on. Accepts a string, list or arrayref; returns an array or array reference. Will unique the field
names and keep them in order by the first occurrence of a field name.
$index->fields('id');
$index->fields('id', 'name');
$index->fields( 'id, name' );
$index->fields( [ 'id', 'name' ] );
$index->fields( qw[ id name ] );
my @fields = $index->fields;
is_valid
Determine whether the index is valid or not.
my $ok = $index->is_valid;
name
Get or set the index's name.
my $name = $index->name('foo');
options
Get or set the index's options (e.g., "using" or "where" for PG). Returns an array or array reference.
my @options = $index->options;
table
Get or set the index's table object.
my $table = $index->table;
type
Get or set the index's type.
my $type = $index->type('unique');
Get or set the index's type.
Currently there are only four acceptable types: UNIQUE, NORMAL, FULL_TEXT, and SPATIAL. The latter two might be MySQL-specific. While both
lowercase and uppercase types are acceptable input, this method returns the type in uppercase.
equals
Determines if this index is the same as another
my $isIdentical = $index1->equals( $index2 );
AUTHOR
Ken Youens-Clark <kclark@cpan.org>.
perl v5.14.2 2012-01-18 SQL::Translator::Schema::Index(3pm)