[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

[perl] <stdin> giver newline



Hej

Kan det passe, at når man tildeler input fra <stdin> til en variabel, så bliver der appendet et linjeskift til slut? Alternativt, hvordan skal følgende fejl, så forstås:

sslug@sslug Study]$ perl hex2dec.plx
Feed me with at hex value: 0x33
Illegal hexadecimal digit '
' ignored at hex2dec.plx line 6, <STDIN> line 1.
0x33
Here you go: 51

Koden er her:

#!/usr/bin/perl
use warnings;
use strict;
print "Feed me with at hex value: ";
my $hex = <STDIN>;
my $dec = hex($hex);
print $hex;
print "Here you go: ", $dec, "\n";


--- Anders


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-09-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *