#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    11
    Rep Power
    0

    Question Reading a Line From File


    I have a file with only one line:
    venkat 10000

    when i read this line in to a scalar $line i get

    $line = "Venkat 10000";

    can any one tell me how do i get only '10000' from the above.
  2. #2
  3. !~ /m$/
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    May 2004
    Location
    Reno, NV
    Posts
    4,262
    Rep Power
    1810
    You can split the line at the space.

    Code:
    my ($label, $number) = split / /, $line;
    print "$number\n";
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    11
    Rep Power
    0

    Smile


    Originally Posted by keath
    You can split the line at the space.

    Code:
    my ($label, $number) = split / /, $line;
    print "$number\n";
    it helped thanks

IMN logo majestic logo threadwatch logo seochat tools logo