Chad Kellerman wrote:
> 
> Hi everyone,

Hello,

> 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.


# perl -e'
my $out = "14G\n";
print $out;
my $Size = $out + 0;
print $Size, "\n";
'
14G
14




John
-- 
use Perl;
program
fulfillment

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

Reply via email to