">>", "filename.txt");}
>> print $FH "$thing\n";
>> close $FH;
>>
>> A friendly page in the fine manual to read. A nudge towards a llama or
>> camel reference would be appreciated. Several days show my googlefu to
>> be lacking. W
le, which would report
print() on closed filehandle
but with the contents of $thing. The statement
print $FH "$thing\n"
will report
Use of uninitialized value $thing in concatenation (.) or string
if $thing is undefined.
Rob
---
This email is free from viruses and malwa
On Wed, Jan 15, 2014 at 12:09 AM, Matt McAdory wrote:
> Is there a method for determining the currently selected filehandle?
> should I always check for undef and open my filehandle before writing to it?
>
> use strict;
> use warnings;
> use autodie qw (:all);
>
> use My:CustomMod_with_FH_write;
Is there a method for determining the currently selected filehandle? should
I always check for undef and open my filehandle before writing to it?
use strict;
use warnings;
use autodie qw (:all);
use My:CustomMod_with_FH_write;
open (my $FH, ">", "filename.txt");
my $var = My:CustomMod_with_FH_w
On Sun, Jul 22, 2012 at 11:09:10PM +0200, Jenda Krynicky wrote:
> From: Paul Johnson
> > You need a mixture of the two approaches: map to prepend "not in:" and
> > join to join them.
> >
> > my $query = join " and ", map "not in:$_", @folders;
>
>
> @folders = ('one', 'two');
> my $query = "n
From: Paul Johnson
> You need a mixture of the two approaches: map to prepend "not in:" and
> join to join them.
>
> my $query = join " and ", map "not in:$_", @folders;
@folders = ('one', 'two');
my $query = "not in:" . join( " and not in:", @folders);
print $query;
will be quicker. no need
On 2012-07-19 12:37, punit jain wrote:
if( @folders ) {
map {$query .= "not in:$_ and"; } @folders;
print "\n $query \n";
}
'if' is not a function, so put a white space after it.
But in this case you don't need the 'if' at all.
Don't use map in void context.
Alternative code
Hi punit,
see below for my response.
On Thu, 19 Jul 2012 16:07:49 +0530
punit jain wrote:
> Hi ,
>
> I am doing a concat operation in Perl for a string like below : -
>
> if( @folders ) {
>
> map {$query .= "not in:$_ and"; } @folders;
> print "\n $query \n";
>
> }
1. "use str
On Thu, Jul 19, 2012 at 04:07:49PM +0530, punit jain wrote:
> Hi ,
>
> I am doing a concat operation in Perl for a string like below : -
>
> if( @folders ) {
>
> map {$query .= "not in:$_ and"; } @folders;
> print "\n $query \n";
>
> }
>
> @folders contain - Inbox, Sent
>
> Outpu
Hi ,
I am doing a concat operation in Perl for a string like below : -
if( @folders ) {
map {$query .= "not in:$_ and"; } @folders;
print "\n $query \n";
}
@folders contain - Inbox, Sent
Output from above is - *not in:Inbox and not in:Sent and*
Expected is = *not in:Inbox and not
Hello adit,
On Wed, 11 Apr 2012 20:03:28 -0700 (PDT)
adit edogawa wrote:
> hi,
> please help me ...
> I have a perl script as follows:
>
> #! / Usr / bin / perl-w
> # Use module
> use strict;
> use DBI;
>
Seems like your E-mail user-agent has seriously mangled your Perl code thinking
it is fr
',
'$ Address',
'$ Province',
'$ Kode_pos',
"$ MSISDN ',
'$ Email',
timothy adigun [2teezp...@gmail.com] wrote:
>#!/usr/bin/perl
>use warnings;
>use strict;
>
>my @wanted = qw( dad mum children);
>my @children = qw(tim dan mercy);
>my $ref = {
>dad => "mick",
>mum => "eliz",
>children => { first => 'tim', second => 'dan', third => 'merc
On 3/28/12 Wed Mar 28, 2012 10:02 AM, "timothy adigun"
<2teezp...@gmail.com> scribbled:
> Hi Chris,
>
> On Wed, Mar 28, 2012 at 12:02 PM, Chris Stinemetz
> wrote:
>
>>>
>> foreach my $cell ( @wanted ) {
>> print "$cell:";
>> foreach my $hr ( @hours ) {
>>
>foreach(keys %{$href-
Hi David,
On Wed, Mar 28, 2012 at 4:36 PM, Kronheim, David (Contr) <
david.kronh...@ftr.com> wrote:
> timothy adigun [2teezp...@gmail.com] wrote:
> >#!/usr/bin/perl
> >use warnings;
> >use strict;
> >
> >my @wanted = qw( dad mum children);
> >my @children = qw(tim dan mercy);
> >my $ref =
'01' => '1',
>'02' => '1',
> '03' => '1',
> },
>
> );
>
> my $href = \%data;
> my @wanted = qw(077 078 149);
> my @hours = qw(00 01 02 03 0
2012/3/28 Chris Stinemetz :
> I simply want to test to see if @hours exists as a second
> key in the hash of hashes %data.
> foreach my $cell ( @wanted ) {
> print "$cell:";
> foreach my $hr ( @hours ) {
> if ( defined keys %{ $href->{$hr}}){
if ( defined $href->{$cell}{$hr}){
> pri
1',
'01' => '1',
'02' => '1',
'03' => '1',
},
);
my $href = \%data;
my @wanted = qw(077 078 149);
my @hours = qw(00 01 02 03 04 05 06);
foreach
am getting the results I want with this iteration through the hash,
> but I am stump on clearing the following warnings:
>
> fyi line 12168 is the last line of the input file.
>
> Use of uninitialized value in concatenation (.) or string at
> ./TESTdeltaT1.pl line 54, <$SUM
At 11:05 PM -0500 3/27/12, Chris Stinemetz wrote:
Hello list,
I am getting the results I want with this iteration through the hash,
but I am stump on clearing the following warnings:
fyi line 12168 is the last line of the input file.
Use of uninitialized value in concatenation (.) or string
Hello list,
I am getting the results I want with this iteration through the hash,
but I am stump on clearing the following warnings:
fyi line 12168 is the last line of the input file.
Use of uninitialized value in concatenation (.) or string at
./TESTdeltaT1.pl line 54, <$SUM> line 1216
lina wrote:
On Sun, Feb 19, 2012 at 3:34 AM, Shawn H Corey wrote:
On 12-02-18 11:40 AM, lina wrote:
elsif ( $xpm_file =~ /^"(\S+)[",]$/) {
Are there some possibilities that something can be done for the part [",]?
Make it recognize both end with " or ",
elsif( $xmp_file =~ /^\"
On Sun, Feb 19, 2012 at 3:34 AM, Shawn H Corey wrote:
> On 12-02-18 11:40 AM, lina wrote:
>> elsif ( $xpm_file =~ /^"(\S+)[",]$/) {
>>
>> Are there some possibilities that something can be done for the part [",]?
>>
>> Make it recognize both end with " or ",
>
>
> elsif( $xmp_file
On 12-02-18 11:40 AM, lina wrote:
>> elsif ( $xpm_file =~ /^"(\S+)[",]$/) {
Are there some possibilities that something can be done for the part [",]?
Make it recognize both end with " or ",
elsif( $xmp_file =~ /^\"([A-Za-z]+)\"\,?$/ ){
my $keys = $1;
my @result = ();
for m
On 18 Feb, 2012, at 23:11, Shawn H Corey wrote:
> On 12-02-18 09:42 AM, lina wrote:
>> Hi,
>>
>> Sorry to open a new thread,
>>
>> Use of uninitialized value within %dict in concatenation (.) or string
>> at ./translate.pl line 21,<$fh> line 128
On 12-02-18 09:42 AM, lina wrote:
Hi,
Sorry to open a new thread,
Use of uninitialized value within %dict in concatenation (.) or string
at ./translate.pl line 21,<$fh> line 128.
Here is the whole code (based on the guide form all of you):
#!/usr/bin/perl
use warnings;
use stric
Hi,
Sorry to open a new thread,
Use of uninitialized value within %dict in concatenation (.) or string
at ./translate.pl line 21, <$fh> line 128.
Here is the whole code (based on the guide form all of you):
#!/usr/bin/perl
use warnings;
use strict;
my $file = "dm_proAB.xpm&quo
er loop above.
Ken
> print $MAP "$up_ac\t$kegg_map{$up_ac}\n";
#-- line 441.
> }
> close $MAP;
> }
>
> I get the following error message:
> Use of uninitialized value in concatenation (.) or string at pipeline.pl
27;>', $kegg_tax_map_path or croak "Failed to
open for writing $kegg_tax_map_path: $!";
print $MAP "$up_ac\t$kegg_map{$up_ac}\n";
#-- line 441.
}
close $MAP;
}
I get the following error message:
Use of uninitial
Thank you,
the following worked:
{
no warnings qw(uninitialized);
...
}
- Original Message -
From: Jim Gibson
To: perl list
Cc:
Sent: Monday, January 9, 2012 1:14 PM
Subject: Re: supressing error message Use of uninitialized value in
concatenation
On 1/9/12 Mon Jan 9, 2012
On 1/9/12 Mon Jan 9, 2012 10:53 AM, "Rajeev Prasad"
scribbled:
> Hello,
>
> I have a lot of fields being concatenated to form a string and sometimes the
> values are empty, so i am getting this error:
>
> Use of uninitialized value in concatenation (.) or stri
Hello,
I have a lot of fields being concatenated to form a string and sometimes the
values are empty, so i am getting this error:
Use of uninitialized value in concatenation (.) or string at ./script.pl line
144, <$IN_FH> line 1.
how can i suppress this?
my logic flow:
$string1 = &q
On Sat, Dec 17, 2011 at 08:22:31AM +, vishnu.kuma...@wipro.com wrote:
> Hi,
Hello:
> I am trying to convert the string abc.def.ghi.amm to
> abcdefghiamm using split and concatenation. I am missing
> something somewhere.. please help me to fix the code
>
> my $string
Thanks guys for your suggestion
-Original Message-
From: Shlomi Fish [mailto:shlo...@shlomifish.org]
Sent: Saturday, December 17, 2011 2:48 PM
To: vishnu.kuma...@wipro.com
Cc: beginners@perl.org
Subject: Re: Split and concatenation
Hi Vishnu,
On Sat, 17 Dec 2011 08:22:31 +
On 2011-12-17 09:20, T D, Vishnu wrote:
I am trying to convert the string abc.def.ghi.amm to abcdefghiamm
$string =~ s/\.+//g
using split and concatenation.
join "", split /\.+/, $string
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additiona
Hi,
I am trying to convert the string abc.def.ghi.amm to abcdefghiamm using split
and concatenation. I am missing something somewhere.. please help me to fix the
code
my $string = "abc.def.ghi.amm";
my @d = split(/\./,"$string");
my $e = @d;
for (my $i=0; $i < $e; $i++
vishnu.kuma...@wipro.com wrote:
Hi,
Hello,
I am trying to convert the string abc.def.ghi.amm to abcdefghiamm
using split and concatenation. I am missing something somewhere.
. please help me to fix the code
my $string = "abc.def.ghi.amm";
my @d = split(/\./,"$string");
Hi Vishnu,
On Sat, 17 Dec 2011 08:22:31 +
wrote:
> Hi,
>
> I am trying to convert the string abc.def.ghi.amm to abcdefghiamm using split
> and concatenation. I am missing something somewhere.. please help me to fix
> the code
>
> my $string = "abc.def.gh
Hi,
I am trying to convert the string abc.def.ghi.amm to abcdefghiamm using split
and concatenation. I am missing something somewhere.. please help me to fix the
code
my $string = "abc.def.ghi.amm";
my @d = split(/\./,"$string");
my $e = @d;
for (my $i=0; $i < $e; $i++
On 6/8/11 Wed Jun 8, 2011 5:33 PM, "Sayth Renshaw"
scribbled:
>> That looks fine, but Perl is trying to interpolate $mynames (which
>> hasn't been initalised) into the string instead of indexing an element
>> of @mynames.
>>
>> You may be running an old perl. Please check your version with
>>
> That looks fine, but Perl is trying to interpolate $mynames (which
> hasn't been initalised) into the string instead of indexing an element
> of @mynames.
>
> You may be running an old perl. Please check your version with
>
> perl -v
I have 5.12.3 on this PC, The strawberry perl release.
>
> a
Use of uninitialized value $mynames in concatenation (.) or string at ch3_2.pl l
ine 11, line 1.
[ 2 -1 ]
C:\MyPerl>
Any idea where it comes from?
Hello Sayth
The program you have published seems to work fine. Are you certain that
the print line inside the foreach loop is as you say?
Rob
--
T
Use of uninitialized value $mynames in concatenation (.) or string at ch3_2.pl l
ine 11, line 1.
[ 2 -1 ]
C:\MyPerl>
Any idea where it comes from?
That looks fine, but Perl is trying to interpolate $mynames (which
hasn't been initalised) into the string instead of indexing an element
of @my
> Hello Sayth
>
> The program you have published seems to work fine. Are you certain that
> the print line inside the foreach loop is as you say?
>
> Rob
>
This is copied direct from my editor.
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my @mynames = qw/fred betty barney dino wi
rney dino wilma pebbles bamm-bamm/;
print " Enter a number from 1 to 7: ";
chomp(my @nums = );
foreach (@nums) {
print "$mynames[ $_ - 1 ]\n";
}
The error:
C:\MyPerl>perl ch3_2.pl
Enter a number from 1 to 7: 2
^Z
Use of uninitialized value $mynames in concatenat
Message-
> From: CM Analyst [mailto:cmanal...@yahoo.com]
> Sent: Thursday, January 27, 2011 6:25 PM
> To: Parag Kalra
> Cc: beginners@perl.org
> Subject: Re: Need help with Use of uninitialized value in concatenation
> (.) or string
>
> This is a sample of the data I a
-84f9e0f6609e;|]
com.raec.cq.CQCommitException: You wanted to commit a modifyCR based record,
but the record was
not found in the ClearQuest Database.
--- On Thu, 1/27/11, Parag Kalra wrote:
From: Parag Kalra
Subject: Re: Need help with Use of uninitialized value in concatenation (.) or
string
To: &qu
ull the date value each time an error
> value (hardcoded) is found in the specified log file. The script retrieves
> the error value without a problem but I cannot seem get the date value. Can
> anyone tell me what I need to do?
>
> The error message when I run the script is:
>
> Us
Can you send an example of the data in the log file?
tm
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
run the script is:
Use of uninitialized value in concatenation (.) or string at script.pl line 32
where line 32 is where I am calling this:
"print $date";
Here is the script:
use warnings;
use strict;
#Specify the path to the log file you want to read, for ex. application log#
open (
On Oct 14, 6:41 am, [EMAIL PROTECTED] (Protoplasm) wrote:
> I'm attempting to write some code using the Config::INI::Simple
> module. When I run the app I get the following:
>
> Use of uninitialized value in concatenation (.) or string at ./open-
> file2.pl line 35.
> Use of
protoplasm wrote:
> I'm attempting to write some code using the Config::INI::Simple
> module. When I run the app I get the following:
>
> Use of uninitialized value in concatenation (.) or string at ./open-
> file2.pl line 35.
> Use of uninitialized value in concatenation
I'm attempting to write some code using the Config::INI::Simple
module. When I run the app I get the following:
Use of uninitialized value in concatenation (.) or string at ./open-
file2.pl line 35.
Use of uninitialized value in concatenation (.) or string at ./open-
file2.pl line 36.
U
luke devon <[EMAIL PROTECTED]> asked:
> Following error i am getting while its functioning. Could you
> please help me to find out what the error is ?
>
> Use of uninitialized value in concatenation (.) or string at
> /xxx.pl line 18, line 1.
> Use of uninitialize
Dear Friends,
Following error i am getting while its functioning. Could you please help me to
find out what the error is ?
Use of uninitialized value in concatenation (.) or string at /xxx.pl line 18,
line 1.
Use of uninitialized value in concatenation (.) or string at /xxx.pl line 21
On Feb 12, 2008 5:51 AM, Rajpreet <[EMAIL PROTECTED]> wrote:
> Greetings,
>
> I am trying to append an alphabetical counter to a string. But
> concatenation shows a very strange behaviour in this case. Can some
> one please help?
>
> The piece of code looks like :
>
Greetings,
I am trying to append an alphabetical counter to a string. But
concatenation shows a very strange behaviour in this case. Can some
one please help?
The piece of code looks like :
$self->{"log"}->debug(" In Function _process_array_data. ");
$self->{&
Sayed, Irfan (Irfan) am Montag, 12. Februar 2007 17:05:
> Hi All,
>
> I need to concatenate specific string for each element in the array. I
> tried in the following way with the help of join operator.
Hi Irfan,
you already got hints about the error and the two famous 'use' lines that make
life
one option:
@mail= ("here","there","everywhere");
foreach $Mine (@mail)
{
$str1=$Mine . '@cbc.com';
print "$str1\n";
}
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
-
sg
Sayed, Irfan (Irfan) wrote:
Hi All,
I need to concatenate specific string for each element in the array. I
tri
On 2/12/07, Sayed, Irfan (Irfan) <[EMAIL PROTECTED]> wrote:
Hi All,
I need to concatenate specific string for each element in the array. I
tried in the following way with the help of join operator.
foreach (@mail)
{
my $str1=$_;
$str1=$str1 . "@abc.com";
"@abc.com" is an interpolating strin
>foreach (@mail)
>{
> my $str1=$_;
> $str1=$str1 . "@abc.com";
> print "$str1\n";
>
>}
>
>But somehow it is not getting concateneted.
>
Hi,
replace:
$str1=$str1 . "@abc.com";
to:
$str1 .= '@abc.com';
I think that would work.
In your case,"@abc.com" has been parsed by Perl as an array.
Hi All,
I need to concatenate specific string for each element in the array. I
tried in the following way with the help of join operator.
foreach (@mail)
{
my $str1=$_;
$str1=$str1 . "@abc.com";
print "$str1\n";
}
But somehow it is not getting concateneted.
please help.
Regards
Irfan
On Sep 12, ganesh said:
This is the warning messge I am getting when I executed my script.
Please find my analysis of the above warning
Input:
Line 1: 20(1): 125-126
Line 2: 20:125-126
Output:
Line 1: 20(1): 125-126
Line 2: 20:125-126
My Code:
$line=~s!(\d+)(\(\d+\))?:(\d+)-!$1$2:$3-!
Dear All,
This is the warning messge I am getting when I executed my script.
Please find my analysis of the above warning
Input:
Line 1: 20(1): 125-126
Line 2: 20:125-126
Output:
Line 1: 20(1): 125-126
Line 2: 20:125-126
My Code:
$line=~s!(\d+)(\(\d+\))?:(\d+)-!$1$2:$3-!g;
Both the l
Thanks a ton to all.
On Sat, 24 Jan 2004, drieux wrote:
>
> On Jan 23, 2004, at 5:24 PM, wolf blaum wrote:
>
> > For Quality purpouses, Ajey Kulkarni 's mail on Saturday 24 January
> > 2004 17:52
> > may have been monitored or recorded as:
> >
> >> i would like to quickly append a string to a
On Jan 23, 2004, at 5:24 PM, wolf blaum wrote:
For Quality purpouses, Ajey Kulkarni 's mail on Saturday 24 January
2004 17:52
may have been monitored or recorded as:
i would like to quickly append a string to a variable.
open NEWFH, "> $filename.new" or die "new procmailrc err";
where $filename
ct the ambivalence of what they
write. But from time to time, Perl's notions differ sub-
stantially from what the author honestly meant.
-----
This is one of the latter cases.
Wolf
Not sure I see why adding a concatenation helped? The OP's code works
fine in my 5.8.0 R
For Quality purpouses, Ajey Kulkarni 's mail on Saturday 24 January 2004 17:52
may have been monitored or recorded as:
> hi,.
hi
> i would like to quickly append a string to a variable.
> open NEWFH, "> $filename.new" or die "new procmailrc err";
> where $filename has /tmp/xyz
>
> Anything reall
hi,.
i would like to quickly append a string to a variable.
Suppose $filename has "/tmp/xyz after appending i want to
get $filename as /tmp/xyz.NEW.
I'm getting a ? for a . (period).
I'm doing something like
open NEWFH, "> $filename.new" or die "new procmailrc err";
where $filename has /tmp/xyz
ble declared
> within the block disappears from view after it finishes.
Hi Joseph.
I agree wholeheartedly. Perl is already very flexible in the
DWIM department: it will allow both text concatenation and
arithmetic increment on an undefined value. I have always
been grateful for the, 'Are yo
Richard Heintze wrote:
> > I think what you want is this:
> >
> > no warnings qw(uninitialized);
> >
>
> Would I put this immediately after "use warnings;"?
I would recommend against it, unless you are intending to
keep all your programs very small. Any change to basic
browser/interpreter functi
k = $q->param('xyz');
> > print qq[ \$k = $k ];
> >
> > The problem is that if there is no GET/POST param
> > called xyz, we are concatenating with a null value
> > Is there a way I can suppress only concatenation
> > warnings? I did perldoc strict
warning text gets inserted into the HTML
> output (which is a BIG problem if you are in the
> middle of emitting javascript code).
>
> Is there a way I can suppress only concatenation
> warnings? I did perldoc strict and perldoc warnings
> and could not determine if the supres
Yes. If you do it right after "use warnings;", then it will be in
effect for the rest of your script.
-Original Message-
From: Richard Heintze [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 4:15 PM
To: [EMAIL PROTECTED]
Subject: RE: Surpressing concatenation
> I think what you want is this:
>
> no warnings qw(uninitialized);
>
Would I put this immediately after "use warnings;"?
__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree
--
To unsubscribe, e-mail: [EM
I think what you want is this:
no warnings qw(uninitialized);
Which should suppress only the warnings about an uninitialized value in
string or concatenation messages.
-Original Message-
From: Richard Heintze [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 10:24 AM
To
vascript code).
Is there a way I can suppress only concatenation
warnings? I did perldoc strict and perldoc warnings
and could not determine if the supression I want is
possible.
Thanks,
Sieg
__
Do you Yahoo!?
Protect your identity with Yahoo! Mail Addre
'Use of uninitialized value in concatenation (.) or
string at
logs.cgi line 113'. Line 113 is the line marked below.
I've played around with your code a little and here's what I've found.
The error is in the print() call, so the answer to your question of
what's go
Ok, this has me bewildered. I have added some fields to a pipe-delimited
file and added the keys to the switch to chomp each line correctly. I am
using the same lines of code that I had before, but now when I run the
script I get 'Use of uninitialized value in concatenation (.) or stri
At 20:13 06/09/2003, Devon Young wrote:
What does this mean?? I'm thoroughly puzzled and I've been scouring the
net for an answer. I've been assuming it means I'm not putting strings
together correctly, but I can't figure out how to fix it. Here's the
errors I'm getting, followed by the peice of
t; <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Saturday, September 06, 2003 2:13 PM
Subject: Use of uninitialized value in concatenation (.) or string at...
> What does this mean?? I'm thoroughly puzzled and I've b
Please do not cross-post. I know already that I am going to be burned with at least
two failure notices by responding to your post before checking for rudeness. Since I
am not subscribed to either of the other lists you *spammed*, my replies will be
returned with either failure or
"Awaiting ap
t;
>
> Use of uninitialized value in substitution (s///) at
> C:\perl_stuff\artists.pl line 120.
> Use of uninitialized value in concatenation (.) or string at
> C:\perl_stuff\artists.pl line 122.
> Use of uninitialized value in concatenation (.) or string at
> C:\perl_stuff\
e errors I'm
> getting, followed by the peice of code that the error is apparently in. I
> can't see what's wrong though. The code looks fine to me...
>
> Use of uninitialized value in substitution (s///) at
> C:\perl_stuff\artists.pl line 120.
> Use of uninitialized
ode that the error is apparently in. I
can't see what's wrong though. The code looks fine to me...
Use of uninitialized value in substitution (s///) at
C:\perl_stuff\artists.pl line 120.
Use of uninitialized value in concatenation (.) or string at
C:\perl_stuff\artists.pl line 122.
Use o
cond sees it in list
> context, but if so I don't understand why. Can someone break it down
> what the concatenation operator is doing here?
You nailed it; it's a context problem. C evaluates its
arguments in list context, but C<.> evaluates ITS arguments in scalar
context, and
AIL PROTECTED]
Sent: Tuesday, June 24, 2003 6:13 AM
To: [EMAIL PROTECTED]
Subject: context, printing, and concatenation
I'm on the first few chapters of "Learning Perl" and came up with a question. Given:
-
@array = qw ( one two three )
quot;3" (and a carriage return)
while the second prints "onetwothree"? I'm guessing that the first
print sees the array in scalar context while the second sees it in list
context, but if so I don't understand why. Can someone break it down
what the concatenation operat
scalar context while the second sees
>it in list context, but if so I don't understand why. Can someone break
>it down what the concatenation operator is doing here?
The concatenation operator joins two SCALARS together. That means that
its two arguments will be evaluated in scalar c
ees
> it in list context, but if so I don't understand why. Can someone break
> it down what the concatenation operator is doing here?
Your understanding is correct. Concatenation works on scalars, so the
array is evaluated in scalar context, returning 3, which is concatenated
with &
the first print statement prints "3" (and a carriage
return) while the second prints "onetwothree"? My understanding is that
the first print sees the array in scalar context while the second sees
it in list context, but if so I don't understand why. Can someone break
it
From: "Miguel Angel Morales" <[EMAIL PROTECTED]>
> Thank you very much Jenda, I used the code
>
> > $hex = unpack('H*', $servidor);
> > $hex =~ s/(..)/$1 /g;
> > print $hex;
>
> you send me and at the end of the register appears the 0D 0A hex
> characters, so this should be the problem. How can I
able?
Thanks again,
Miguel Angel
- Original Message -
From: "Jenda Krynicky" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 19, 2003 1:10 PM
Subject: Re: string concatenation
> From: "Miguel Angel Morales" <[EMAIL PROTECTED]>
> >
From: "Miguel Angel Morales" <[EMAIL PROTECTED]>
> Hi All! I have a problem concatenating strings and I will be very
> grateful if you could help me because I'm going crazy:
>
> I'm using the telnet library for connecting to a router and executing
> the following command:
>
> $t->cmd("ip $nombre
Hi All! I have a problem concatenating strings and I will be very grateful
if you could help me because I'm going crazy:
I'm using the telnet library for connecting to a router and executing the
following command:
$t->cmd("ip $nombre $servidor -prefix_len 126 -destination_ip_address
$cliente -con
"Albert L. Lukaszewski" wrote:
>
> At the earlier suggestion of Rob Dixon (rob[at]dixon.nildram.co.uk), I
> here present a sample of the data I am trying to convert, the output I
> desire, and the program as I have written it thus far.
>
> I am using "4Q246.db" as a sample of the larger file. In
Hi Al
OK I'm being lazy again, this time partly because you are in a hurry. The
following code works with your dataset. You were badly misunderstanding
arrays - I've taken out all of them!
Let me know if you need anything explaining.
Cheers, and good luck.
Rob
#!/usr/bin/perl
#
At the earlier suggestion of Rob Dixon (rob[at]dixon.nildram.co.uk), I
here present a sample of the data I am trying to convert, the output I
desire, and the program as I have written it thus far.
I am using "4Q246.db" as a sample of the larger file. In between each
text, I want it to add three C
>From: "james poni" <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Concatenating , the final time
>Date: Mon, 29 Apr 2002 11:57:18 +1000
>
>
>
>Hello again (final time)
>
>I also want to sort the (number time) field when we have the same day
>eg:
>
>below:
>ccc gamma sun 3:00
>aaa aplha
On Fri, 2002-04-26 at 14:51, Jason Frisvold wrote:
> Hrm.. I'll run some tests with it and see what I find out... Sounds
> promising if it really is a preprocessor... So does it just do
> something along the lines of a cat | grep -v and then
> execute the output? (I realize that is simplifyi
1 - 100 of 143 matches
Mail list logo