Results 1 to 6 of 6

Thread: [perl] converting a string

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Qt products
    Qt3
    Platforms
    Windows
    Thanks
    53

    Default [perl] converting a string

    Hello,
    i have a problem with perl. Se below.
    Qt Code:
    1. my $v =0;
    2. ........................................
    3. if ($_ =~ m/value = (\S+)/) {
    4. $v = $1; // $1 take the right value eg. "e-33"
    5. if ( $v < 1) { # here the error
    6. ......................
    7. }
    8. //the file is:
    9. ..............
    10. otherString value = e-30 otherString
    11. otherString value = 4e-30 otherString
    12. otherString value = 1e-20 otherString
    13. .........................
    To copy to clipboard, switch view to plain text mode 
    I have to extract the value of field "value" in a file a compare it as it was a numerical. But the shell says that $v it's not numeric....

    Is it possible?

    thanks,
    Last edited by mickey; 20th March 2009 at 16:23.
    Regards

Similar Threads

  1. How to use PERL script in Qt
    By joseph in forum Qt Programming
    Replies: 1
    Last Post: 9th August 2007, 21:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.