Li, Jialin wrote:
use strict;
my $string = 'field1,int,10#field2,string,abc';
my @values = split /#/,$string;
my @vars;
no strict 'refs';
for (@values) {
my @tmp = split /,/;
push @vars, $tmp[0];
${$tmp[0]} = $tmp[2];
}
for (@vars) {
print $_, ": ", ${$_},
Hi All,
I am trying to sort some data, which originally came as an excel file.
There are main titles, sub titles, sub sub titles and sub sub sub
titles. They defined by using different levels of indents in the
original file. I parse it and convert indents into spaces.
Main titles are sorted by f
Hello,
(snip)
I am trying to use the s/// operator to remove it, by doing this:
while()
{
$_ =~ s/\[*\]//;
$_ =~ s/\(*\)//;
print $_;
}
(snip)
The method used is incorrect.
$_ =~ s/\[*\]//; ---> This says that the search is for opening
parenthesis (zero or more occurre
Daniel McClory schreef:
> while()
>{
> $_ =~ s/\[*\]//;
> $_ =~ s/\(*\)//;
> print $_;
>}
while ( ) {
s/\[.*?\]//;
s/\(.*?\)//;
print;
}
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For addit
> -Original Message-
> From: Daniel McClory [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 22, 2008 16:06
> To: beginners@perl.org
> Subject: problem using backslash on brackets in regular expressions
>
> Hi,
>
> I have files which contain sentences, where some lines have extra
> inf
Hi,
I have files which contain sentences, where some lines have extra
information inside brackets and parentheses. I would like to delete
everything contained within brackets or parentheses, including the
brackets. I know that I am supposed to use the backslash to turn off
the metachara
use strict;
my $string = 'field1,int,10#field2,string,abc';
my @values = split /#/,$string;
my @vars;
no strict 'refs';
for (@values) {
my @tmp = split /,/;
push @vars, $tmp[0];
${$tmp[0]} = $tmp[2];
}
for (@vars) {
print $_, ": ", ${$_}, "\n";
}
__END__
Hi: I have a string with a number of variable name, type and value pairs. I
want to split the field and build my variables. Below is an example
$string = "field1,int,10#field2,string,abc";
@values = split(/#/,$string);
I want to get two variables from the string, equivalent to the below statemen
* [EMAIL PROTECTED] wrote:
>
> How to find out whether the string contains null values or empty data.
>
> For example : I have one scalar variable $str and now I want to check
> whether it contains any data or not.
>
> What I did : If ($str eq "NULL" || $str eq " "){ print $str conatins
> noth
use strict;
use warnings;
my @a = ( ['id', 'name', 'age'],
['1', 'Fred', '24'],
['2', 'Frank', '42'],);
my @b = ( ['id', 'sex'],
['1', 'm' ],
['2', 'm'],);
my %hash_id;
for my $i (1 .. $#b) {
$hash_id{ $b[$i][0] } = $i;
}
my @merged;
push @merged, ['id', 'name', '
Hi Guys,
I have a little complicated problem...
I have two arrays
@a = ( ['id', 'name', 'age'],
['1', 'Fred', '24'],
['2', 'Frank', '42'],
);
@b = ( ['id', 'sex'],
['1', 'm' ],
['2', 'm'],
);
I want to join these two AoA, based on i
Hi Guys,
I have a little complicated problem...
I have two arrays
@a = ( ['id', 'name', 'age'],
['1', 'Fred', '24'],
['2', 'Frank', '42'],
);
@b = ( ['id', 'sex'],
['1', 'm' ],
['2', 'm'],
);
I want to join these two AoA, based on i
On Wed, Apr 16, 2008 at 12:20 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote:
> Sharan Basappa wrote:
>
> > Gary Stainburn wrote:
> >
> > >
> > > On Monday 14 April 2008 16:35, Sharan Basappa wrote:
> > >
> > >
> > > > I am trying to capture the text between two tokens. These tokens
> > > > alway
perldoc -f defined should answer your question.
On Tue, Apr 22, 2008 at 1:39 PM, <[EMAIL PROTECTED]> wrote:
> Hi All,
>
>
>
> How to find out whether the string contains null values or empty data.
>
>
>
> For example : I have one scalar variable $str and now I want to check
> whether it contains
Hi All,
How to find out whether the string contains null values or empty data.
For example : I have one scalar variable $str and now I want to check
whether it contains any data or not.
What I did : If ($str eq "NULL" || $str eq " "){ print $str conatins
nothing\n";}
Is this correc
15 matches
Mail list logo