Viking has asked for the wisdom of the Perl Monks concerning the following question:
When I run this I get from the print statement:for my $key (keys %logins) { my $response = get("http://www.dtdns.net/autodns.cfm?id=$key&p +w=$logins{$key}&ip=$ip"); print "$key: [$response]\n"; }
So I decided to strip the \n out of $response so that it was all on one line:key1: [ The Response from key1] key2: [ The Response from key2]
Now I get this:for my $key (keys %logins) { my $response = get("http://www.dtdns.net/autodns.cfm?id=$key&p +w=$logins{$key}&ip=$ip"); $response =~ s/\n//g; print "$key: [$response]\n"; }
So why do I lose the "key: [" part now that I strip the \n characters?The Response from key1] The Response from key2]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: print not behaving as expected
by merlyn (Sage) on Jan 02, 2001 at 06:59 UTC | |
by Viking (Beadle) on Jan 02, 2001 at 07:09 UTC | |
by merlyn (Sage) on Jan 02, 2001 at 08:02 UTC | |
by runrig (Abbot) on Jan 02, 2001 at 08:03 UTC |