Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Extracting money from a double quoted string

by ww (Archbishop)
on Dec 06, 2014 at 17:11 UTC ( [id://1109417]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1109417]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (2)
As of 2024-04-26 05:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found