do you mean that you want the 100 in a variable?
If so, here is one way:
while {
# Splitting the line by white spaces.
my $Number = (split /\s+/, $_)[0];
# Deleting the dot at the end.
$Number =~ [EMAIL PROTECTED]@@;
print "$Number\n";
}
HTH,
Yargo.
-
Matthew Stapleton <[EMAIL PROTECTED]> wrote:
> [...] I am wanting to read a line of a file and then
> extract a digit from the beginning of the line. A
> typical line looks something like this:
>
> 100. text text text
>
> So I am using a file handle to open the file and read
> the lines on by
On 21 Mar 2003 at 20:32, Matthew Stapleton wrote:
> Hello,
>
> I am learning Perl and having some fun with it. In a script I am writing
> I am wanting to read a line of a file and then extract a digit from the
> beginning of the line. A typical line looks something like this:
>
> 100. text tex
Matthew Stapleton wrote:
> Hello,
>
> I am learning Perl and having some fun with it. In a script I am
> writing I am wanting to read a line of a file and then extract a
> digit from the beginning of the line. A typical line looks something
> like this:
>
> 100. text text text
>
> So I am usi