in reply to Re: Extracting money from a double quoted string
in thread Extracting money from a double quoted string

Does this pass a syntax, compilation and execution test? Yes.

Does it pass as a reasonable interp of op's use of "read" and/or a sanity test? I dunno!

#!/usr/bin/perl use strict; use warnings; use 5.018; # read_to_dblquoted_str.pl my $str=qq("); my $txt = "abcdef \$3.05 xyz"; # to minimize, assigning this way, st +ed openning a file and reading it. $str .= $txt . qq("); say "\$txt: " . $txt; say "\$str: " . $str; =head C:\> read_to_dblquoted_str.pl $txt: abcdef $3.05 xyz $str: "abcdef $3.05 xyz" =cut

Replies are listed 'Best First'.
Re^3: Extracting money from a double quoted string
by BrowserUk (Patriarch) on Dec 06, 2014 at 18:33 UTC

    That's not "a double quoted string" it's "a string containing double quotes".

    The difference is that a double quoted string in interpreted at compile time as a part of the program.

    What you've constructed at runtime is not. It's just a scalar that contains some characters.

    (Note:when you print a double quoted string; the quotes aren't printed. Their purpose is served by the time you get to runtime.)


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      Thanks for correction and your observation. From /me, ++, despite one misgiving:

      OP's description is sufficiently confused and confusing that it's not at all clear (until we read down to the updated reply) that he has any clue about the meaning of your distinction and -- obviously -- I failed to consider that distinction.