nursyza has asked for the wisdom of the Perl Monks concerning the following question:
Hi. I wanted to print out the line below that was obtained from a text file without including the ";" at the end. How can I do that?
INPUT A, B, C, D;
#READ input A, B, C, D; my $INPUT_DATA = $_; if (defined($INPUT_DATA) && ($INPUT_DATA =~ /INPUT (.*)/)) { my $input_data = $1; my @input_array = split /,/, $1; my $size_input = @input_array; print "Input = "; print scalar "@input_array\n"; print "Number of input = $size_input\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pattern matching
by choroba (Cardinal) on Nov 13, 2018 at 10:49 UTC | |
|
Re: Pattern matching
by Marshall (Canon) on Nov 13, 2018 at 19:16 UTC | |
|
Re: Pattern matching
by Laurent_R (Canon) on Nov 13, 2018 at 19:04 UTC |