Ask a Question related to PERL Beginners, Design and Development.
-
Wolf Blaum #1
Re: String concatenation qn
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.Nothing I didnt do wrong at least a thousand times:> open NEWFH, "> $filename.new" or die "new procmailrc err";
> where $filename has /tmp/xyz
>
> Anything really silly here??
open NEWFH, "> $filename".".new" or die "new procmailrc err";
will do it.
------------
perldoc perlop:
Gory details of parsing quoted constructs
* * * *When presented with something that might have several dif-
* * * *ferent interpretations, Perl uses the DWIM (that's "Do
* * * *What I Mean") principle to pick the most probable inter-
* * * *pretation. *This strategy is so successful that Perl pro-
* * * *grammers often do not suspect 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
Wolf Blaum Guest
-
string concatenation
I want to be able to get that string #getAllCollection.itemTypeDescriptionEn# From those two strings... -
uninitialized string concatenation?
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... -
Use of uninitialized value in concatenation (.) or string at...
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... -
String Concatenation Bug
Can anyone think of a reason why this is happening? $b = xxx //<enormously long string with at least 100000 characters> $c = yyy //<shorter... -
String concatenation with .= <FH>
powell_luke@hotmail.com (Luke Powell) wrote: : I found that when I did this: : : $record .= <FH>; #replaces rather than appends to $record :... -
Wiggins D'Anconia #2
Re: String concatenation qn
wolf blaum wrote:
Not sure I see why adding a concatenation helped? The OP's code works> 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 really silly here??
>
> Nothing I didnt do wrong at least a thousand times:
>
> open NEWFH, "> $filename".".new" or die "new procmailrc err";
>
> will do it.
> ------------
> perldoc perlop:
> Gory details of parsing quoted constructs
>
> When presented with something that might have several dif-
> ferent interpretations, Perl uses the DWIM (that's "Do
> What I Mean") principle to pick the most probable inter-
> pretation. This strategy is so successful that Perl pro-
> grammers often do not suspect 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
>
>
fine in my 5.8.0 RH 9.0 install and the dot isn't significant within the
double quotes since it isn't a property or namespace token separator
like in other languages. Is this version dependent, or maybe UTF-8
related?
[url]http://danconia.org[/url]
Wiggins D'Anconia Guest
-
Ajey Kulkarni #3
String concatenation qn
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
Anything really silly here??
regards
-Ajey
Ajey Kulkarni Guest
-
Drieux #4
Re: String concatenation qn
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 has /tmp/xyz
>>
>> Anything really silly here??
> Nothing I didnt do wrong at least a thousand times:
>
> open NEWFH, "> $filename".".new" or die "new procmailrc err";
forgive me for being 'pedantic' but
given the sequence
foreach my $filename (@list_of_file_names)
{
open(NEWFH, "> ${filename}.new" ) or die "new $filename err:$!";
....
}
One has 'less ambiguity' using the curley braces around
the variable name so that it will KNOW without a doubt
that one really means that to be the variable should
suffice - It really becomes important when you want
to concatenate without things like a "." between tokens
foreach my $start (@entree) {
foreach my $phrase (@list_of_sillies) {
my $freak = "${start}Buzz${phrase}here";
rhetorical_devices($freak);
}
}
Drieux Guest
-
Ajey Kulkarni #5
Re: String concatenation qn
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 variable.> >> >> open NEWFH, "> $filename.new" or die "new procmailrc err";
> >> where $filename has /tmp/xyz
> >>
> >> Anything really silly here??
> > Nothing I didnt do wrong at least a thousand times:
> >
> > open NEWFH, "> $filename".".new" or die "new procmailrc err";
>
> forgive me for being 'pedantic' but
> given the sequence
>
> foreach my $filename (@list_of_file_names)
> {
> open(NEWFH, "> ${filename}.new" ) or die "new $filename err:$!";
> ....
>
> }
>
> One has 'less ambiguity' using the curley braces around
> the variable name so that it will KNOW without a doubt
> that one really means that to be the variable should
> suffice - It really becomes important when you want
> to concatenate without things like a "." between tokens
>
> foreach my $start (@entree) {
> foreach my $phrase (@list_of_sillies) {
> my $freak = "${start}Buzz${phrase}here";
> rhetorical_devices($freak);
> }
> }
>
>
> --
> To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
> For additional commands, e-mail: [email]beginners-help@perl.org[/email]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>Ajey Kulkarni Guest



Reply With Quote

