my $size;
$out =~ /(\d+)/ && $size = $1;

Regular expressions are good for this sort of task.

chad kellerman wrote:

>Hi everyone,
>
>I know there must be a easy way to do this but I just can't figure it
>out.
>
>I issue a command from a remote server and get a variable like so:
>
>my $out = 14G;  # actually it's 14G\n
>
>I am trying to get just a numeric out oif it:
>
>I just want the 14:
>
>I have been tried a lot of things, but I just can't gget the G outta
>there.
>
>Here is what I have now:
>
> my $Size = ( split /G/, chomp $out )[0];
>
>I am grasping at straws.  I tried chop, chomp and the like (substr) but
>just can't get it to drop both the new line character and the G.
>
>Any help?
>
>Thanks,
>Chad 
>
>
>
>




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to